[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

JP6324239B2 - Image processing apparatus, image processing method, and program - Google Patents

Image processing apparatus, image processing method, and program Download PDF

Info

Publication number
JP6324239B2
JP6324239B2 JP2014136281A JP2014136281A JP6324239B2 JP 6324239 B2 JP6324239 B2 JP 6324239B2 JP 2014136281 A JP2014136281 A JP 2014136281A JP 2014136281 A JP2014136281 A JP 2014136281A JP 6324239 B2 JP6324239 B2 JP 6324239B2
Authority
JP
Japan
Prior art keywords
pixel
threshold
threshold value
value
white
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.)
Active
Application number
JP2014136281A
Other languages
Japanese (ja)
Other versions
JP2016015598A5 (en
JP2016015598A (en
Inventor
藤本 昭宏
昭宏 藤本
石川 尚
尚 石川
山田 顕季
顕季 山田
雄介 山本
雄介 山本
裕司 原
裕司 原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2014136281A priority Critical patent/JP6324239B2/en
Priority to EP20186012.9A priority patent/EP3754962B1/en
Priority to EP15001813.3A priority patent/EP2963908B1/en
Priority to US14/750,128 priority patent/US10043118B2/en
Priority to CN201510379810.7A priority patent/CN105323415B/en
Publication of JP2016015598A publication Critical patent/JP2016015598A/en
Publication of JP2016015598A5 publication Critical patent/JP2016015598A5/ja
Application granted granted Critical
Publication of JP6324239B2 publication Critical patent/JP6324239B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Color, Gradation (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

本発明は、閾値マトリクスを用いて入力画像をハーフトーン処理する画像処理技術に関する。   The present invention relates to an image processing technique for halftone processing an input image using a threshold matrix.

コンピュータで処理した画像データを印刷することが広く行われている。しかしながら、コンピュータ上の画像データ(入力画像データ)が表現する階調数に対して、一般に、印刷装置や表示装置などの出力装置が表現可能な階調数は少ない。このため、通常は、入力画像データの階調数を出力装置で表現可能な階調数に変換するハーフトーン処理がなされる。   Printing image data processed by a computer is widely performed. However, the number of gradations that can be expressed by an output device such as a printing device or a display device is generally smaller than the number of gradations expressed by image data (input image data) on a computer. For this reason, normally, halftone processing for converting the number of gradations of the input image data into the number of gradations that can be expressed by the output device is performed.

ハーフトーン処理の一つとして、画像データを周期的に変動する閾値と比較することによって出力値を決定するスクリーン処理(組織的ディザ法)が知られている。スクリーン処理を施すことにより、画像の濃淡を面積階調で表現したスクリーン画像が得られる。面積階調では、一定面積を単位として、この単位面積の中でドットを形成する画素数を変えることで階調を表現している。そのため、スクリーン画像で再現される階調は一定面積内で形成されたドットの数によって決定される。よって、入力画像データにおいて特に階調の変化が少ない平坦部については、均等な間隔で同一形状の網点が形成されるため、良好な画像が得られる。   As one of the halftone processes, a screen process (organized dither method) that determines an output value by comparing image data with a periodically varying threshold value is known. By performing screen processing, a screen image in which the density of the image is expressed by area gradation can be obtained. In the area gradation, gradation is expressed by changing the number of pixels forming dots within the unit area, with a certain area as a unit. Therefore, the gradation reproduced in the screen image is determined by the number of dots formed within a certain area. Therefore, in the input image data, particularly in a flat portion where the change in gradation is small, halftone dots having the same shape are formed at equal intervals, so that a good image can be obtained.

ところが、入力画像データにおいて一定面積内で階調が大きく変化する細線などは、細線の濃度や角度によっては細線の位置にドットを形成出来なくなり、細線の途切れや消失が発生してしまうことがある。   However, for fine lines whose gradation changes greatly within a certain area in the input image data, dots cannot be formed at the positions of the fine lines depending on the density and angle of the fine lines, and the fine lines may be interrupted or lost. .

特開2012−157998号公報JP 2012-157998 A 特開平11−345327号公報JP-A-11-345327

上述のような問題に対しては、例えば、入力画像データ内の細線の位置を検出し、通常のスクリーン処理では当該細線の位置にドットが形成されない場合、当該細線の位置の閾値をドットが形成される閾値に変更し、再度スクリーン処理を行なう技術がある。この技術では、ドットが形成されない細線位置の閾値をドットが形成される閾値に変更することで、ドットが形成される箇所を増加させて、細線が途切れを防ぐことを実現している(特許文献1)。   To solve the above-mentioned problem, for example, when the position of a fine line in input image data is detected and a dot is not formed at the position of the fine line in normal screen processing, the dot is formed as a threshold value of the position of the fine line. There is a technique in which the threshold value is changed to a threshold value and screen processing is performed again. In this technique, by changing the threshold value of the fine line position where the dot is not formed to the threshold value where the dot is formed, it is possible to increase the number of places where the dot is formed and prevent the fine line from being interrupted (Patent Literature). 1).

また、入力画像データ内の細線の位置を検出し、検出された細線の位置の閾値を小さくすることでドットが形成される確率を増加させる技術もある(特許文献2)。   There is also a technique for increasing the probability that dots are formed by detecting the position of a fine line in input image data and reducing the threshold of the position of the detected fine line (Patent Document 2).

上述した特許文献1や特許文献2に記載された手法では、局所領域においてドットを形成したい閾値を一律に変更することになる。しかしながら、前述したとおりスクリーン処理では面積階調で階調を表現している。よって、階調を再現するには所定面積内で形成されるドット数が重要である。この点、上述の特許文献1や特許文献2の手法では、細線として検出された位置の閾値を一律に変更するため、当該検出部分の階調性が崩れてしまう。その結果、細線として検出された部分と細線として検出されなかった部分との境界で階調の不連続が発生するという問題があった。   In the methods described in Patent Document 1 and Patent Document 2 described above, the threshold value at which dots are to be formed in the local region is uniformly changed. However, as described above, in the screen processing, gradation is expressed by area gradation. Therefore, the number of dots formed within a predetermined area is important for reproducing the gradation. In this regard, in the methods of Patent Document 1 and Patent Document 2 described above, since the threshold value of the position detected as a thin line is uniformly changed, the gradation of the detected portion is lost. As a result, there has been a problem that gradation discontinuity occurs at the boundary between a portion detected as a thin line and a portion not detected as a thin line.

本発明に係る画像処理装置は、画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理装置において、入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定する判定手段と、前記所定領域に含まれる全画素に対応する閾値のうち、最も小さい閾値を抽出する第一の抽出手段と、前記所定領域における非白画素に対応する閾値のうち、最も小さい閾値を抽出する第二の抽出手段と、前記第一の抽出手段により抽出された閾値が、前記第二の抽出手段により抽出された閾値よりも小さい場合、前記第一の抽出手段により抽出された閾値に基づいて、前記第二の抽出手段により抽出された閾値を書き換える書換手段とを備えることを特徴とする。
An image processing apparatus according to the present invention, in an image processing apparatus that generates a halftone image by quantizing with different threshold values according to pixel positions, performs whitening on a plurality of pixels included in a predetermined region in an input image. A determination unit that determines whether or not the pixel is a pixel, a first extraction unit that extracts the smallest threshold among the thresholds corresponding to all pixels included in the predetermined region, and a non-white pixel in the predetermined region The second extracting means for extracting the smallest threshold value among the threshold values to be extracted and the threshold value extracted by the first extracting means is smaller than the threshold value extracted by the second extracting means; And rewriting means for rewriting the threshold extracted by the second extracting means based on the threshold extracted by the extracting means.

本発明によれば、濃度の変動を抑えつつ細線の再現性を向上させることができる。   According to the present invention, it is possible to improve the reproducibility of thin lines while suppressing fluctuations in density.

実施例1に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。1 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to Embodiment 1. FIG. 実施例1に係る、閾値書換処理を行なった場合と行なわなかった場合の出力画像の違いを説明する図である。FIG. 10 is a diagram illustrating a difference in output image between when the threshold rewriting process is performed and when it is not performed according to the first embodiment. 実施例1に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。3 is a flowchart illustrating details of processing executed by the image processing apparatus according to the first exemplary embodiment. 実施例1の変形例1に係る、図3Aに対応するフローチャートである。4 is a flowchart corresponding to FIG. 3A according to Modification 1 of Embodiment 1. FIG. 実施例4の変形例1に係る、図3Aに対応するフローチャートである。6 is a flowchart corresponding to FIG. 3A, according to a first modification of the fourth embodiment. 実施例2に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 9 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to a second embodiment. 実施例2に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。12 is a flowchart illustrating details of processing executed by the image processing apparatus according to the second embodiment. 実施例4に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。10 is a flowchart illustrating details of processing executed by the image processing apparatus according to a fourth embodiment. 実施例3に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to a third embodiment. 実施例3に係る、閾値書換処理を行なった場合と行なわなかった場合の出力画像の違いを説明する図である。FIG. 10 is a diagram illustrating a difference in output image between when the threshold rewriting process is performed and when not performed according to the third embodiment. 実施例3に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。10 is a flowchart illustrating details of processing executed by the image processing apparatus according to a third embodiment. 実施例3の変形例2に係る、図8Aに対応するフローチャートである。FIG. 8B is a flowchart corresponding to FIG. 8A according to a second modification of the third embodiment. 実施例3の変形例3に係る、図8Aに対応するフローチャートである。FIG. 9B is a flowchart corresponding to FIG. 8A according to Modification 3 of Example 3. FIG. 実施例5に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to a fifth embodiment. 実施例6に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to a sixth embodiment. 実施例7に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to a seventh embodiment. 実施例7に係る、係数決定部で参照されるLUTの入出力特性の一例を示すグラフである。18 is a graph illustrating an example of input / output characteristics of an LUT referred to by a coefficient determination unit according to the seventh embodiment. 実施例8に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to an eighth embodiment. 実施例8に係る、係数決定部で参照されるLUTの入出力特性の一例を示すグラフである。10 is a graph illustrating an example of input / output characteristics of an LUT referred to by a coefficient determination unit according to an eighth embodiment. 実施例9に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to a ninth embodiment. 実施例9に係る、閾値変換部で参照されるLUTの入出力特性の一例を示すグラフである。It is a graph which shows an example of the input-output characteristic of LUT referred by the threshold value conversion part based on Example 9. FIG. 実施例10に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 16 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to Embodiment 10. 実施例10に係る、閾値書換処理を行なった場合と行なわなかった場合の出力画像の違いを説明する図である。It is a figure explaining the difference of the output image when not performing it with the threshold value rewriting process based on Example 10. FIG. 実施例10に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。18 is a flowchart illustrating details of processing executed by the image processing apparatus according to the tenth embodiment. 実施例11に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 20 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to an eleventh embodiment. 実施例11に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。20 is a flowchart illustrating details of processing executed by the image processing apparatus according to an eleventh embodiment. 実施例12に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 20 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to Embodiment 12; 実施例12に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。19 is a flowchart illustrating details of processing executed by the image processing apparatus according to a twelfth embodiment. 実施例13に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 20 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to Embodiment 13; 実施例13に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。19 is a flowchart illustrating details of processing executed by the image processing apparatus according to Embodiment 13; 実施例13に係る、閾値並び換え処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the threshold value rearrangement process based on Example 13. FIG. 入力画像の所定領域と閾値マトリクスとの関係を示す図である。It is a figure which shows the relationship between the predetermined area | region of an input image, and a threshold value matrix. 実施例15に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。FIG. 20 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to Embodiment 15. 実施例15に係る、画像処理装置で実行される処理の詳細を示すフローチャートである。25 is a flowchart illustrating details of processing executed by the image processing apparatus according to the fifteenth embodiment.

以下、添付の図面を参照して、本発明を好適な実施例に基づいて詳細に説明する。なお、以下の実施例において示す構成は一例にすぎず、本発明は図示された構成に限定されるものではない。   Hereinafter, the present invention will be described in detail based on preferred embodiments with reference to the accompanying drawings. In addition, the structure shown in the following Examples is only an example, and this invention is not limited to the structure shown in figure.

図1は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。   FIG. 1 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment.

画素値/閾値取得部101は、入力画像データの所定領域に含まれる各画素の画素値、及び各画素位置に対応する閾値を、不図示のRAM等から取得する。ここでは、所定領域を縦4画素×横4画素のブロック領域とするが、所定領域の形状及びサイズはこれに限定するものではない。取得した画素値は、白画素判定部102及び量子化部106送られる。また、取得した閾値は、白画素最小閾値抽出部103及び非白画素最小閾値抽出部104に送られる。   The pixel value / threshold acquisition unit 101 acquires a pixel value of each pixel included in a predetermined area of the input image data and a threshold corresponding to each pixel position from a RAM (not shown) or the like. Here, the predetermined area is a block area of 4 pixels in the vertical direction and 4 pixels in the horizontal direction, but the shape and size of the predetermined area are not limited thereto. The acquired pixel value is sent to the white pixel determination unit 102 and the quantization unit 106. The acquired threshold value is sent to the white pixel minimum threshold value extraction unit 103 and the non-white pixel minimum threshold value extraction unit 104.

白画素判定部102は、所定領域の中を濃度に応じて複数の領域に分割する手段として、画素値/閾値取得部101から受け取った画素値に基づいて、所定領域における各画素が白画素であるかどうかを判定する。例えば画素値「0」が白画素を示す場合には、入力された画素値が「0」であるかどうかによって白画素かどうかを判定し、上述の所定領域が、白画素で構成される領域と、白画素以外の画素(非白画素)で構成される領域とに分割することになる。そして、所定領域内における白画素を特定する情報(白画素の領域と非白画素の領域とを特定する情報、以下、「白画素情報」)が、白画素最小閾値抽出部103及び非白画素最小閾値抽出部104に送られる。なお、白画素判定部102に代えて、RIP(Raster Image Processor)装置等で生成された属性情報を使用しても良い。   As a means for dividing the predetermined area into a plurality of areas according to the density, the white pixel determination unit 102 is based on the pixel value received from the pixel value / threshold acquisition unit 101 and each pixel in the predetermined area is a white pixel. Determine if it exists. For example, when the pixel value “0” indicates a white pixel, whether the input pixel value is “0” determines whether the pixel is a white pixel, and the predetermined area is an area configured by white pixels. And an area composed of pixels other than white pixels (non-white pixels). Information for specifying a white pixel in a predetermined area (information for specifying a white pixel area and a non-white pixel area, hereinafter “white pixel information”) includes the white pixel minimum threshold extraction unit 103 and the non-white pixel. It is sent to the minimum threshold extraction unit 104. Instead of the white pixel determination unit 102, attribute information generated by a RIP (Raster Image Processor) device or the like may be used.

白画素最小閾値抽出部103は、白画素判定部102から受け取った白画素情報と、画素値/閾値取得部101から受け取った閾値を用いて、所定領域内の白画素からなる白画素群の閾値を参照する。白画素最小閾値抽出部103は、白画素の位置に対応する閾値の中から最小の閾値(以下、白画素最小閾値)を抽出する。抽出された白画素最小閾値の情報は、閾値書換部105に送られる。   The white pixel minimum threshold value extraction unit 103 uses the white pixel information received from the white pixel determination unit 102 and the threshold value received from the pixel value / threshold acquisition unit 101 to detect the threshold value of the white pixel group including white pixels in a predetermined area. Refer to The white pixel minimum threshold value extraction unit 103 extracts a minimum threshold value (hereinafter, “white pixel minimum threshold value”) from the threshold values corresponding to the position of the white pixel. The extracted white pixel minimum threshold information is sent to the threshold rewriting unit 105.

非白画素最小閾値抽出部104は、白画素判定部102から受け取った白画素情報と、画素値/閾値取得部101から受け取った閾値を用いて、所定領域内の非白画素(白画素以外の画素)からなる非白画素群の閾値を参照する。非白画素最小閾値抽出部104は、非白画素の位置に対応する閾値の中から最小の閾値(以下、非白画素最小閾値)を抽出する。抽出された非白画素最小閾値の情報は、閾値書換部105に送られる。   The non-white pixel minimum threshold value extraction unit 104 uses the white pixel information received from the white pixel determination unit 102 and the threshold value received from the pixel value / threshold value acquisition unit 101 to generate non-white pixels (other than white pixels) in a predetermined area. Reference is made to the threshold value of the non-white pixel group consisting of pixels. The non-white pixel minimum threshold value extraction unit 104 extracts a minimum threshold value (hereinafter referred to as a non-white pixel minimum threshold value) from threshold values corresponding to the positions of the non-white pixels. The extracted non-white pixel minimum threshold information is sent to the threshold rewriting unit 105.

閾値書換部105は、入力画像に対応する閾値マトリクスについて、非白画素最小閾値を白画素最小閾値に書き換える処理を行なう。具体的には、白画素最小閾値と非白画素最小閾値とを比較し、白画素最小閾値の方が小さい値(ドットが形成される確率が高い閾値)であった場合に、非白画素最小閾値を白画素最小閾値に置き換える処理がなされる。   The threshold rewriting unit 105 performs processing for rewriting the non-white pixel minimum threshold value to the white pixel minimum threshold value for the threshold value matrix corresponding to the input image. Specifically, when the white pixel minimum threshold is compared with the non-white pixel minimum threshold, and the white pixel minimum threshold is smaller (threshold with a higher probability of dot formation), the non-white pixel minimum Processing to replace the threshold with the white pixel minimum threshold is performed.

前述した通り、面積階調では所定面積内に形成するドット数で階調を表現している。しかし、ドットを形成したい位置の画素が白画素であった場合は、位置的に対応する閾値がいかなる値であってもドットは形成されない。その結果、所定面積内に形成されるドット数が減少、あるいはドットが消滅する可能性がある。そこで、本実施例では、白画素群に対応する閾値のうち最小である閾値が、ドットが形成される確率が高い閾値(比較的小さい値の閾値)である場合に、非白画素群に対応する閾値のうち最小である閾値を、白画素群の最小閾値に置き換える。これにより、対応する閾値の値が比較的大きいために所定領域内において他の画素よりもドットが形成される確率が低かった非白画素の位置にドットが形成されやすくなる。その結果、面積階調で定義した所定面積内の閾値や画素値を変更することなく、入力画像データの白画素以外の位置にドットを形成することができる。なお、非白画素の最小閾値は白画素の最小閾値に変わってしまうが、非白画素の最小閾値を白画素の最小閾値と交換したと考えれば所定面積内の閾値の組み合わせに変更はない。本実施例では、白画素位置の閾値がいかなる値であってもその位置にドットは形成されないことを踏まえ、白画素の最小閾値の置換は行わない。
量子化部106は、入力された画素値(入力画素値)と書換済みの閾値マトリクスを用いて、入力画素値の量子化を行う。
As described above, in the area gradation, the gradation is expressed by the number of dots formed within a predetermined area. However, when the pixel at the position where the dot is to be formed is a white pixel, the dot is not formed regardless of the threshold value corresponding to the position. As a result, there is a possibility that the number of dots formed within a predetermined area is reduced or the dots disappear. Therefore, in this embodiment, when the threshold value that is the smallest among the threshold values corresponding to the white pixel group is a threshold value with a high probability of forming dots (threshold value with a relatively small value), it corresponds to the non-white pixel group. The threshold that is the smallest of the thresholds to be replaced is replaced with the minimum threshold of the white pixel group. As a result, since the corresponding threshold value is relatively large, dots are more likely to be formed at positions of non-white pixels where the probability of forming dots in the predetermined area is lower than in other pixels. As a result, it is possible to form dots at positions other than the white pixels of the input image data without changing the threshold value or pixel value within a predetermined area defined by the area gradation. Note that the minimum threshold value of the non-white pixel is changed to the minimum threshold value of the white pixel, but if the minimum threshold value of the non-white pixel is replaced with the minimum threshold value of the white pixel, the combination of threshold values within a predetermined area is not changed. In the present embodiment, since the dot is not formed at any position of the threshold value of the white pixel position, the white pixel minimum threshold value is not replaced.
The quantization unit 106 quantizes the input pixel value using the input pixel value (input pixel value) and the rewritten threshold matrix.

なお、図示していないが、画像処理装置100は、上記各部を実現するためのハードウェア構成、すなわち、各種プログラムやデータを記憶するためのHDD、ROM、RAM、さらにはプログラムを実行し各部を統括的に制御するCPUなどを備えている。   Although not shown, the image processing apparatus 100 executes a hardware configuration for realizing the above-described units, that is, an HDD, a ROM, a RAM for storing various programs and data, and further executes the programs. A CPU for overall control is provided.

図2は、本実施例に係る閾値書換処理を行なった場合と行なわなかった場合の出力画像の違いを説明する図である。   FIG. 2 is a diagram for explaining a difference between output images when the threshold value rewriting process according to the present embodiment is performed and when it is not performed.

縦4画素×横4画素の入力画像201は、3列目の画素値が「32」でそれ以外の画素値が「0」の画像データである。閾値マトリクス202は、閾値書換処理がなされる前の、入力画像201に対応する閾値マトリクスである。閾値マトリクス202において、閾値が小さい位置ほど、ドットが形成される確率が高いことを意味する。例えば、閾値「8」に対応する画素は、入力画素値0〜255のち「9」以上であればオンドットに量子化される。つまり所定領域において最もドットが形成される確率が高い。一方、閾値「252」の画素は、入力画素値0〜255のうち、「253」、「254」「255」の画素値の場合のみオンドットに量子化される。従って閾値「252」に対応するする画素は最もドットが形成される確率が低いことを意味する。   The input image 201 of 4 vertical pixels × 4 horizontal pixels is image data in which the pixel value in the third column is “32” and the other pixel values are “0”. The threshold matrix 202 is a threshold matrix corresponding to the input image 201 before the threshold rewriting process is performed. In the threshold value matrix 202, the smaller the threshold value, the higher the probability that dots will be formed. For example, a pixel corresponding to the threshold value “8” is quantized to an on-dot if the input pixel value is 0 to 255 and is “9” or more. That is, there is a high probability that a dot is formed in a predetermined area. On the other hand, the pixel having the threshold value “252” is quantized to the on-dot only when the pixel values are “253”, “254”, and “255” among the input pixel values 0 to 255. Therefore, the pixel corresponding to the threshold value “252” means that the probability that the dot is formed is the lowest.

スクリーン画像204は、閾値マトリクス202を用いて入力画像201を量子化した場合に得られる出力画像である。入力画像201の3列目の画素値「32」に対し、閾値マトリクス202の3列目の閾値の最小値は「50」(図中の△)であるため、スクリーン画像204にはドットが存在していない(ドット消失)。   The screen image 204 is an output image obtained when the input image 201 is quantized using the threshold value matrix 202. Since the minimum value of the threshold value in the third column of the threshold value matrix 202 is “50” (Δ in the figure) with respect to the pixel value “32” in the third column of the input image 201, there are dots in the screen image 204. Not (dot disappearance).

閾値マトリクス203は、閾値書換処理がなされた後の、入力画像201に対応する閾値マトリクスである。閾値マトリクス203では、閾値マトリクス202における白画素最小閾値「8」(図中の○)の値で、非白画素最小閾値「50」が置換されているのが分かる。スクリーン画像205は、閾値書換後の閾値マトリクス203を用いて入力画像201を量子化した場合に得られる出力画像である。スクリーン画像205では、スクリーン画像204では存在しなかった(消失していた)ドットを再現することができている。   The threshold value matrix 203 is a threshold value matrix corresponding to the input image 201 after the threshold value rewriting process is performed. In the threshold matrix 203, it can be seen that the non-white pixel minimum threshold “50” is replaced with the value of the white pixel minimum threshold “8” (◯ in the figure) in the threshold matrix 202. The screen image 205 is an output image obtained when the input image 201 is quantized using the threshold value matrix 203 after threshold value rewriting. In the screen image 205, it is possible to reproduce dots that were not present (disappeared) in the screen image 204.

図3Aは、本実施例に係る画像処理装置で実行される処理のうち、白画素最小閾値抽出処理、非白画素最小閾値抽出処理、及び閾値書換処理についての詳細を示すフローチャートである。なお、この一連の処理は、以下に示す手順を記述したコンピュータ実行可能なプログラムを、ROM等からRAM上に読み込んだ後、CPUによって該プログラムを実行することによって実施される。   FIG. 3A is a flowchart illustrating details of a white pixel minimum threshold extraction process, a non-white pixel minimum threshold extraction process, and a threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment. This series of processing is carried out by reading a computer-executable program describing the following procedure from a ROM or the like onto a RAM and then executing the program by the CPU.

ステップ301において、白画素最小閾値抽出部103は、白画素位置の最小閾値を保持する変数である白画素最小閾値(MinTHoff)を初期化する。同様に、非白画素最小閾値抽出部104は、非白画素位置の最小閾値を保持する変数である非白画素最小閾値(MinTHon)を初期化する。具体的には、MinTHoff及びMinTHonの値に、スクリーン処理における閾値の最大値(又は入力画素値のレンジの最大値)をそれぞれセットする。なお、これら変数はRAMにて保持される。 In step 301, the white pixel minimum threshold value extraction unit 103 initializes a white pixel minimum threshold value (MinTH off ) that is a variable that holds the minimum threshold value of the white pixel position. Similarly, the non-white pixel minimum threshold extraction unit 104 initializes a non-white pixel minimum threshold (MinTH on ) that is a variable that holds the minimum threshold of the non-white pixel position. Specifically, the maximum threshold value in screen processing (or the maximum value of the range of input pixel values) is set as the MinTH off and MinTH on values, respectively. These variables are held in the RAM.

ステップ302において、白画素最小閾値抽出部103及び非白画素最小閾値抽出部104は、所定領域内の注目画素についての白画素情報、及び当該注目画素に対応する閾値を取得する。   In step 302, the white pixel minimum threshold value extraction unit 103 and the non-white pixel minimum threshold value extraction unit 104 acquire white pixel information about a target pixel in a predetermined region and a threshold value corresponding to the target pixel.

ステップ303では、ステップ302で取得した白画素情報に基づいて、注目画素が白画素であるかどうかが判定される。判定の結果、白画素である場合は、ステップ304に進む。一方、白画素でない場合(非白画素である場合)は、ステップ306に進む。なお、ここでは白画素判定部102の判定結果である白画素情報に基づいて注目画素が白画素であるかどうかを判定しているが、注目画素の画素値から直接に白画素であるかどうかを判定してもよい。   In step 303, based on the white pixel information acquired in step 302, it is determined whether or not the target pixel is a white pixel. If it is determined that the pixel is a white pixel, the process proceeds to step 304. On the other hand, if it is not a white pixel (if it is a non-white pixel), the process proceeds to step 306. Here, it is determined whether or not the target pixel is a white pixel based on the white pixel information that is the determination result of the white pixel determination unit 102, but whether or not the target pixel is a white pixel directly from the pixel value of the target pixel. May be determined.

ステップ304において、白画素最小閾値抽出部103は、現時点の白画素最小閾値(MinTHoff)とステップ302で取得した注目画素の閾値とを比較する。比較の結果、MinTHoffの値が注目画素の閾値より大きい場合は、ステップ305に進む。一方、MinTHoffの値が注目画素の閾値より大きくない場合は、ステップ308に進む。 In step 304, the white pixel minimum threshold value extraction unit 103 compares the current white pixel minimum threshold value (MinTH off ) with the threshold value of the target pixel acquired in step 302. As a result of the comparison, if the value of MinTH off is larger than the threshold value of the target pixel, the process proceeds to step 305. On the other hand, if the value of MinTH off is not larger than the threshold value of the target pixel, the process proceeds to step 308.

ステップ305において、白画素最小閾値抽出部103は、MinTHoffの値を、ステップ302で取得した閾値に更新する。 In step 305, the white pixel minimum threshold value extraction unit 103 updates the value of MinTH off to the threshold value acquired in step 302.

ステップ306において、非白画素最小閾値抽出部104は、非白画素最小閾値(MinTHon)とステップ302で取得した注目画素の閾値とを比較する。比較の結果、MinTHonの値が注目画素の閾値より大きい場合は、ステップ307に進む。一方、MinTHonの値が注目画素の閾値より大きくない場合は、ステップ308に進む。 In step 306, the non-white pixel minimum threshold value extraction unit 104 compares the non-white pixel minimum threshold value (MinTH on ) with the threshold value of the target pixel acquired in step 302. As a result of the comparison, if the value of MinTH on is larger than the threshold value of the target pixel, the process proceeds to step 307. On the other hand, if the value of MinTH on is not larger than the threshold value of the target pixel, the process proceeds to step 308.

ステップ307において、非白画素最小閾値抽出部104は、MinTHonの値を、ステップ302で取得した閾値に更新する。 In step 307, the non-white pixel minimum threshold value extraction unit 104 updates the value of MinTH on to the threshold value acquired in step 302.

ステップ308では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ309に進む。ステップ309に進んだ時点で、所定領域内の白画素位置における最小閾値がMinTHoffとして保持され、非白画素位置における最小閾値がMinTHonとして保持されていることになる。一方、所定領域内に未処理の画素があればステップ302に戻り、次の画素を注目画素としてステップ302〜ステップ307の各処理を行なう。 In step 308, it is determined whether or not processing has been completed for all pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 309. When the processing proceeds to step 309, the minimum threshold value at the white pixel position in the predetermined area is held as MinTH off , and the minimum threshold value at the non-white pixel position is held as MinTH on . On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to step 302, and each process of step 302 to step 307 is performed with the next pixel as the target pixel.

ステップ309において、閾値書換部105は、所定領域内の注目画素に対応する閾値を取得する。   In step 309, the threshold rewriting unit 105 acquires a threshold corresponding to the target pixel in the predetermined area.

ステップ310において、閾値書換部105は、ステップ309で取得した閾値と、非白画素最小閾値(MinTHon)とが同じであるかどうかを判定する。両者が同じ値である場合は、ステップ311に進む。一方、両者が同じ値でない場合は、ステップ313に進む。 In step 310, the threshold rewriting unit 105 determines whether or not the threshold acquired in step 309 is the same as the non-white pixel minimum threshold (MinTH on ). If both are the same value, the process proceeds to step 311. On the other hand, if both are not the same value, the process proceeds to step 313.

ステップ311において、閾値書換部105は、白画素最小閾値(MinTHoff)とステップ309で取得した閾値とを比較する。この比較の時点で、ステップ309で取得した閾値は、非白画素最小閾値(MinTHon)と同じ値である。よって、本ステップでは、非白画素最小閾値(MinTHon)と白画素最小閾値(MinTHoff)との大小関係を比較していることになる。判定の結果、白画素最小閾値が非白画素最小閾値(取得した閾値)より小さい場合は、ステップ312に進む。一方、白画素最小閾値が非白画素最小閾値(取得した閾値)より小さくない場合は、ステップ313に進む。 In step 311, the threshold rewriting unit 105 compares the white pixel minimum threshold (MinTH off ) with the threshold acquired in step 309. At the time of this comparison, the threshold acquired in step 309 is the same value as the non-white pixel minimum threshold (MinTH on ). Therefore, in this step, the magnitude relationship between the non-white pixel minimum threshold (MinTH on ) and the white pixel minimum threshold (MinTH off ) is compared. As a result of the determination, if the white pixel minimum threshold is smaller than the non-white pixel minimum threshold (acquired threshold), the process proceeds to step 312. On the other hand, if the white pixel minimum threshold is not smaller than the non-white pixel minimum threshold (acquired threshold), the process proceeds to step 313.

ステップ312において、閾値書換部105は、ステップ309で取得した閾値を白画素最小閾値で置換する。すなわち、注目画素に対応する閾値として、白画素最小閾値(MinTHoff)の値が設定されることになる。 In step 312, the threshold rewriting unit 105 replaces the threshold acquired in step 309 with the white pixel minimum threshold. That is, the value of the white pixel minimum threshold (MinTH off ) is set as the threshold corresponding to the target pixel.

ステップ313では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。未処理の画素がある場合は、ステップ309に戻り、次の画素を注目画素としてステップ309〜ステップ312の処理を繰り返す。一方、すべての画素に対して処理が終了していた場合は、本処理を終える。   In step 313, it is determined whether or not the processing has been completed for all the pixels in the predetermined area. If there is an unprocessed pixel, the process returns to step 309, and the processing of step 309 to step 312 is repeated with the next pixel as the target pixel. On the other hand, if the processing has been completed for all the pixels, the present processing ends.

以上が、本実施例における、白画素最小閾値抽出処理、非白画素最小閾値抽出処理及び閾値書換処理の内容である。   The above is the contents of the white pixel minimum threshold extraction process, the non-white pixel minimum threshold extraction process, and the threshold rewriting process in the present embodiment.

これにより、量子化に使用する閾値マトリクスの非白画素についての最小閾値が、ドットが形成される確率が高い閾値へと、所定領域毎に書き換えられる。   Thereby, the minimum threshold value for the non-white pixel of the threshold value matrix used for quantization is rewritten for each predetermined region to a threshold value with a high probability of dot formation.

<変形例1>
上述の実施例1では、注目画素の閾値が、非白画素の最小閾値であって(S310でYes)かつ、白画素最小閾値よりも大きい場合(ステップ311でYes)に、注目画素の閾値を白画素最小閾値で置換した。その目的は、当該注目画素をオンドットにすることにある。そこで、端的にオンドットを決定する別態様を変形例1として説明する。
<Modification 1>
In the first embodiment described above, when the threshold value of the target pixel is the minimum threshold value of the non-white pixel (Yes in S310) and is larger than the white pixel minimum threshold value (Yes in Step 311), the threshold value of the target pixel is set. Replaced with the white pixel minimum threshold. The purpose is to make the pixel of interest on-dot. Therefore, another mode for simply determining the on-dot will be described as a first modification.

図3Bは、この変形例1に係る、上述の図3Aに対応するフローチャートである。ステップ301〜308、310、311、313については図3Aと異なるところはないので、以下では、差異点であるステップ309’及び312’を中心に説明する。   FIG. 3B is a flowchart corresponding to FIG. 3A described above, according to the first modification. Since steps 301 to 308, 310, 311, and 313 are not different from FIG. 3A, the following description will focus on steps 309 'and 312' that are different points.

ステップ309’において、閾値書換部105は、所定領域内の注目画素に対応する閾値に加え、当該注目画素の画素値を取得する。   In step 309 ′, the threshold rewriting unit 105 acquires the pixel value of the target pixel in addition to the threshold corresponding to the target pixel in the predetermined area.

取得した注目画素に対応する閾値が、非白画素の最小閾値であって(S310でYes)、かつ、白画素最小閾値よりも大きい場合に(ステップ311でYes)、ステップ312’において、閾値書換部105は、当該注目画素をオンドットに決定する。具体的には、置換する予定であった閾値(白画素最小閾値)と、ステップ309’で取得した画素値とを比較し、画素値の方が大きければ、当該注目画素に対応する閾値を「0」に設定する。これにより、当該注目画素は確実にオンドットとなる。   When the threshold value corresponding to the acquired target pixel is the minimum threshold value of the non-white pixel (Yes in S310) and is larger than the minimum threshold value of the white pixel (Yes in Step 311), the threshold value is rewritten in Step 312 ′. The unit 105 determines the target pixel as an on dot. Specifically, the threshold value (white pixel minimum threshold value) scheduled to be replaced is compared with the pixel value acquired in step 309 ′. If the pixel value is larger, the threshold value corresponding to the target pixel is set to “ Set to “0”. This ensures that the pixel of interest is on-dot.

また、画像処理装置の動作モードとして、例えば細線を強調するモードが指定されているようなケースでは、非白画素群における所定の数の閾値を強制的に「0」に設定するようにしてもよい。この場合において、「所定の数」は、閾値マトリクスのサイズに依存し、例えば4×4であれば1個、8×8であれば2個、といったように決定される。これにより、濃度は若干変動することになるが、細線を確実に再現することが可能となる。   For example, in a case where a mode for emphasizing a thin line is designated as the operation mode of the image processing apparatus, a predetermined number of threshold values in the non-white pixel group may be forcibly set to “0”. Good. In this case, the “predetermined number” depends on the size of the threshold matrix, and is determined to be, for example, 1 for 4 × 4 and 2 for 8 × 8. As a result, although the density slightly varies, it is possible to reliably reproduce the thin line.

<変形例2>
また、上述の実施例1では、閾値置換部105において量子化に使用する閾値マトリクス自体の書換を行い、当該書き換えられた閾値マトリクスを用いて量子化部106で量子化を行なうことを前提としているが、このような態様に限定されるものではない。たとえば、閾値マトリクス自体は量子化部106で保持しておき、閾値マトリクスにおけるどの閾値をどのような値に書き換えるのかを示す情報(以下、閾値書換情報)を、閾値書換部105で生成する構成でもよい。この場合、閾値書換部105で生成された閾値書換情報が量子化部106に送られ、量子化部106において、閾値書換情報を基に閾値マトリクスの修正を行った上で、量子化処理がなされることになる。
<Modification 2>
In the first embodiment described above, it is assumed that the threshold value replacement unit 105 rewrites the threshold value matrix itself used for quantization, and the quantization unit 106 performs quantization using the rewritten threshold value matrix. However, it is not limited to such an embodiment. For example, the threshold value matrix itself is held by the quantization unit 106, and the threshold value rewriting unit 105 generates information indicating which threshold value in the threshold value matrix is rewritten to what value (hereinafter, threshold value rewriting information). Good. In this case, the threshold rewriting information generated by the threshold rewriting unit 105 is sent to the quantization unit 106, and the quantization unit 106 corrects the threshold matrix based on the threshold rewriting information, and then performs the quantization process. Will be.

実施例1では、所定領域内の白画素の最小閾値が、ドットが形成される確率が高い閾値であった場合に、非白画素の最小閾値を、白画素の最小閾値と同じ値に書き換えていた。次に、所定領域内の全画素中の最小閾値が、ドットが形成される確率が高い閾値であった場合に、非白画素の最小閾値を、全画素中の最小閾値と同じ値に書き換える態様について、実施例2として説明する。なお、実施例1と共通する部分(変形例を含む)については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the first embodiment, when the minimum threshold value of the white pixel in the predetermined area is a threshold value with a high probability of dot formation, the minimum threshold value of the non-white pixel is rewritten to the same value as the minimum threshold value of the white pixel. It was. Next, when the minimum threshold value in all pixels in the predetermined area is a threshold value with a high probability that dots are formed, the minimum threshold value of non-white pixels is rewritten to the same value as the minimum threshold value in all pixels Will be described as a second embodiment. In addition, about the part (including a modification) which is common in Example 1, description is abbreviate | omitted or simplified, and below, it demonstrates centering on difference.

図4は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。   FIG. 4 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment.

画素値/閾値取得部101、白画素判定部102、非白画素最小閾値抽出部104、量子化部106は、実施例1と同じであるので説明を省略する。   Since the pixel value / threshold value acquisition unit 101, white pixel determination unit 102, non-white pixel minimum threshold value extraction unit 104, and quantization unit 106 are the same as those in the first embodiment, description thereof will be omitted.

全画素最小閾値抽出部401は、画素値/閾値取得部101から受け取った閾値を用いて、所定領域内の全画素に対応する閾値の中から最小の閾値(以下、全画素最小閾値)を抽出する。   The all-pixel minimum threshold value extraction unit 401 uses the threshold value received from the pixel value / threshold value acquisition unit 101 to extract the minimum threshold value (hereinafter, all-pixel minimum threshold value) from the threshold values corresponding to all the pixels in the predetermined area. To do.

閾値書換部402は、入力画像に対応する閾値マトリクスについて、非白画素最小閾値を全画素最小閾値に書き換える処理を行なう。具体的には、全画素最小閾値と非白画素最小閾値とを比較し、全画素最小閾値の方が小さい値(ドットが形成される確率が高い閾値)であった場合に、非白画素最小閾値を全画素最小閾値に置き換える処理がなされる。つまり、本実施例における書換処理では、全画素最小閾値抽出部401で抽出された最小閾値が白画素に対応する位置にあった場合のみ、非白画素最小閾値との置き換えがなされることとなる。   The threshold rewriting unit 402 performs processing for rewriting the non-white pixel minimum threshold value to the all pixel minimum threshold value for the threshold value matrix corresponding to the input image. Specifically, when the all-pixel minimum threshold is compared with the non-white pixel minimum threshold, and the all-pixel minimum threshold is a smaller value (threshold with a higher probability of dot formation), the non-white pixel minimum Processing to replace the threshold value with the all pixel minimum threshold value is performed. That is, in the rewrite processing in the present embodiment, the replacement with the non-white pixel minimum threshold is performed only when the minimum threshold extracted by the all-pixel minimum threshold extraction unit 401 is at a position corresponding to the white pixel. .

なお、白画素判定部102における処理内容自体は実施例1と同じであるが、本実施例では、その処理結果である白画素情報が非白画素最小閾値抽出部104にのみ入力される。これは、全画素最小閾値抽出部401は、所定領域内の全画素に対応する閾値を対象に処理を行なうもので、その処理に白画素情報は不要なためである。   Note that the processing content itself in the white pixel determination unit 102 is the same as that in the first embodiment, but in this embodiment, white pixel information that is the processing result is input only to the non-white pixel minimum threshold extraction unit 104. This is because the all-pixel minimum threshold value extraction unit 401 performs processing for threshold values corresponding to all pixels in a predetermined region, and white pixel information is not necessary for the processing.

図5Aは、本実施例に係る画像処理装置で実行される処理のうち、全画素最小閾値抽出処理、非白画素最小閾値抽出処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 5A is a flowchart illustrating details of an all pixel minimum threshold extraction process, a non-white pixel minimum threshold extraction process, and a threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment.

ステップ501において、全画素最小閾値抽出部401は、全画素位置の最小閾値を保持する変数である全画素最小閾値(MinTHall)を初期化する。同様に、非白画素最小閾値抽出部104は、非白画素位置の最小閾値を保持する変数である非白画素最小閾値(MinTHon)を初期化する。具体的には、MinTHall及びMinTHonの値に、スクリーン処理における閾値の最大値(又は入力画素値のレンジの最大値)をそれぞれセットする。なお、これら変数はRAMにて保持される。 In step 501, the all-pixel minimum threshold value extraction unit 401 initializes the all-pixel minimum threshold value (MinTH all ), which is a variable that holds the minimum threshold value for all pixel positions. Similarly, the non-white pixel minimum threshold extraction unit 104 initializes a non-white pixel minimum threshold (MinTH on ) that is a variable that holds the minimum threshold of the non-white pixel position. Specifically, the maximum value of the threshold in the screen processing (or the maximum value of the range of the input pixel value) is set as the value of MinTH all and MinTH on . These variables are held in the RAM.

ステップ502において、全画素最小閾値抽出部401は、所定領域内の注目画素に対応する閾値を取得する。そして、非白画素最小閾値抽出部104は、注目画素についての白画素情報、及び注目画素に対応する閾値を取得する。   In step 502, the all-pixel minimum threshold value extraction unit 401 acquires a threshold value corresponding to the target pixel in the predetermined area. Then, the non-white pixel minimum threshold value extraction unit 104 acquires white pixel information about the target pixel and a threshold value corresponding to the target pixel.

ステップ503において、全画素最小閾値抽出部401は、現時点の全画素最小閾値(MinTHall)とステップ502で取得した注目画素の閾値とを比較する。比較の結果、MinTHallの値が注目画素の閾値より大きい場合は、ステップ504に進む。一方、MinTHallの値が注目画素の閾値より大きくない場合は、ステップ505に進む。 In step 503, the all-pixel minimum threshold value extraction unit 401 compares the current all-pixel minimum threshold value (MinTH all ) with the threshold value of the target pixel acquired in step 502. As a result of the comparison, if the value of MinTH all is larger than the threshold value of the target pixel, the process proceeds to step 504. On the other hand, if the value of MinTH all is not larger than the threshold value of the target pixel, the process proceeds to step 505.

ステップ504において、全画素最小閾値抽出部401は、MinTHallの値を、ステップ502で取得した閾値に更新する。 In step 504, the all-pixel minimum threshold value extraction unit 401 updates the value of MinTH all to the threshold value acquired in step 502.

ステップ505では、ステップ502で取得した白画素情報に基づいて、注目画素が白画素であるかどうかが判定される。判定の結果、白画素である場合は、ステップ508に進む。一方、白画素でない場合(非白画素である場合)は、ステップ506に進む。   In step 505, based on the white pixel information acquired in step 502, it is determined whether or not the target pixel is a white pixel. If it is determined that the pixel is a white pixel, the process proceeds to step 508. On the other hand, if it is not a white pixel (if it is a non-white pixel), the process proceeds to step 506.

ステップ506において、非白画素最小閾値抽出部104は、現時点の非白画素最小閾値(MinTHon)とステップ502で取得した注目画素の閾値とを比較する。比較の結果、MinTHonの値が注目画素の閾値より大きい場合は、ステップ507に進む。一方、MinTHonの値が注目画素の閾値より大きくない場合は、ステップ508に進む。 In step 506, the non-white pixel minimum threshold extraction unit 104 compares the current non-white pixel minimum threshold (MinTH on ) with the threshold of the target pixel acquired in step 502. As a result of the comparison, if the value of MinTH on is larger than the threshold value of the target pixel, the process proceeds to step 507. On the other hand, if the value of MinTH on is not larger than the threshold value of the target pixel, the process proceeds to step 508.

ステップ507において、非白画素最小閾値抽出部104は、MinTHonの値を、ステップ502で取得した閾値に更新する。 In step 507, the non-white pixel minimum threshold value extraction unit 104 updates the MinTH on value to the threshold value acquired in step 502.

ステップ508では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ509に進む。ステップ509に進んだ時点で、所定領域内の全画素位置における最小閾値がMinTHallとして保持され、非白画素位置における最小閾値がMinTHonとして保持されていることになる。一方、所定領域内に未処理の画素があればステップ502に戻り、次の画素を注目画素としてステップ502〜ステップ507の各処理を行なう。 In step 508, it is determined whether or not processing has been completed for all pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 509. When the processing proceeds to step 509, the minimum threshold value at all pixel positions in the predetermined area is held as MinTH all , and the minimum threshold value at the non-white pixel position is held as MinTH on . On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to step 502, and each process of step 502 to step 507 is performed with the next pixel as the target pixel.

ステップ509において、閾値書換部402は、所定領域内の注目画素に対応する閾値を取得する。   In step 509, the threshold rewriting unit 402 acquires a threshold corresponding to the target pixel in the predetermined area.

ステップ510において、閾値書換部402は、ステップ509で取得した閾値と、非白画素最小閾値(MinTHon)とが同じであるかどうかを判定する。両者が同じ値である場合は、ステップ511に進む。一方、両者が同じ値でない場合は、ステップ513に進む。 In step 510, the threshold value rewriting unit 402 determines whether or not the threshold value acquired in step 509 is the same as the non-white pixel minimum threshold value (MinTH on ). If both are the same value, the process proceeds to step 511. On the other hand, if they are not the same value, the process proceeds to step 513.

ステップ511において、閾値書換部402は、全画素最小閾値(MinTHall)とステップ509で取得した閾値とを比較する。この比較の時点で、ステップ509で取得した閾値は、非白画素最小閾値(MinTHon)と同じ値である。よって、本ステップでは、非白画素最小閾値(MinTHon)と全画素最小閾値(MinTHall)との大小関係を比較していることになる。判定の結果、全画素最小閾値が非白画素最小閾値(取得した閾値)より小さい場合は、ステップ512に進む。一方、全画素最小閾値が非白画素最小閾値(取得した閾値)より小さくない場合は、ステップ513に進む。 In step 511, the threshold rewriting unit 402 compares the all pixel minimum threshold (MinTH all ) with the threshold acquired in step 509. At the time of this comparison, the threshold value acquired in step 509 is the same value as the non-white pixel minimum threshold value (MinTH on ). Therefore, in this step, the magnitude relationship between the non-white pixel minimum threshold (MinTH on ) and the all pixel minimum threshold (MinTH all ) is compared. As a result of the determination, if the all pixel minimum threshold value is smaller than the non-white pixel minimum threshold value (the acquired threshold value), the process proceeds to step 512. On the other hand, if the all pixel minimum threshold is not smaller than the non-white pixel minimum threshold (acquired threshold), the process proceeds to step 513.

ステップ512において、閾値書換部402は、ステップ509で取得した閾値を全画素最小閾値で置換する。すなわち、注目画素に対応する閾値として、全画素最小閾値(MinTHall)の値が設定されることになる。 In step 512, the threshold rewriting unit 402 replaces the threshold acquired in step 509 with the all pixel minimum threshold. That is, the value of the all pixel minimum threshold (MinTH all ) is set as the threshold corresponding to the target pixel.

ステップ513では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。未処理の画素がある場合は、ステップ509に戻り、次の画素を注目画素としてステップ509〜ステップ512の処理を繰り返す。一方、すべての画素に対して処理が終了していた場合は、本処理を終える。   In step 513, it is determined whether or not the processing has been completed for all the pixels in the predetermined area. If there is an unprocessed pixel, the process returns to step 509, and the processing of step 509 to step 512 is repeated with the next pixel as the target pixel. On the other hand, if the processing has been completed for all the pixels, the present processing ends.

以上が、本実施例における、全画素最小閾値抽出処理、非白画素最小閾値抽出処理、及び閾値書換処理の内容である。   The above is the contents of the all pixel minimum threshold extraction process, the non-white pixel minimum threshold extraction process, and the threshold rewriting process in the present embodiment.

これにより、非白画素最小閾値の量子化に使用する閾値が、ドットが形成される確率が高い閾値へと、所定領域毎に置き換えられる。   Thereby, the threshold value used for quantization of the non-white pixel minimum threshold value is replaced for each predetermined region with a threshold value that has a high probability of dot formation.

本実施例によって得られる結果は、実施例1と同様であるが、処理フローが一部簡略化されるため、回路規模を小さくする効果が期待できる。   The result obtained by the present embodiment is the same as that of the first embodiment, but since the processing flow is partially simplified, the effect of reducing the circuit scale can be expected.

実施例1及び2では、所定領域内における1画素に対応する1個の閾値のみを変更していた。所定領域が小さいときは1個の閾値のみの変更で足りるが、所定領域が大きくなると、1個の閾値を変更するだけでは十分な効果が得られない可能性がある。そこで、所定領域内の複数画素に対応する複数の閾値を変更する態様について、実施例3として説明する。なお、実施例1及び2と共通する部分(変形例を含む)については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the first and second embodiments, only one threshold corresponding to one pixel in a predetermined area is changed. When the predetermined area is small, it is sufficient to change only one threshold value. However, when the predetermined area becomes large, there is a possibility that a sufficient effect cannot be obtained only by changing one threshold value. Therefore, an embodiment in which a plurality of threshold values corresponding to a plurality of pixels in a predetermined area are changed will be described as a third embodiment. In addition, about the part (including a modification) which is common in Example 1 and 2, description is abbreviate | omitted or simplified, and below, it demonstrates centering on difference.

図6は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。   FIG. 6 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment.

画素値/閾値取得部101、白画素判定部102、量子化部106は、実施例1と同じであるので説明を省略する。   Since the pixel value / threshold value acquisition unit 101, the white pixel determination unit 102, and the quantization unit 106 are the same as those in the first embodiment, description thereof is omitted.

所定領域内閾値ソート部601は、画素値/閾値取得部101から受け取った閾値を用いて、所定領域(例えば、縦4画素×横4画素のブロック領域)内の全画素に対応する閾値を小さい順(もしくは大きい順)にソートする。ソート結果は、所定領域内閾値ソート情報として、閾値書換部603に送られる。   The predetermined area threshold sorting unit 601 uses the threshold received from the pixel value / threshold acquisition unit 101 to reduce the threshold corresponding to all pixels in the predetermined area (for example, a block area of 4 vertical pixels × 4 horizontal pixels). Sort in order (or in descending order). The sorting result is sent to the threshold rewriting unit 603 as threshold sorting information within a predetermined area.

非白画素閾値ソート部602は、白画素判定部102から受け取った白画素情報と、画素値/閾値取得部101から受け取った閾値を用いて、所定領域内の非白画素位置に対応する閾値を小さい順(もしくは大きい順)にソートする。ソート結果は、非白画素閾値ソート情報として、閾値書換部603に送られる。   The non-white pixel threshold sorting unit 602 uses the white pixel information received from the white pixel determination unit 102 and the threshold received from the pixel value / threshold acquisition unit 101 to determine a threshold corresponding to the non-white pixel position in the predetermined area. Sort in ascending order (or increasing order). The sort result is sent to the threshold rewriting unit 603 as non-white pixel threshold sort information.

閾値書換部603は、所定領域内閾値ソート情報と非白画素閾値ソート情報とに基づいて、閾値の書換処理を行う。具体的には、実施例2と同様、所定領域内の閾値と非白画素の閾値とを順に比較して、所定領域内の閾値の方が小さければ、所定領域内の閾値と非白画素の閾値とを置き換える処理がなされる。ただし、本実施例では、最小閾値同士だけでなく、2番目に小さい閾値同士、3番目に小さい閾値同士といった具合に、複数画素に関して閾値の比較・置換がなされる。これにより、所定領域内の複数の白画素位置にドットが形成される確率の高い閾値があった場合に、当該閾値が、非白画素の位置に移動することになる。   The threshold rewriting unit 603 performs a threshold rewriting process based on the predetermined area threshold sort information and the non-white pixel threshold sort information. Specifically, as in the second embodiment, the threshold value in the predetermined region and the threshold value of the non-white pixel are sequentially compared. If the threshold value in the predetermined region is smaller, the threshold value in the predetermined region and the non-white pixel value are compared. Processing to replace the threshold is performed. However, in the present embodiment, not only the minimum threshold values but also the second smallest threshold values and the third smallest threshold values are compared and replaced for a plurality of pixels. Thereby, when there is a threshold with a high probability that dots are formed at a plurality of white pixel positions in the predetermined area, the threshold moves to the position of the non-white pixel.

図7は、本実施例に係る閾値書換処理を行なった場合と行なわなかった場合の出力画像の違いを説明する図である。   FIG. 7 is a diagram for explaining a difference between output images when the threshold value rewriting process according to the present embodiment is performed and when it is not performed.

縦4画素×横4画素の入力画像701は、3列目の画素値が「32」でそれ以外の画素値が「0」の画像データである。閾値マトリクス702は、閾値書換処理がなされる前の、入力画像701に対応する閾値マトリクスである。スクリーン画像704は、閾値マトリクス702を用いて入力画像701を量子化した場合に得られる出力画像である。入力画像701の3列目の画素値「32」に対し、閾値マトリクス702の3列目の閾値の最小値は「50」(図中の△)であり、その次に小さい閾値は「118」(図中の2重△)であるため、スクリーン画像704にはドットが存在していない(ドット消失)。   The input image 701 of vertical 4 pixels × horizontal 4 pixels is image data in which the pixel value in the third column is “32” and the other pixel values are “0”. The threshold value matrix 702 is a threshold value matrix corresponding to the input image 701 before the threshold value rewriting process is performed. A screen image 704 is an output image obtained when the input image 701 is quantized using the threshold matrix 702. For the pixel value “32” in the third column of the input image 701, the minimum value of the threshold in the third column of the threshold matrix 702 is “50” (Δ in the figure), and the next smaller threshold is “118”. Since it is (double Δ in the figure), no dot exists in the screen image 704 (dot disappearance).

閾値マトリクス703は、閾値書換処理がなされた後の、入力画像701に対応する閾値マトリクスである。閾値マトリクス703では、非白画素の最小閾値「50」が白画素最小閾値「8」(図中の○)で置換され、非白画素内で2番目に小さい閾値「118」が白画素内で2番目に小さい閾値「20」(図中の◎)で置換されているのが分かる。スクリーン画像705は、閾値書換後の閾値マトリクス703を用いて入力画像701を量子化した場合に得られる出力画像である。スクリーン画像705では、スクリーン画像704では存在しなかった(消失していた)2つのドットを再現することができている。   The threshold value matrix 703 is a threshold value matrix corresponding to the input image 701 after the threshold value rewriting process is performed. In the threshold value matrix 703, the minimum threshold value “50” of the non-white pixel is replaced with the white pixel minimum threshold value “8” (◯ in the drawing), and the second smallest threshold value “118” in the non-white pixel is set in the white pixel. It can be seen that the value is replaced with the second smallest threshold “20” ((in the figure). The screen image 705 is an output image obtained when the input image 701 is quantized using the threshold value matrix 703 after threshold value rewriting. In the screen image 705, two dots that were not present (disappeared) in the screen image 704 can be reproduced.

そして、上述のように閾値の書換を行なった後も、所定領域内の非白画素の領域内において元々の閾値同士の大小関係が崩れていないのが分かる。すなわち、書換前の「50<118<210<236」と、書換後の「8<20<210<236」とでは、最小閾値及び2番目に小さい閾値の値こそ変わっているものの、大小関係自体に変化はない。このように大小関係を維持することで、不自然な濃度変動を発生させることなく、濃度に応じたドットの生成確率を向上させることができる。   It can be seen that the magnitude relationship between the original threshold values is not broken in the non-white pixel region within the predetermined region even after the threshold value is rewritten as described above. In other words, between “50 <118 <210 <236” before rewriting and “8 <20 <210 <236” after rewriting, although the values of the minimum threshold and the second smallest threshold have changed, the magnitude relationship itself There is no change. By maintaining the magnitude relationship in this way, it is possible to improve the dot generation probability according to the density without causing an unnatural density fluctuation.

図8Aは、本実施例に係る画像処理装置で実行される処理のうち、所定領域内閾値ソート処理、非白画素閾値ソート処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 8A is a flowchart illustrating details of a predetermined area threshold sorting process, a non-white pixel threshold sorting process, and a threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment.

ステップ801では、まず、変数[i]が初期化される。この変数[i]はRAMにて保持される。   In step 801, first, the variable [i] is initialized. This variable [i] is held in the RAM.

ステップ802では、所定領域内のすべての画素についての白画素情報、及びすべての画素に対応する閾値が取得される。   In step 802, white pixel information for all pixels in the predetermined area and threshold values corresponding to all pixels are acquired.

ステップ803では、所定領域内で閾値の置換えを行なう回数を規定する定数(閾値置換数)[p]を設定する。本実施例は、複数の閾値を変更することを想定しているので、閾値置換数[p]には通常「2」以上の値が設定されることになる。   In step 803, a constant (threshold replacement number) [p] that defines the number of times threshold replacement is performed within a predetermined area is set. Since the present embodiment assumes that a plurality of threshold values are changed, a value of “2” or more is normally set as the threshold replacement number [p].

ステップ804において、所定領域内閾値ソート部601は、所定領域内の全画素に対応する閾値をソートする処理を行なう。ここでは、所定領域内の全画素に対応する閾値を小さい順にソートする。ソート後の閾値の並びを示すデータは、所定領域内閾値ソート情報としてRAM等に保持される。さらに、所定領域内閾値ソート部601は、白画素判定部102から受け取った白画素情報から、白画素の数(n)を求めておく。求められた白画素数(n)も、RAM等に保持される。   In step 804, the threshold value sorting unit 601 in the predetermined area performs a process of sorting the threshold values corresponding to all the pixels in the predetermined area. Here, the threshold values corresponding to all the pixels in the predetermined area are sorted in ascending order. Data indicating the alignment of threshold values after sorting is held in a RAM or the like as threshold sorting information within a predetermined area. Further, the predetermined area threshold sorting unit 601 obtains the number (n) of white pixels from the white pixel information received from the white pixel determination unit 102. The obtained number of white pixels (n) is also held in the RAM or the like.

ステップ805において、非白画素閾値ソート部602は、白画素判定部102から受け取った白画素情報を参照して所定領域内における非白画素を特定し、特定された非白画素に対応する閾値をソートする処理を行なう。ここでは、所定領域内の非白画素の閾値を小さい順にソートする。ソート後の閾値の並びを示すデータは、非白画素閾値ソート情報としてRAM等に保持される。さらに、非白画素閾値ソート部602は、白画素情報を参照して、非白画素の数(m)を求めておく。求められた非白画素数(m)も、RAM等に保持される。   In step 805, the non-white pixel threshold sorting unit 602 refers to the white pixel information received from the white pixel determination unit 102, identifies the non-white pixel in the predetermined area, and sets the threshold corresponding to the identified non-white pixel. Perform the sort process. Here, the threshold values of the non-white pixels in the predetermined area are sorted in ascending order. Data indicating the alignment of the threshold values after sorting is held in a RAM or the like as non-white pixel threshold sort information. Further, the non-white pixel threshold sorting unit 602 obtains the number (m) of non-white pixels with reference to the white pixel information. The obtained number of non-white pixels (m) is also held in the RAM or the like.

ステップ806において、閾値書換部603は、白画素数(n)と非白画素数(m)のいずれかの値が「0」であるかどうかを判定する。判定の結果、白画素数(n)と非白画素数(m)のいずれの値も「0」でない場合は、ステップ807に進む。一方、白画素数(n)と非白画素数(m)のいずれかの値が「0」である場合は、本処理を抜ける。n=0の場合(所定領域内のすべての画素が非白画素である場合)や、m=0の場合(所定領域内のすべての画素が白画素である場合)は、閾値を置き換える必要がないためである。   In step 806, the threshold rewriting unit 603 determines whether one of the number of white pixels (n) and the number of non-white pixels (m) is “0”. As a result of the determination, if neither the number of white pixels (n) nor the number of non-white pixels (m) is “0”, the process proceeds to step 807. On the other hand, if the value of either the number of white pixels (n) or the number of non-white pixels (m) is “0”, the process is exited. When n = 0 (when all the pixels in the predetermined region are non-white pixels) or when m = 0 (when all the pixels within the predetermined region are white pixels), it is necessary to replace the threshold value. This is because there is not.

ステップ807において、閾値書換部603は、変数[i]と閾値置換数[p]とを比較する。比較の結果、 変数[i]が閾値置換数[p]以下の場合は、ステップ808に進む。一方、 変数iの方が大きい場合は、ステップ809に進む。例えば、処理開始直後の時点では、変数iは「0」であり、閾値置換数[p]は「2」以上の値であるから、ステップ808に進むことになる。   In step 807, the threshold rewriting unit 603 compares the variable [i] with the threshold replacement number [p]. As a result of the comparison, if the variable [i] is less than or equal to the threshold replacement number [p], the process proceeds to step 808. On the other hand, if the variable i is larger, the process proceeds to step 809. For example, since the variable i is “0” and the threshold replacement number [p] is a value equal to or greater than “2” at the time immediately after the start of processing, the process proceeds to step 808.

ステップ808において、閾値書換部603は、非白画素ソート後閾値[i]を、所定領域内ソート後閾値[i]で置換する。すなわち、非白画素の中で小さい方からi番目の閾値に、所定領域の中で小さい方からi番目の閾値の値を設定する。   In step 808, the threshold value rewriting unit 603 replaces the threshold value [i] after non-white pixel sorting with the threshold value [i] after sorting within a predetermined area. That is, the i-th threshold value is set to the i-th threshold value from the smaller non-white pixel, and the i-th threshold value from the smaller one in the predetermined area.

ステップ809では、変数iがインクリメント(+1)される。   In step 809, the variable i is incremented (+1).

ステップ810では、非白画素に対応するすべての閾値が処理されたかどうか(i=mかどうか)が判定される。判定の結果、未処理の非白画素閾値がある場合は、ステップ807に戻り、次に小さい閾値同士の比較を行なう。一方、すべての非白画素閾値についての処理が終了していれば、本処理を終える。   In step 810, it is determined whether all thresholds corresponding to non-white pixels have been processed (i = m). If there is an unprocessed non-white pixel threshold value as a result of the determination, the process returns to step 807 to compare the next smaller threshold values. On the other hand, if the processing for all the non-white pixel threshold values has been completed, this processing is terminated.

以上が、本実施例における、所定領域内閾値ソート処理、非白画素閾値ソート処理、及び閾値書換処理の内容である。   The above is the contents of the predetermined area threshold sorting process, the non-white pixel threshold sorting process, and the threshold rewriting process in the present embodiment.

これにより、所定領域内の複数画素に対応する複数の閾値が変更され、所定領域が大きい場合にも十分な効果を期待できる。   Thereby, a plurality of threshold values corresponding to a plurality of pixels in the predetermined area are changed, and a sufficient effect can be expected even when the predetermined area is large.

(変形例1)
なお、本実施例では、所定領域内の全ての閾値をソートする場合について説明したが、小さい方から[p]番目までにソート対象を限定してもよい。例えば、実施例2は、小さい方から1番目までにソート対象を限定した例ということもでき、このようにソート対象に制限を加えることで回路規模(処理工程)の削減が可能となる。
(Modification 1)
In the present embodiment, the case where all threshold values in the predetermined area are sorted has been described, but the sort target may be limited to the [p] th from the smallest. For example, the second embodiment can be said to be an example in which the sort target is limited from the smallest to the first, and by limiting the sort target in this way, the circuit scale (processing step) can be reduced.

(変形例2)
また、所定領域内の全ての画素を対象にソートするのではなく、白画素のみを対象にソートしてもよい。
(Modification 2)
Further, instead of sorting all the pixels in the predetermined area as a target, only the white pixels may be sorted.

図8Bは、本変形例に係る、白画素閾値ソート処理、非白画素閾値ソート処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 8B is a flowchart illustrating details of the white pixel threshold sorting process, the non-white pixel threshold sorting process, and the threshold rewriting process according to the present modification.

ステップ811では、まず、変数[i]、[j]、[k]が初期化される。この変数[i]、[j]、[k]はRAMにて保持される。   In step 811, variables [i], [j], and [k] are first initialized. These variables [i], [j], and [k] are held in the RAM.

ステップ812では、所定領域内のすべての画素についての白画素情報、及びすべての画素に対応する閾値が取得される。   In step 812, white pixel information about all the pixels in the predetermined area and threshold values corresponding to all the pixels are acquired.

ステップ813において、白画素閾値ソート部(不図示)は、白画素判定部102から受け取った白画素情報を参照して所定領域内における白画素を特定し、特定された白画素に対応する閾値をソートする処理を行なう。ここでは、所定領域内の白画素の閾値を小さい順にソートする。ソート後の閾値の並びを示すデータは、白画素閾値ソート情報としてRAM等に保持される。さらに、白画素閾値ソート部(不図示)は、白画素判定部102から受け取った白画素情報から、白画素の数(n)を求めておく。求められた白画素数(n)も、RAM等に保持される。   In step 813, the white pixel threshold sorting unit (not shown) refers to the white pixel information received from the white pixel determination unit 102 to identify white pixels in the predetermined area, and sets a threshold corresponding to the identified white pixels. Perform the sort process. Here, the threshold values of the white pixels in the predetermined area are sorted in ascending order. Data indicating the alignment of the threshold values after sorting is held in the RAM or the like as white pixel threshold value sorting information. Further, a white pixel threshold sorting unit (not shown) obtains the number (n) of white pixels from the white pixel information received from the white pixel determination unit 102. The obtained number of white pixels (n) is also held in the RAM or the like.

ステップ814において、非白画素閾値ソート部602は、白画素判定部102から受け取った白画素情報を参照して所定領域内における非白画素を特定し、特定された非白画素に対応する閾値をソートする処理を行なう。ここでは、所定領域内の非白画素の閾値を小さい順にソートする。ソート後の閾値の並びを示すデータは、非白画素閾値ソート情報としてRAM等に保持される。さらに、非白画素閾値ソート部602は、白画素情報を参照して、非白画素の数(m)を求めておく。求められた非白画素数(m)も、RAM等に保持される。   In step 814, the non-white pixel threshold sort unit 602 identifies the non-white pixel in the predetermined area with reference to the white pixel information received from the white pixel determination unit 102, and sets the threshold corresponding to the identified non-white pixel. Perform the sort process. Here, the threshold values of the non-white pixels in the predetermined area are sorted in ascending order. Data indicating the alignment of the threshold values after sorting is held in a RAM or the like as non-white pixel threshold sort information. Further, the non-white pixel threshold sorting unit 602 obtains the number (m) of non-white pixels with reference to the white pixel information. The obtained number of non-white pixels (m) is also held in the RAM or the like.

ステップ815において、閾値書換部603は、白画素数(n)と非白画素数(m)のいずれかの値が「0」であるかどうかを判定する。判定の結果、白画素数(n)と非白画素数(m)のいずれの値も「0」でない場合は、ステップ816に進む。一方、白画素数(n)と非白画素数(m)のいずれかの値が「0」である場合は、本処理を抜ける。n=0の場合(所定領域内のすべての画素が非白画素である場合)や、m=0の場合(所定領域内のすべての画素が白画素である場合)は、閾値を置き換える必要がないためである。   In step 815, the threshold rewriting unit 603 determines whether one of the number of white pixels (n) and the number of non-white pixels (m) is “0”. As a result of the determination, if neither the number of white pixels (n) nor the number of non-white pixels (m) is “0”, the process proceeds to step 816. On the other hand, if the value of either the number of white pixels (n) or the number of non-white pixels (m) is “0”, the process is exited. When n = 0 (when all the pixels in the predetermined region are non-white pixels) or when m = 0 (when all the pixels within the predetermined region are white pixels), it is necessary to replace the threshold value. This is because there is not.

ステップ816において、閾値書換部603は、白画素ソート後閾値[j]と非白画素ソート後閾値[i]とを比較する。比較の結果、白画素ソート後閾値[j]が非白画素ソート後閾値[i]よりも小さい場合は、ステップ817に進む。一方、白画素ソート後閾値[j]が非白画素ソート後閾値[i]よりも小さくない場合は、ステップ819に進む。   In step 816, the threshold rewriting unit 603 compares the white pixel sorted threshold [j] with the non-white pixel sorted threshold [i]. As a result of the comparison, if the white pixel sorted threshold [j] is smaller than the non-white pixel sorted threshold [i], the process proceeds to step 817. On the other hand, if the threshold after white pixel sorting [j] is not smaller than the threshold after non-white pixel sorting [i], the process proceeds to step 819.

ステップ817において、閾値書換部603は、非白画素書換後閾値[k]を、白画素ソート後閾値[j]で置換する。すなわち、小さい方からk番目の書換後の非白画素閾値を、小さい方からj番目の白画素ソート後閾値の値に変更する。   In step 817, the threshold value rewriting unit 603 replaces the threshold value [k] after non-white pixel rewriting with the threshold value [j] after white pixel sorting. That is, the non-white pixel threshold value after the k-th rewriting from the smallest one is changed to the value of the j-th white pixel sorting threshold value from the smallest.

ステップ818では、変数[j]がインクリメント(+1)される。   In step 818, the variable [j] is incremented (+1).

ステップ819において、閾値書換部603は、非白画素書換後閾値[k]を、非白画素ソート後閾値[i]で置換する。すなわち、小さい方からk番目の書換後の非白画素閾値を、小さい方からi番目の非白画素ソート後閾値の値に変更する。   In step 819, the threshold value rewriting unit 603 replaces the non-white pixel after-rewrite threshold value [k] with the non-white pixel-sorted threshold value [i]. That is, the non-white pixel threshold value after the k-th rewrite from the smallest one is changed to the value of the i-th non-white pixel sorted threshold value from the smallest.

ステップ820は、変数[i]がインクリメント(+1)される。   In step 820, the variable [i] is incremented (+1).

ステップ821では、変数[k]がインクリメント(+1)される。   In step 821, the variable [k] is incremented (+1).

ステップ822では、白画素数(n)と非白画素数(m)のいずれかの値が変数[k]と一致するかどうかが判定される。変数[k]と白画素数(n)とが一致する場合(全ての白画素に対応する閾値が参照された場合)、又は変数[k]と非白画素数(m)とが一致する場合(全ての非白画素に対応する閾値が確定した場合)は、本処理を終了する。一方、判定の結果、白画素数(n)と非白画素数(m)のいずれかの値が、変数[k]と一致しない場合は、ステップ816に戻り、白画素数(n)と非白画素数(m)のいずれかの値が変数kと一致するまで処理を繰り返す。   In step 822, it is determined whether one of the number of white pixels (n) or the number of non-white pixels (m) matches the variable [k]. When variable [k] matches the number of white pixels (n) (when threshold values corresponding to all white pixels are referenced), or when variable [k] matches the number of non-white pixels (m) If the thresholds corresponding to all the non-white pixels have been determined, this process ends. On the other hand, if the result of determination is that the value of either the number of white pixels (n) or the number of non-white pixels (m) does not match the variable [k], the process returns to step 816 and the number of white pixels (n) The process is repeated until any value of the number of white pixels (m) matches the variable k.

以上が、本実施例における、白画素閾値ソート処理、非白画素閾値ソート処理、及び閾値書換処理の内容である。これにより、所定領域内全ての画素をソートした場合と同じ結果を得ることができる。   The above is the contents of the white pixel threshold sorting process, the non-white pixel threshold sorting process, and the threshold rewriting process in the present embodiment. As a result, the same result as when all the pixels in the predetermined area are sorted can be obtained.

(変形例3)
さらに、所定領域内における非白画素の画素値の平均値を下回っている閾値の数を所定領域単位で算出し、算出された閾値の数に対応する非白画素の閾値を保持しておき、当該閾値以下となる閾値をすべて「0」に置き換えてもよい。
(Modification 3)
Further, the number of threshold values that are lower than the average value of the pixel values of the non-white pixels in the predetermined region is calculated in units of the predetermined region, and the threshold value of the non-white pixel corresponding to the calculated threshold value is retained. All threshold values that are equal to or lower than the threshold value may be replaced with “0”.

図8Cは、本変形例に係る処理の詳細を示すフローチャートである。   FIG. 8C is a flowchart showing details of processing according to the present modification.

ステップ831では、まず、変数[i]が初期化される。この変数[i]はRAMにて保持される。   In step 831, first, the variable [i] is initialized. This variable [i] is held in the RAM.

ステップ832では、所定領域内のすべての画素についての白画素情報、及びすべての画素に対応する閾値が取得される。
ステップ833では、所定領域内の閾値のうち、非白画素の画素値の平均値を下回る閾値の数[q]が算出される。
In step 832, white pixel information for all the pixels in the predetermined area and threshold values corresponding to all the pixels are acquired.
In step 833, the number [q] of threshold values below the average value of the pixel values of the non-white pixels among the threshold values in the predetermined area is calculated.

ステップ834において、非白画素閾値ソート部602は、所定領域内の非白画素に対応する閾値をソートする処理を行なう。ここでは、所定領域内の非白画素に対応する閾値を小さい順にソートする。ソート後の閾値の並びを示すデータは、非白画素閾値ソート情報としてRAM等に保持される。さらに、非白画素閾値ソート部602は、白画素判定部102から受け取った白画素情報から、白画素の数(n)を求めておく。求められた白画素数(n)も、RAM等に保持される。   In step 834, the non-white pixel threshold sorting unit 602 performs a process of sorting thresholds corresponding to non-white pixels in a predetermined area. Here, the threshold values corresponding to the non-white pixels in the predetermined area are sorted in ascending order. Data indicating the alignment of the threshold values after sorting is held in a RAM or the like as non-white pixel threshold sort information. Further, the non-white pixel threshold sorting unit 602 obtains the number (n) of white pixels from the white pixel information received from the white pixel determination unit 102. The obtained number of white pixels (n) is also held in the RAM or the like.

ステップ835において、閾値書換部603は、非白画素閾値ソート情報を参照して、非白画素に対応するソート後の閾値の小さい方から[q]番目の閾値を、「書換判定用閾値」として設定する。この「書換判定用閾値」はRAMにて保持される。   In step 835, the threshold rewriting unit 603 refers to the non-white pixel threshold sort information, and sets the [q] -th threshold from the smaller sorted thresholds corresponding to the non-white pixels as the “rewrite determination threshold”. Set. This “rewrite determination threshold value” is held in the RAM.

ステップ836において、閾値書換部603は、ステップ835で設定された書換判定用閾値と所定領域内におけるi番目の閾値(例えばブロック領域の左上端から順にi番目の閾値)とを比較する。比較の結果、所定領域内の閾値[i]が書換判定用閾値以下である場合は、ステップ837に進む。一方、所定領域内の閾値[i]が書換判定用閾値よりも大きい場合は、ステップ838に進む。   In step 836, the threshold rewriting unit 603 compares the rewrite determination threshold set in step 835 with the i-th threshold in the predetermined area (for example, the i-th threshold in order from the upper left end of the block area). As a result of the comparison, if the threshold value [i] in the predetermined area is equal to or smaller than the rewrite determination threshold value, the process proceeds to step 837. On the other hand, if the threshold value [i] in the predetermined area is larger than the rewrite determination threshold value, the process proceeds to step 838.

ステップ837において、閾値書換部603は、所定領域内の閾値[i]を、「0」に設定する。   In step 837, the threshold value rewriting unit 603 sets the threshold value [i] in the predetermined area to “0”.

ステップ838では、変数[i]がインクリメント(+1)される。   In step 838, the variable [i] is incremented (+1).

ステップ839では、所定領域内の全画素に対応するすべての閾値が処理されたかどうか(i=所定領域内の画素数かどうか)が判定される。判定の結果、未処理の閾値がある場合は、ステップ836に戻り、次の画素に対応する閾値についての処理を行なう。一方、所定領域内の全画素に対応するすべての閾値についての処理が終了していれば、本処理を終える。   In step 839, it is determined whether all threshold values corresponding to all pixels in the predetermined area have been processed (i = whether the number of pixels in the predetermined area). If there is an unprocessed threshold value as a result of the determination, the process returns to step 836 to perform the process for the threshold value corresponding to the next pixel. On the other hand, if the processing for all the threshold values corresponding to all the pixels in the predetermined region has been completed, the present processing ends.

以上が、本変形例に係る処理の内容である。   The above is the content of the processing according to this modification.

この変形例3では、閾値の置換操作(ある閾値を他の閾値で置き換える)を行なわないので処理を簡略化でき、また、上述のような「書換判定用閾値」を用いることで所定領域内における濃度変動も抑えられる。   In this modified example 3, since the threshold value replacement operation (replacement of a certain threshold value with another threshold value) is not performed, the processing can be simplified. In addition, by using the “rewrite determination threshold value” as described above, Concentration fluctuation can also be suppressed.

次に、実施例2をベースとして、非白画素の閾値を書き換える確率を可変にし、細線再現性を調整する態様について、実施例4として説明する。   Next, an embodiment in which the probability of rewriting the threshold value of a non-white pixel is made variable and fine line reproducibility is adjusted based on the second embodiment will be described as a fourth embodiment.

図5Bは、本実施例に係る、画像処理装置で実行される処理の詳細を示すフローチャートであり、前述の実施例2の図5Aのフローチャートに対応している。ステップ501〜510、513については、図5Aのフローチャートと同じであるので、以下では差異点であるステップ511’及び512’について説明する。   FIG. 5B is a flowchart illustrating details of processing executed by the image processing apparatus according to the present embodiment, and corresponds to the flowchart of FIG. 5A of the above-described second embodiment. Steps 501 to 510 and 513 are the same as those in the flowchart of FIG. 5A, and therefore, steps 511 'and 512' which are different points will be described below.

ステップ511’において、閾値書換部402は、「全画素最小閾値(MinTHall)」に所定の係数を掛けた上で「非白画素最小閾値(=注目画素の閾値)」と比較する。この場合において、細線の連続性(ドットの生成確率)を高めたい場合は、1.0未満の係数を設定し、例えば「全画素最小閾値(MinTHall)×0.9」と「注目画素の閾値」とを比較する。また、細線の濃度を重視する場合は、1.0を超える係数を設定し、例えば、「全画素最小閾値(MinTHall)×1.1」と「注目画素の閾値」とを比較する。比較の結果、「全画素最小閾値×係数」の値が注目画素の閾値(=非白画素最小閾値)より小さい場合は、ステップ512’に進む。一方、「全画素最小閾値×係数」の値が注目画素の閾値(=非白画素最小閾値)より小さくない場合は、ステップ513に進む。 In step 511 ′, the threshold rewriting unit 402 multiplies “all pixel minimum threshold (MinTH all )” by a predetermined coefficient and compares it with “non-white pixel minimum threshold (= threshold of target pixel)”. In this case, if it is desired to increase the continuity of thin lines (dot generation probability), a coefficient less than 1.0 is set, for example, “all pixel minimum threshold (MinTH all ) × 0.9” and “ Compare with "Threshold". Also, when emphasizing the density of thin lines, a coefficient exceeding 1.0 is set, and, for example, “all pixel minimum threshold (MinTH all ) × 1.1” is compared with “threshold pixel threshold”. As a result of the comparison, if the value of “all pixel minimum threshold × coefficient” is smaller than the threshold value of the target pixel (= non-white pixel minimum threshold value), the process proceeds to step 512 ′. On the other hand, if the value of “all pixel minimum threshold × coefficient” is not smaller than the threshold value of the target pixel (= non-white pixel minimum threshold value), the process proceeds to step 513.

ステップ512’において、閾値書換部402は、ステップ509で取得した注目画素の閾値を「全画素最小閾値(MinTHall)×係数」の値で置換する。 In step 512 ′, the threshold value rewriting unit 402 replaces the threshold value of the target pixel acquired in step 509 with the value of “all pixel minimum threshold value (MinTH all ) × coefficient”.

以上のような処理により、非白画素の最小閾値を書き換える確率を変えることができる。なお、係数を1.0にした場合は、実施例2と同じ結果になる。   Through the processing as described above, the probability of rewriting the minimum threshold value of the non-white pixel can be changed. When the coefficient is set to 1.0, the same result as in Example 2 is obtained.

このように本実施例によれば、細線の再現性を目的に応じて制御することができる。   Thus, according to the present embodiment, the reproducibility of the thin line can be controlled according to the purpose.

(変形例1)
同様に、実施例1をベースとして、非白画素の閾値を書き換える確率を可変にする態様について説明する。
(Modification 1)
Similarly, an embodiment in which the probability of rewriting the threshold value of a non-white pixel is made variable based on the first embodiment will be described.

図3Cは、本変形例に係る、前述の実施例1の図3Aのフローチャートに対応するフローチャートである。ステップ301〜310、313については、図3Aのフローチャートと同じであるので、以下では差異点であるステップ311’及び312’について説明する。   FIG. 3C is a flowchart corresponding to the flowchart of FIG. 3A of the first embodiment described above according to the present modification. Steps 301 to 310 and 313 are the same as those in the flowchart of FIG. 3A, and therefore, steps 311 'and 312' which are different points will be described below.

ステップ311’において、閾値書換部105は、「白画素最小閾値(MinTHoff)」に所定の係数を掛けた上で「非白画素最小閾値(=注目画素の閾値)」と比較する。比較の結果、「白画素最小閾値×係数」の値が注目画素の閾値(=非白画素最小閾値)より小さい場合は、ステップ312’に進む。一方、「白画素最小閾値×係数」の値が注目画素の閾値(非白画素最小閾値)より小さくない場合は、ステップ313に進む。 In step 311 ′, the threshold rewriting unit 105 multiplies “white pixel minimum threshold (MinTH off )” by a predetermined coefficient and compares it with “non-white pixel minimum threshold (= threshold of target pixel)”. As a result of the comparison, if the value of “white pixel minimum threshold × coefficient” is smaller than the threshold value of the target pixel (= non-white pixel minimum threshold value), the process proceeds to step 312 ′. On the other hand, if the value of “white pixel minimum threshold × coefficient” is not smaller than the threshold value of the target pixel (non-white pixel minimum threshold value), the process proceeds to step 313.

ステップ312’において、閾値書換部105は、ステップ309で取得した注目画素の閾値を「白画素最小閾値(MinTHoff)×係数」の値で置換する。 In step 312 ′, the threshold rewriting unit 105 replaces the threshold value of the target pixel acquired in step 309 with a value of “white pixel minimum threshold value (MinTH off ) × coefficient”.

以上のような処理により、非白画素の最小閾値を書き換える確率を変えることができる。   Through the processing as described above, the probability of rewriting the minimum threshold value of the non-white pixel can be changed.

実施例2をベースにした場合(全画素最小閾値に例えば1.0未満の係数を掛けるとき)では、所定領域内に白画素がなくても閾値の置換えが起こるため、細線の濃度との差が検知されなくなり、細線との境界部における不自然さがない。一方、実施例1をベースにした場合(白画素最小閾値に例えば1.0未満の係数を掛けるとき)は、所定領域内に白画素がなければ閾値の置換えが発生しないため、濃度変動が起こらない。すなわち、変形例1の方が、濃度変動をより小さく抑えることができる。   When the second embodiment is used as a base (when the minimum threshold value of all pixels is multiplied by a coefficient less than 1.0, for example), the threshold value is replaced even if there is no white pixel in the predetermined area. Is not detected, and there is no unnaturalness at the boundary with the thin line. On the other hand, when the first embodiment is used as a base (when the white pixel minimum threshold is multiplied by a coefficient of less than 1.0, for example), if there is no white pixel in the predetermined area, the threshold value replacement does not occur, and density fluctuations occur. Absent. That is, the variation 1 can suppress the density fluctuation to be smaller.

よって、文字・線画領域においては「全画素最小閾値」に係数を掛ける態様を適用し、自然画領域においては「白画素最小閾値」に係数を掛ける態様を適用するのが好ましいといえる。   Therefore, it is preferable to apply a mode in which the coefficient is applied to the “all pixel minimum threshold” in the character / line drawing area, and to apply a mode in which the coefficient is applied to the “white pixel minimum threshold” in the natural image area.

実施例2は、所定領域内の全画素に対応する閾値中の最小閾値が、ドットが形成される確率が高い閾値であった場合に、非白画素の最小閾値を、全画素中の最小閾値と同じ値に書き換える態様であった。次に、実施例2をベースとして、「白画素」に代えて「低濃度画素」に着目する態様について、実施例5として説明する。なお、実施例2と共通する部分(変形例を含む)については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the second embodiment, when the minimum threshold value among the threshold values corresponding to all the pixels in the predetermined region is a threshold value with a high probability that dots are formed, the minimum threshold value for the non-white pixels is set to the minimum threshold value for all the pixels. It was the aspect rewritten to the same value. Next, an embodiment in which attention is paid to “low density pixels” instead of “white pixels” based on the second embodiment will be described as a fifth embodiment. In addition, about the part (including a modification) which is common in Example 2, description is abbreviate | omitted or simplified, and below, it demonstrates centering on difference.

図9は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部101、全白画素最小閾値抽出部401、量子化部106は、実施例2と同じであるので説明を省略する。   FIG. 9 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold value acquisition unit 101, the all white pixel minimum threshold value extraction unit 401, and the quantization unit 106 are the same as those in the second embodiment, description thereof is omitted.

低濃度画素判定部901は、画素値/閾値取得部101から受け取った画素値に基づいて、所定領域における各画素が低濃度画素であるかどうかを判定する。低濃度画素かどうかは、例えば、入力された画素値が所定の閾値(Thlowdens)以下であるかどうかによって判定される。そして、低濃度画素と判定された画素を特定するための情報(以下、低濃度画素情報)が、非低濃度画素最小閾値抽出部902に送られる。なお、低濃度画素判定部901に代えて、RIP(Raster Image Processor)装置等で生成された属性情報を使用しても良い。 The low density pixel determination unit 901 determines whether or not each pixel in the predetermined area is a low density pixel based on the pixel value received from the pixel value / threshold value acquisition unit 101. Whether the pixel is a low density pixel is determined by, for example, whether the input pixel value is equal to or less than a predetermined threshold (Th lowdens ). Then, information for specifying a pixel determined as a low density pixel (hereinafter, low density pixel information) is sent to the non-low density pixel minimum threshold value extraction unit 902. Note that attribute information generated by a RIP (Raster Image Processor) device or the like may be used instead of the low density pixel determination unit 901.

非低濃度画素最小閾値抽出部902は、低濃度画素判定部901からの低濃度画素情報と、画素値/閾値取得手段101からの閾値を用いて、非低濃度画素(低濃度画素以外の画素)に対応する閾値の中の最小閾値(以下、非低濃度画素最小閾値)を抽出する。抽出された非低濃度画素最小閾値を特定するための情報(以下、非低濃度画素最小閾値情報)は、閾値書換部903に送られる。   The non-low density pixel minimum threshold value extraction unit 902 uses the low density pixel information from the low density pixel determination unit 901 and the threshold value from the pixel value / threshold acquisition unit 101 to generate a non-low density pixel (a pixel other than the low density pixel). ) Is extracted from the threshold values corresponding to the non-low density pixel minimum threshold value. Information for identifying the extracted non-low density pixel minimum threshold (hereinafter, non-low density pixel minimum threshold information) is sent to the threshold rewriting unit 903.

閾値書換部903は、入力画像に対応する閾値マトリクスについて、非低濃度画素最小閾値を全画素最小閾値に書き換える処理を行なう。具体的には、全画素最小閾値と非低濃度画素最小閾値とを比較し、全画素最小閾値の方が小さい値(ドットが形成される確率が高い閾値)であった場合に、非低濃度画素最小閾値を全画素最小閾値の値に置き換える処理を行なう。   The threshold rewriting unit 903 performs a process of rewriting the non-low density pixel minimum threshold to the all pixel minimum threshold for the threshold matrix corresponding to the input image. Specifically, when the all pixel minimum threshold value is compared with the non-low density pixel minimum threshold value, and the all pixel minimum threshold value is smaller (threshold with a higher probability of dot formation), the non-low density A process of replacing the pixel minimum threshold value with the value of all pixel minimum threshold values is performed.

実際の処理フローについては、実施例2で説明した図5Aのフローチャートにおいて、「非白画素最小閾値」とある部分を「非低濃度画素最小閾値」と読み替えて、同様に処理すればよい。   Regarding the actual processing flow, in the flowchart of FIG. 5A described in the second embodiment, a portion having “non-white pixel minimum threshold” may be read as “non-low density pixel minimum threshold” and processed in the same manner.

実施例2では、ほぼ白画素と評価される画素(白画素の画素値と近い値を有する画素で、例えば背景を構成する画素)であっても、白画素でなければ閾値の置換えは起こらない。これに対し、本実施例では、所定閾値(Thlowdens)以下の画素値を有する白画素以外の画素を白画素と同等のものとして扱うことによって、例えば背景領域においても細線再現性を向上させることができる。 In the second embodiment, even if a pixel is evaluated as a substantially white pixel (a pixel having a value close to the pixel value of the white pixel, for example, a pixel constituting the background), the threshold value is not replaced unless the pixel is a white pixel. . On the other hand, in the present embodiment, thin line reproducibility is improved even in the background region, for example, by treating pixels other than white pixels having pixel values equal to or lower than a predetermined threshold (Th lowdens ) as equivalent to white pixels. Can do.

なお、本実施例においては、低濃度画素の閾値については書換の対象外とするため、低濃度領域のドット配置は変わらない。   In this embodiment, since the threshold value of the low density pixel is not subject to rewriting, the dot arrangement in the low density area does not change.

次に、実施例1をベースとして、高濃度画素に着目して閾値の書換を行う態様について、実施例6として説明する。なお、実施例1と共通する部分(変形例を含む)については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   Next, an embodiment in which threshold value rewriting is performed with a focus on high density pixels based on the first embodiment will be described as a sixth embodiment. In addition, about the part (including a modification) which is common in Example 1, description is abbreviate | omitted or simplified, and below, it demonstrates centering on difference.

図10は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部101及び量子化部106は、実施例1と同じであるので説明を省略する。   FIG. 10 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold value acquisition unit 101 and the quantization unit 106 are the same as those in the first embodiment, description thereof is omitted.

高濃度画素判定部1001は、画素値/閾値取得部101から受け取った画素値に基づいて、所定領域における各画素が高濃度画素であるかどうかを判定する。高濃度画素かどうかは、例えば、入力された画素値が所定の閾値(Thhighdens )以上であるかどうかによって判定される。そして、高濃度画素と判定された所定領域内の画素を特定するための情報(以下、高濃度画素情報)が、高濃度画素最小閾値抽出部1002に送られる。なお、高濃度画素判定部1001に代えて、RIP(Raster Image Processor)装置等で生成された属性情報を使用してもよい。 The high density pixel determination unit 1001 determines whether or not each pixel in the predetermined area is a high density pixel based on the pixel value received from the pixel value / threshold value acquisition unit 101. Whether the pixel is a high density pixel is determined, for example, based on whether the input pixel value is equal to or greater than a predetermined threshold (Th highdens ). Then, information for specifying a pixel in a predetermined area determined as a high density pixel (hereinafter, high density pixel information) is sent to the high density pixel minimum threshold value extraction unit 1002. Note that attribute information generated by a RIP (Raster Image Processor) device or the like may be used instead of the high density pixel determination unit 1001.

高濃度画素最小閾値抽出部1002は、高濃度画素判定部1001から受け取った高濃度画素情報と、画素値/閾値取得手段101から受け取った閾値を用いて、高濃度画素の画素位置に対応する閾値の中の最小閾値(以下、高濃度画素最小閾値)を抽出する。抽出された高濃度画素最小閾値を特定するための情報(以下、高濃度画素最小閾値情報)は、閾値書換部1003に送られる。   The high density pixel minimum threshold value extraction unit 1002 uses the high density pixel information received from the high density pixel determination unit 1001 and the threshold value received from the pixel value / threshold value acquisition unit 101 to correspond to the threshold value corresponding to the pixel position of the high density pixel. The minimum threshold value (hereinafter referred to as the high density pixel minimum threshold value) is extracted. Information for identifying the extracted high density pixel minimum threshold (hereinafter, high density pixel minimum threshold information) is sent to the threshold rewriting unit 1003.

閾値書換部1003は、高濃度画素最小閾値抽出部1002から受け取った高濃度画素最小閾値情報に基づいて、高濃度画素に対応する閾値の中の最小閾値を異なる閾値に書き換える。例えば、高濃度画素最小閾値に所定の係数(1.0未満)を掛けて、よりドットが生成されやすい閾値に変更する。そして、量子化部106において変更後の閾値と入力画素値とを用いた量子化がなされる。   Based on the high density pixel minimum threshold information received from the high density pixel minimum threshold extraction unit 1002, the threshold rewriting unit 1003 rewrites the minimum threshold among the thresholds corresponding to the high density pixels to a different threshold. For example, a high-density pixel minimum threshold value is multiplied by a predetermined coefficient (less than 1.0) to change the threshold value so that dots are more easily generated. Then, the quantization unit 106 performs quantization using the changed threshold value and the input pixel value.

本実施例では、高濃度画素に対応する閾値中の最小閾値のみが、よりドット生成確率の高い閾値に変更される。つまり、ドット生成確率が高くなるのは、所定領域内(例えば縦4画素×横4画素の16画素)の高濃度画素のうちの1画素のみとなる。これは、入力画像のうち濃い濃度領域に対しては影響がなく、入力画素レンジの1/16程度の低い濃度領域における濃度が若干上昇することを意味する。この場合、所定領域内の高濃度側のみ濃度が上がるので、結果としてハイライト部分のコントラストが少し強調されたような画像が出力されることになる。よって、淡い細線においては、背景の濃度が細線の濃度よりも低い場合に再現性が向上することになる。   In this embodiment, only the minimum threshold value among the threshold values corresponding to the high density pixels is changed to a threshold value having a higher dot generation probability. That is, the dot generation probability is high only in one pixel among the high density pixels in a predetermined area (for example, 16 pixels of 4 vertical pixels × 4 horizontal pixels). This means that there is no effect on the dark density area in the input image, and the density in the low density area of about 1/16 of the input pixel range slightly increases. In this case, the density increases only on the high density side in the predetermined area, and as a result, an image in which the contrast of the highlight portion is slightly emphasized is output. Therefore, in the case of a light thin line, reproducibility is improved when the density of the background is lower than the density of the thin line.

実施例6では、所定領域内の高濃度領域の最小閾値に所定の係数を掛けて最小閾値をよりドット生成確率の高い閾値に変更する態様について説明した。次に、所定領域内の高濃度領域の最小閾値を変更する際の係数を、入力画素値に応じて調整する態様について、実施例7として説明する。なお、実施例6と共通する部分については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the sixth embodiment, the aspect has been described in which the minimum threshold value is changed to a threshold value having a higher dot generation probability by multiplying the minimum threshold value of the high density region in the predetermined region by a predetermined coefficient. Next, an embodiment in which the coefficient for changing the minimum threshold value of the high density region in the predetermined region is adjusted according to the input pixel value will be described as a seventh embodiment. In addition, about the part which is common in Example 6, description is abbreviate | omitted or simplified, and it shall demonstrate below centering on difference.

図11は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部101、高濃度画素判定部1001、高濃度画素最小閾値抽出部1002、閾値書換部1003及び量子化部106は、実施例6と同じであるので説明を省略する。   FIG. 11 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold acquisition unit 101, the high density pixel determination unit 1001, the high density pixel minimum threshold value extraction unit 1002, the threshold value rewriting unit 1003, and the quantization unit 106 are the same as those in the sixth embodiment, description thereof will be omitted.

係数決定部1101は、入力画素値に応じた係数を決定する。具体的には、予め入力値(画素値)に対応する係数値が格納されたLUT(ルックアップテーブル)を参照し、画素値/閾値取得部101から受け取った画素値に応じた係数を決定する。決定された係数は、閾値書換部1003に送られる。そして、閾値書換部1003において、決定された係数に基づき高濃度画素最小閾値がよりドット生成確率の高い閾値に変更され、量子化部106において、変更後の閾値と入力画素値とを用いた量子化がなされる。   The coefficient determination unit 1101 determines a coefficient corresponding to the input pixel value. Specifically, a coefficient corresponding to the pixel value received from the pixel value / threshold value acquisition unit 101 is determined with reference to an LUT (lookup table) in which coefficient values corresponding to input values (pixel values) are stored in advance. . The determined coefficient is sent to the threshold rewriting unit 1003. Then, the threshold rewriting unit 1003 changes the high density pixel minimum threshold to a threshold having a higher dot generation probability based on the determined coefficient, and the quantization unit 106 uses the changed threshold and the input pixel value to quantize Is made.

図12は、本実施例に係る、係数決定部1101で参照されるLUTの入出力特性の一例を示すグラフである。   FIG. 12 is a graph illustrating an example of the input / output characteristics of the LUT referred to by the coefficient determination unit 1101 according to the present embodiment.

図12(a)において、直線1201は、入力画素値によらず出力係数が一定(ここでは0.5)である入出力特性を示している。直線1201で示す入出力特性の場合は、実施例6において係数を0.5にした場合と同じ結果になる。   In FIG. 12A, a straight line 1201 indicates input / output characteristics where the output coefficient is constant (here, 0.5) regardless of the input pixel value. In the case of the input / output characteristics indicated by the straight line 1201, the same result as in the case where the coefficient is 0.5 in the sixth embodiment is obtained.

図12(b)において、折れ線1202は、入力画素値が0〜16の時は出力係数を0.25とし、入力画素値が64以上の時は出力係数を1.0とし、入力画素値が16〜64では出力係数を0.25〜1.0の範囲でリニアに変化させる入出力特性を示している。図12(b)のような入出力特性では、入力画素値が16以下の時は細線再現性が重視され、入力画素値が16から64に上昇するにつれて濃度再現性が重視される(細線再現性を弱める)ことになる。つまり、係数決定部1101で参照するLUTの入出力特性を適切に設定することによって、濃度再現性と細線再現性とのバランスを調整することができる。例えば、紙等の記録媒体やインク等の色材に応じて入出力特性を変化させることで、プリンタの再現能力を最大限引き出すことが可能になる。また、入出力特性を適宜選択することで、ユーザは自身の好みに応じたプリント出力を得ることができる。また、入力画素値が所定値以上の場合は係数を1.0(もしくは1.0以上)にすればよいので、入力画素値が所定値以下に対応する係数のみをLUTに格納すれば足り、LUT容量の削減が可能である。   In FIG. 12B, a broken line 1202 has an output coefficient of 0.25 when the input pixel value is 0 to 16, and an output coefficient of 1.0 when the input pixel value is 64 or more, and the input pixel value is 16 to 64 indicate input / output characteristics in which the output coefficient is linearly changed in the range of 0.25 to 1.0. In the input / output characteristics as shown in FIG. 12B, the fine line reproducibility is emphasized when the input pixel value is 16 or less, and the density reproducibility is emphasized as the input pixel value increases from 16 to 64 (thin line reproduction). Weakens the sex). That is, the balance between density reproducibility and fine line reproducibility can be adjusted by appropriately setting the input / output characteristics of the LUT referenced by the coefficient determination unit 1101. For example, by changing input / output characteristics according to a recording medium such as paper or a color material such as ink, it is possible to maximize the reproducibility of the printer. Further, by appropriately selecting the input / output characteristics, the user can obtain a print output according to his / her preference. In addition, when the input pixel value is equal to or greater than the predetermined value, the coefficient may be set to 1.0 (or 1.0 or more). The LUT capacity can be reduced.

なお、本実施例ではLUTを用いて係数を決定する態様を説明したが、例えば関数を用いて係数を決定するようにしてもよい。また、例えば、入力画素値の区間を細かく区切って区間毎に係数を切り替えるようにしてもよい。   In the present embodiment, the mode of determining the coefficient using the LUT has been described, but the coefficient may be determined using a function, for example. Further, for example, the section of the input pixel value may be finely divided and the coefficient may be switched for each section.

実施例7では、所定領域内の高濃度領域の最小閾値を変更する際の係数を入力画素値に応じて調整する態様について説明した。次に、所定領域内の高濃度領域の最小閾値を変更する際の係数を入力画素値のコントラストに応じて調整する態様について、実施例8として説明する。なお、実施例7と共通する部分については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the seventh embodiment, the aspect in which the coefficient for changing the minimum threshold value of the high density region in the predetermined region is adjusted according to the input pixel value has been described. Next, an embodiment in which the coefficient for changing the minimum threshold value of the high density area in the predetermined area is adjusted according to the contrast of the input pixel value will be described as an eighth embodiment. In addition, about the part which is common in Example 7, description is abbreviate | omitted or simplified, and it shall be demonstrated centering on difference below.

図13は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部101、高濃度画素判定部1001、高濃度画素最小閾値抽出部1002、閾値書換部1003及び量子化部106は、実施例7と同じであるので説明を省略する。   FIG. 13 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold acquisition unit 101, the high density pixel determination unit 1001, the high density pixel minimum threshold value extraction unit 1002, the threshold value rewriting unit 1003, and the quantization unit 106 are the same as those in the seventh embodiment, description thereof will be omitted.

コントラスト導出部1301は、所定領域内のコントラストを導出する。具体的には、例えば、所定領域内の入力画素値の最大値と最小値との差分を求め、これをコントラスト値として導出する。または、「高濃度領域内の画素値の平均値」と「高濃度領域以外の画素値の平均値」との差分を求め、これをコントラスト値とする等、他の手法によって求めた値をコントラスト値としてもよい。導出されたコントラスト値は、係数決定部1302に送られる。   The contrast deriving unit 1301 derives the contrast in the predetermined area. Specifically, for example, a difference between the maximum value and the minimum value of the input pixel values in the predetermined area is obtained, and this is derived as a contrast value. Alternatively, the difference between the “average value of pixel values in the high density area” and the “average value of pixel values outside the high density area” is calculated and used as a contrast value. It may be a value. The derived contrast value is sent to the coefficient determination unit 1302.

係数決定部1302は、入力されたコントラスト値に応じた係数を決定する。具体的には、予め入力値(コントラスト値)に対応する係数値が格納されたLUTを参照し、コントラスト導出部1301から入力されたコントラスト値に応じた係数を決定する。決定された係数は、閾値書換部1003に送られる。そして、閾値書換部1003において、決定された係数に基づき高濃度画素最小閾値が実施例6と同様に変更され、量子化部106において変更後の閾値と入力画素値とを用いた量子化がなされる。   The coefficient determination unit 1302 determines a coefficient corresponding to the input contrast value. Specifically, a coefficient corresponding to the contrast value input from the contrast deriving unit 1301 is determined with reference to an LUT in which coefficient values corresponding to input values (contrast values) are stored in advance. The determined coefficient is sent to the threshold rewriting unit 1003. Then, the threshold rewriting unit 1003 changes the high density pixel minimum threshold based on the determined coefficient in the same manner as in the sixth embodiment, and the quantization unit 106 performs quantization using the changed threshold and the input pixel value. The

図14は、本実施例に係る、係数決定部1302で参照されるLUTの入出力特性の一例を示すグラフである。   FIG. 14 is a graph illustrating an example of the input / output characteristics of the LUT referred to by the coefficient determination unit 1302 according to the present embodiment.

図14において、折れ線1401は、入力コントラスト値が0〜16の時は出力係数を0.25とし、入力コントラスト値が48以上の時は出力係数を1.0とし、入力コントラスト値が16〜48では出力係数を0.25〜1.0の範囲でリニアに変化させる入出力特性を示している。図14に示すような入出力特性では、入力コントラスト値が16以下の時は細線再現性が重視され、入力コントラスト値が16から48に上昇するにつれて濃度再現性が重視される(細線再現性を弱める)ことになる。つまり、実施例7と同様、係数決定部1302で参照するLUTの入出力特性を適切に設定することによって、濃度再現性と細線再現性とのバランスを調整することができる。   In FIG. 14, a broken line 1401 has an output coefficient of 0.25 when the input contrast value is 0 to 16, and an output coefficient of 1.0 when the input contrast value is 48 or more, and an input contrast value of 16 to 48. Shows the input / output characteristics in which the output coefficient is linearly changed in the range of 0.25 to 1.0. In the input / output characteristics as shown in FIG. 14, the fine line reproducibility is emphasized when the input contrast value is 16 or less, and the density reproducibility is emphasized as the input contrast value increases from 16 to 48 (thin line reproducibility is reduced). Will be weakened). That is, as in the seventh embodiment, the balance between density reproducibility and fine line reproducibility can be adjusted by appropriately setting the input / output characteristics of the LUT referenced by the coefficient determination unit 1302.

なお、本実施例ではLUTを用いて係数を決定する態様を説明したが、例えば関数を用いて係数を決定するようにしてもよい。また、例えば、入力コントラスト値の区間を細かく区切って区間毎に係数を切り替えるようにしてもよい。   In the present embodiment, the mode of determining the coefficient using the LUT has been described, but the coefficient may be determined using a function, for example. Further, for example, the input contrast value interval may be finely divided to switch the coefficient for each interval.

実施例6では、高濃度領域の最小閾値を所定の係数を掛けることで変更していた。次に、高濃度領域の最小閾値を、LUTを用いて変更する態様について、実施例9として説明する。なお、実施例6と共通する部分については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the sixth embodiment, the minimum threshold value of the high density region is changed by multiplying by a predetermined coefficient. Next, an embodiment in which the minimum threshold value of the high density region is changed using the LUT will be described as a ninth embodiment. In addition, about the part which is common in Example 6, description is abbreviate | omitted or simplified, and it shall demonstrate below centering on difference.

図15は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部101、高濃度画素判定部1001、高濃度画素最小閾値抽出部1002及び量子化部106は、実施例6と同じであるので説明を省略する。   FIG. 15 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold value acquisition unit 101, the high density pixel determination unit 1001, the high density pixel minimum threshold value extraction unit 1002, and the quantization unit 106 are the same as those in the sixth embodiment, description thereof is omitted.

閾値変換部1501は、入力閾値に応じた出力閾値を決定する処理を行なう。具体的には、予め入力値(閾値)に対応する出力値(閾値)が格納されたLUTを参照し、画素値/閾値取得部101から入力された閾値を変換する。図16は、閾値変換部1501で参照されるLUTの入出力特性の一例を示すグラフである。図16において、折れ線1601は、入力閾値が0〜16の時は傾き1/4、入力閾値が17〜32の時は傾き1/2、入力閾値が33〜48の時は傾き3/2、入力閾値が49〜64の時は傾き7/4となるように設計された入出力特性を示している。なお、図示されていないが、入力閾値が65以上においては、入力閾値がそのまま出力閾値となるように設定されている。このような任意のカーブで表現される入出力特性を持つLUTによって変換された閾値(出力閾値)は、閾値書換部1502に送られる。   The threshold conversion unit 1501 performs a process of determining an output threshold corresponding to the input threshold. Specifically, the threshold value input from the pixel value / threshold value acquisition unit 101 is converted with reference to an LUT in which an output value (threshold value) corresponding to the input value (threshold value) is stored in advance. FIG. 16 is a graph illustrating an example of input / output characteristics of the LUT referred to by the threshold conversion unit 1501. In FIG. 16, a broken line 1601 has a slope of 1/4 when the input threshold is 0 to 16, a slope of 1/2 when the input threshold is 17 to 32, and a slope of 3/2 when the input threshold is 33 to 48. When the input threshold is 49 to 64, the input / output characteristics designed to have a slope of 7/4 are shown. Although not shown, when the input threshold is 65 or more, the input threshold is set to be the output threshold as it is. The threshold value (output threshold value) converted by the LUT having input / output characteristics expressed by such an arbitrary curve is sent to the threshold value rewriting unit 1502.

閾値書換部1502は、高濃度画素最小閾値抽出部1002から受け取った高濃度画素最小閾値情報に基づいて、高濃度画素に対応する閾値の中の最小閾値を、閾値変換部1501から受け取った変換後の閾値に書き換える。例えば、高濃度画素最小閾値情報が示す最小閾値が「48」であった場合には、それに対応する変換後の閾値「32」に変更されることになる。そして、量子化部106において変更後の閾値と入力画素値とを用いた量子化がなされる。
本実施例では、図16に示すような入出力特性のLUTを用いることで、高濃度領域の最小閾値が16〜48の時のドットの出現確率を上げている。
Based on the high density pixel minimum threshold information received from the high density pixel minimum threshold extraction unit 1002, the threshold rewriting unit 1502 receives the minimum threshold among the thresholds corresponding to the high density pixels after the conversion received from the threshold conversion unit 1501. Rewrite to the threshold value. For example, when the minimum threshold value indicated by the high-density pixel minimum threshold information is “48”, the converted threshold value is changed to “32” after conversion. Then, the quantization unit 106 performs quantization using the changed threshold value and the input pixel value.
In this embodiment, by using an LUT having input / output characteristics as shown in FIG. 16, the appearance probability of dots when the minimum threshold value of the high density region is 16 to 48 is increased.

ここで、高濃度領域の最小閾値は、所定領域内における高濃度の画素数が多いと小さくなり、逆に、孤立点のように所定領域内における高濃度の画素数が少ないと大きくなる傾向がある。従って、高濃度領域の最小閾値が16〜48の時のドットの出現確率を上げることで、細線のようにある程度の画素数が高濃度領域に存在する場合のドット出現確率を上げることができる。これにより、孤立点ノイズのように再現する必要のないドットの生成を抑えることが可能となる。なお、入力閾値が64以上は入力値と出力値が一致するので、入力閾値が64未満の係数のみをLUTに格納することで、LUT容量の削減も可能である。   Here, the minimum threshold value of the high density region tends to be small when the number of high density pixels in the predetermined region is large, and conversely, the minimum threshold value tends to be large when the number of high density pixels in the predetermined region is small like an isolated point. is there. Therefore, by increasing the dot appearance probability when the minimum threshold value of the high density region is 16 to 48, it is possible to increase the dot appearance probability when a certain number of pixels are present in the high density region such as a thin line. As a result, generation of dots that do not need to be reproduced, such as isolated point noise, can be suppressed. Since the input value matches the output value when the input threshold is 64 or more, the LUT capacity can be reduced by storing only coefficients having an input threshold less than 64 in the LUT.

なお、本実施例では、LUTを用いて入力閾値を変換する態様を説明したが、例えば関数を用いて入力閾値に対応する出力閾値を決定するようにしてもよい。また、例えば、入力閾値の区間を細かく区切って区間毎に傾きを切り替えるようにして出力閾値を生成してもよい。   In this embodiment, the input threshold value is converted using the LUT. However, for example, an output threshold value corresponding to the input threshold value may be determined using a function. Further, for example, the output threshold may be generated by finely dividing the input threshold section and switching the slope for each section.

次に、ドットが形成されない白画素の閾値が、白画素との境界をなす非白画素(以下、境界画素)の閾値よりもドットが形成される確率が高い閾値であった場合に、境界画素の閾値を白画素の閾値に置き換える態様について、実施例10として説明する。なお、実施例1と共通する部分(変形例を含む)については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   Next, when the threshold value of a white pixel on which no dot is formed is a threshold value that has a higher probability of forming a dot than the threshold value of a non-white pixel (hereinafter referred to as a boundary pixel) that forms a boundary with the white pixel, An embodiment in which the threshold value is replaced with a white pixel threshold value will be described as a tenth embodiment. In addition, about the part (including a modification) which is common in Example 1, description is abbreviate | omitted or simplified, and below, it demonstrates centering on difference.

図17は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。白画素判定部102、白画素最小閾値抽出部103及び量子化部106は、実施例1と同じであるので説明を省略する。   FIG. 17 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the white pixel determination unit 102, the white pixel minimum threshold value extraction unit 103, and the quantization unit 106 are the same as those in the first embodiment, description thereof is omitted.

画素値/閾値取得部1701は、入力画像データの所定領域内における注目画素とその隣接画素の画素値、及び各画素位置に対応する閾値を、不図示のRAM等から取得する。ここでの隣接画素は、注目画素を囲む上下左右と斜めに隣接する8画素を指すものとする。なお、本実施例でも、所定領域を縦4画素×横4画素のブロック領域とするが、所定領域の形状及びサイズはこれに限定するものではない。取得した注目画素の画素値と隣接画素の画素値は、境界画素判定部1702に送られる。さらに、注目画素の画素値が白画素判定部102に送られる。また、各画素位置における閾値は、白画素最小閾値抽出部103、境界画素最小閾値抽出部1703、及び閾値書換部1704に送られる。   The pixel value / threshold acquisition unit 1701 acquires the pixel value of the target pixel and its adjacent pixels in a predetermined area of the input image data, and the threshold corresponding to each pixel position from a RAM (not shown) or the like. Here, the adjacent pixels indicate eight pixels that are obliquely adjacent to the upper, lower, left, and right surrounding the target pixel. In this embodiment as well, the predetermined area is a block area of 4 vertical pixels × 4 horizontal pixels, but the shape and size of the predetermined area are not limited to this. The acquired pixel value of the target pixel and the pixel value of the adjacent pixel are sent to the boundary pixel determination unit 1702. Further, the pixel value of the target pixel is sent to the white pixel determination unit 102. The threshold value at each pixel position is sent to the white pixel minimum threshold value extraction unit 103, the boundary pixel minimum threshold value extraction unit 1703, and the threshold value rewriting unit 1704.

境界画素判定部1702は、画素値/閾値取得部1701から受け取った注目画素の画素値と隣接画素の画素値に基づいて、注目画素が境界画素であるかどうか(白画素との境界であるかどうか)を判定する。例えば、注目画素が非白画素であり、かつ、隣接画素の中に少なくとも1つ白画素があった場合に、当該注目画素を境界画素であると判定するようにする。境界画素であると判定された注目画素を特定するための情報(以下、境界画素情報)は、境界画素最小閾値抽出部1703に送られる。   Based on the pixel value of the target pixel received from the pixel value / threshold acquisition unit 1701 and the pixel value of the adjacent pixel, the boundary pixel determination unit 1702 determines whether the target pixel is a boundary pixel (whether it is a boundary with a white pixel). Determine). For example, when the target pixel is a non-white pixel and there is at least one white pixel among adjacent pixels, the target pixel is determined to be a boundary pixel. Information for identifying the target pixel determined to be a boundary pixel (hereinafter referred to as boundary pixel information) is sent to the boundary pixel minimum threshold value extraction unit 1703.

境界画素最小閾値抽出部1703は、境界画素判定部1602から受け取った境界画素情報と、画素値/閾値取得部1701から受け取った閾値を用いて、所定領域内の境界画素の位置に対応する閾値の中から最小の閾値(以下、境界画素最小閾値)を抽出する。抽出された境界画素最小閾値の情報は、閾値書換部1704に送られる。   The boundary pixel minimum threshold value extraction unit 1703 uses the boundary pixel information received from the boundary pixel determination unit 1602 and the threshold value received from the pixel value / threshold acquisition unit 1701 to determine a threshold value corresponding to the position of the boundary pixel in the predetermined area. A minimum threshold value (hereinafter referred to as a boundary pixel minimum threshold value) is extracted from the inside. Information on the extracted boundary pixel minimum threshold value is sent to the threshold value rewriting unit 1704.

閾値書換部1704は、入力画像に対応する閾値マトリクスについて、境界画素最小閾値を白画素最小閾値に書き換える処理を行なう。具体的には、白画素最小閾値と境界画素最小閾値とを比較し、白画素最小閾値の方が小さい値(ドットが形成される確率が高い閾値)であった場合に、境界画素最小閾値を白画素最小閾値の値に置き換える処理がなされる。   The threshold rewriting unit 1704 performs a process of rewriting the boundary pixel minimum threshold value to the white pixel minimum threshold value for the threshold value matrix corresponding to the input image. Specifically, the white pixel minimum threshold value is compared with the boundary pixel minimum threshold value, and if the white pixel minimum threshold value is smaller (threshold with a higher probability of dot formation), the boundary pixel minimum threshold value is set. Processing to replace the value with the white pixel minimum threshold value is performed.

このような置換処理により、実施例1と同様、面積階調で定義した所定面積内の閾値や画素値を変更することなく、入力画像データの境界画素の位置にドットを形成することができる。なお、境界画素の最小閾値が白画素の最小閾値に置き換わってしまうが、境界画素の最小閾値を白画素の最小閾値と交換したと考えれば所定面積内の閾値に変更はない。ただし、白画素位置の閾値がいかなる値であってもその位置にドットは生成されないので、実施例1と同様、白画素の最小閾値の置換は行わない。   By such replacement processing, as in the first embodiment, dots can be formed at the position of the boundary pixel of the input image data without changing the threshold value or the pixel value within the predetermined area defined by the area gradation. Although the minimum threshold value of the boundary pixel is replaced with the minimum threshold value of the white pixel, if the minimum threshold value of the boundary pixel is replaced with the minimum threshold value of the white pixel, the threshold value within the predetermined area is not changed. However, since no dot is generated at any position of the threshold value of the white pixel position, the minimum threshold value of the white pixel is not replaced as in the first embodiment.

図18は、本実施例に係る閾値書換処理を行なった場合と行なわなかった場合の出力画像の違いを説明する図である。   FIG. 18 is a diagram for explaining a difference between output images when the threshold value rewriting process according to the present embodiment is performed and when it is not performed.

縦4画素×横4画素の入力画像1801は、3列目及び4列目の画素値が「32」でそれ以外の画素値が「0」の画像データである。閾値マトリクス1802は、閾値書換処理がなされる前の、入力画像1801に対応する閾値マトリクスである。スクリーン画像1804は、閾値マトリクス1802を用いて入力画像1801を量子化した場合に得られる出力画像である。入力画像1801の4列目の画素値「32」に対し、閾値マトリクス1802の4列目の閾値の最小値は「20」であるため、スクリーン画像1804の4列目にはドットが存在している。しかながら、入力画像1801の3列目の画素値「32」に対し、閾値マトリクス1802の3列目の閾値の最小値は「50」であるため、スクリーン画像1804の3列目にはドットが存在していない(ドット消失)。   The input image 1801 of 4 vertical pixels × 4 horizontal pixels is image data in which the pixel values in the third and fourth columns are “32” and the other pixel values are “0”. The threshold matrix 1802 is a threshold matrix corresponding to the input image 1801 before the threshold rewriting process is performed. A screen image 1804 is an output image obtained when the input image 1801 is quantized using the threshold value matrix 1802. Since the minimum value of the threshold value in the fourth column of the threshold matrix 1802 is “20” with respect to the pixel value “32” in the fourth column of the input image 1801, there are dots in the fourth column of the screen image 1804. Yes. However, since the minimum value of the threshold value in the third column of the threshold value matrix 1802 is “50” with respect to the pixel value “32” in the third column of the input image 1801, there are dots in the third column of the screen image 1804. Does not exist (dot disappearance).

閾値マトリクス1803は、閾値書換処理がなされた後の、入力画像1801に対応する閾値マトリクスである。閾値マトリクス1803では、閾値マトリクス1802における白画素最小閾値「8」(図中の○)の値で、境界画素最小閾値「50」(図中の△)が置換されているのが分かる。スクリーン画像1805は、閾値書換後の閾値マトリクス1803を用いて入力画像1801を量子化した場合に得られる出力画像である。スクリーン画像1805では、スクリーン画像1804で存在しなかった3列目の(消失していた)ドットを再現することができている。   The threshold matrix 1803 is a threshold matrix corresponding to the input image 1801 after the threshold rewriting process is performed. In the threshold matrix 1803, it can be seen that the value of the white pixel minimum threshold “8” (◯ in the figure) in the threshold matrix 1802 is replaced with the boundary pixel minimum threshold “50” (Δ in the figure). The screen image 1805 is an output image obtained when the input image 1801 is quantized using the threshold value matrix 1803 after threshold value rewriting. In the screen image 1805, the third row (disappeared) dots that did not exist in the screen image 1804 can be reproduced.

図19は、本実施例に係る画像処理装置で実行される処理のうち、白画素最小閾値抽出処理、境界画素最小閾値抽出処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 19 is a flowchart illustrating details of the white pixel minimum threshold extraction process, the boundary pixel minimum threshold extraction process, and the threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment.

ステップ1901において、白画素最小閾値抽出部103は、白画素位置の最小閾値を保持する変数である白画素最小閾値(MinTHoff)を初期化する。同様に、境界画素最小閾値抽出部1703は、境界画素位置の最小閾値を保持する変数である境界画素最小閾値(MinTHadj)を初期化する。具体的には、MinTHoff及びMinTHadjの値に、スクリーン処理における閾値の最大値(又は入力画素値のレンジの最大値)をそれぞれセットする。なお、これら変数はRAMにて保持される。 In step 1901, the white pixel minimum threshold value extraction unit 103 initializes a white pixel minimum threshold value (MinTH off ) that is a variable that holds the minimum threshold value of the white pixel position. Similarly, the boundary pixel minimum threshold value extraction unit 1703 initializes the boundary pixel minimum threshold value (MinTH adj ), which is a variable that holds the minimum threshold value of the boundary pixel position. Specifically, the maximum threshold value in screen processing (or the maximum value of the range of input pixel values) is set as the MinTH off and MinTH adj values, respectively. These variables are held in the RAM.

ステップ1902において、白画素最小閾値抽出部103は、所定領域内の注目画素についての白画素情報、及び注目画素に対応する閾値を取得する。また、境界画素最小閾値抽出部1703は、所定領域内の注目画素についての境界画素情報、及び注目画素に対応する閾値を取得する。   In step 1902, the white pixel minimum threshold value extraction unit 103 acquires white pixel information about the target pixel in the predetermined area and a threshold value corresponding to the target pixel. Further, the boundary pixel minimum threshold value extraction unit 1703 acquires boundary pixel information regarding the target pixel in the predetermined region and a threshold value corresponding to the target pixel.

ステップ1903において、白画素最小閾値抽出部103は、ステップ1902で取得した白画素情報に基づいて、注目画素が白画素であるかどうかを判定する。判定の結果、白画素である場合は、ステップ1904に進む。一方、白画素でない場合(非白画素である場合)は、ステップ1906に進む。   In step 1903, the white pixel minimum threshold value extraction unit 103 determines whether the target pixel is a white pixel based on the white pixel information acquired in step 1902. If it is determined that the pixel is a white pixel, the process proceeds to step 1904. On the other hand, if it is not a white pixel (if it is a non-white pixel), the process proceeds to step 1906.

ステップ1904において、白画素最小閾値抽出部103は、現時点の白画素最小閾値(MinTHoff)とステップ1902で取得した注目画素の閾値とを比較する。比較の結果、MinTHoffの値が注目画素の閾値より大きい場合は、ステップ1905に進む。一方、MinTHoffの値が注目画素の閾値より大きくない場合は、ステップ1909に進む。 In step 1904, the white pixel minimum threshold value extraction unit 103 compares the current white pixel minimum threshold value (MinTH off ) with the threshold value of the target pixel acquired in step 1902. As a result of the comparison, if the value of MinTH off is larger than the threshold value of the target pixel, the process proceeds to step 1905. On the other hand, if the value of MinTH off is not larger than the threshold value of the target pixel, the process proceeds to step 1909.

ステップ1905において、白画素最小閾値抽出部103は、MinTHoffの値を、ステップ1902で取得した閾値に更新する。 In step 1905, the white pixel minimum threshold value extraction unit 103 updates the value of MinTH off to the threshold value acquired in step 1902.

ステップ1906において、境界画素最小閾値抽出部1703は、ステップ1902で取得した境界画素情報に基づいて、注目画素が境界画素であるかどうかを判定する。判定の結果、境界画素である場合は、ステップ1907に進む。一方、境界画素でない場合(白画素と隣接していない非白画素である場合)は、ステップ1909に進む。   In step 1906, the boundary pixel minimum threshold value extraction unit 1703 determines whether the target pixel is a boundary pixel based on the boundary pixel information acquired in step 1902. If it is determined that the pixel is a boundary pixel, the process proceeds to step 1907. On the other hand, if it is not a boundary pixel (if it is a non-white pixel that is not adjacent to a white pixel), the process proceeds to step 1909.

ステップ1907において、境界画素最小閾値抽出部1703は、現時点の境界画素最小閾値(MinTHadj)とステップ1902で取得した注目画素の閾値とを比較する。比較の結果、MinTHadjの値が注目画素の閾値より大きい場合は、ステップ1908に進む。一方、MinTHadjの値が注目画素の閾値より大きくない場合は、ステップ1909に進む。 In step 1907, the boundary pixel minimum threshold value extraction unit 1703 compares the current boundary pixel minimum threshold value (MinTH adj ) with the threshold value of the target pixel acquired in step 1902. As a result of the comparison, if the value of MinTH adj is larger than the threshold value of the target pixel, the process proceeds to step 1908. On the other hand, if the value of MinTH adj is not larger than the threshold value of the target pixel, the process proceeds to step 1909.

ステップ1908において、境界画素最小閾値抽出部1703は、MinTHadjの値を、ステップ1902で取得した閾値に更新する。 In step 1908, the boundary pixel minimum threshold value extraction unit 1703 updates the value of MinTH adj to the threshold value acquired in step 1902.

ステップ1909では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ1910に進む。ステップ1910に進んだ時点で、所定領域内の白画素位置における最小閾値がMinTHoffとして保持され、境界画素位置における最小閾値がMinTHadjとして保持されていることになる。一方、所定領域内に未処理の画素があればステップ1902に戻り、次の画素を注目画素としてステップ1902〜ステップ1908の各処理を行なう。 In step 1909, it is determined whether or not the processing has been completed for all the pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 1910. At step 1910, the minimum threshold value at the white pixel position in the predetermined area is held as MinTH off , and the minimum threshold value at the boundary pixel position is held as MinTH adj . On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to step 1902 to perform each process of step 1902 to step 1908 with the next pixel as a target pixel.

ステップ1910において、閾値書換部1704は、所定領域内の注目画素に対応する閾値を取得する。   In step 1910, the threshold value rewriting unit 1704 acquires a threshold value corresponding to the target pixel in the predetermined area.

ステップ1911において、閾値書換部1704は、ステップ1910で取得した閾値と、境界画素最小閾値(MinTHadj)とが同じであるかどうかを判定する。両者が同じ値である場合は、ステップ1912に進む。一方、両者が同じ値でない場合は、ステップ1914に進む。 In step 1911, the threshold rewriting unit 1704 determines whether or not the threshold acquired in step 1910 is the same as the boundary pixel minimum threshold (MinTH adj ). If both are the same value, the process proceeds to step 1912. On the other hand, if they are not the same value, the process proceeds to step 1914.

ステップ1912において、閾値書換部1704は、白画素最小閾値(MinTHoff)とステップ1910で取得した閾値とを比較する。この比較の時点で、ステップ1910で取得した閾値は、境界画素最小閾値(MinTHadj)と同じ値である。よって、本ステップでは、境界画素最小閾値(MinTHadj)と白画素最小閾値(MinTHoff)との大小関係を比較していることになる。判定の結果、白画素最小閾値が境界画素最小閾値(取得した閾値)より小さい場合は、ステップ1913に進む。一方、白画素最小閾値が境界画素最小閾値(取得した閾値)より小さくない場合は、ステップ1914に進む。 In step 1912, the threshold rewriting unit 1704 compares the white pixel minimum threshold (MinTH off ) with the threshold acquired in step 1910. At the time of this comparison, the threshold acquired in step 1910 is the same value as the boundary pixel minimum threshold (MinTH adj ). Therefore, in this step, the magnitude relationship between the boundary pixel minimum threshold (MinTH adj ) and the white pixel minimum threshold (MinTH off ) is compared. As a result of the determination, if the white pixel minimum threshold is smaller than the boundary pixel minimum threshold (acquired threshold), the process proceeds to step 1913. On the other hand, if the white pixel minimum threshold is not smaller than the boundary pixel minimum threshold (acquired threshold), the process proceeds to step 1914.

ステップ1913において、閾値書換部1704は、ステップ1910で取得した閾値を白画素最小閾値で置換する。すなわち、注目画素に対応する閾値として、白画素最小閾値(MinTHoff)の値が設定されることになる。 In step 1913, the threshold rewriting unit 1704 replaces the threshold acquired in step 1910 with the white pixel minimum threshold. That is, the value of the white pixel minimum threshold (MinTH off ) is set as the threshold corresponding to the target pixel.

ステップ1914では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。未処理の画素がある場合は、ステップ1910に戻り、次の画素を注目画素としてステップ1910〜ステップ1913の処理を繰り返す。一方、すべての画素に対して処理が終了していた場合は、本処理を終える。   In step 1914, it is determined whether or not the processing has been completed for all the pixels in the predetermined area. If there is an unprocessed pixel, the process returns to step 1910 to repeat the processes of steps 1910 to 1913 with the next pixel as the target pixel. On the other hand, if the processing has been completed for all the pixels, the present processing ends.

以上が、本実施例に係る画像処理装置で実行される処理のうち、白画素最小閾値、境界画素最小閾値抽出処理、及び閾値置換処理の内容である。   The above is the contents of the white pixel minimum threshold value, the boundary pixel minimum threshold value extraction process, and the threshold value replacement process among the processes executed by the image processing apparatus according to the present embodiment.

これにより、境界画素の最小閾値(量子化に使用する閾値)が、ドットが形成される確率が高い閾値へと、所定領域毎に置き換えられる。   As a result, the minimum threshold value of the boundary pixel (threshold value used for quantization) is replaced for each predetermined area with a threshold value that has a high probability of dot formation.

実施例10において、白画素及び境界画素を除いたその他の画素領域(以下、「残領域」)の閾値の中に所定領域内における最小の閾値がある場合は、ドット生成確率が最も高い画素が白画素領域にはないのであるから、境界画素の閾値を置換する必要がない。そこで、残領域における最小閾値が、白画素最小閾値より小さい場合は、境界画素の閾値の置換を行わない態様について、実施例11として説明する。なお、実施例10と共通する部分については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the tenth embodiment, when there is a minimum threshold value in a predetermined region among threshold values of other pixel regions excluding white pixels and boundary pixels (hereinafter referred to as “remaining region”), the pixel having the highest dot generation probability is Since it is not in the white pixel region, it is not necessary to replace the threshold value of the boundary pixel. Thus, an embodiment in which the threshold value of the boundary pixel is not replaced when the minimum threshold value in the remaining area is smaller than the white pixel minimum threshold value will be described as Example 11. In addition, about the part which is common in Example 10, description is abbreviate | omitted or simplified, and it shall demonstrate centering on difference below.

図20は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部1701、白画素判定部102、境界画素判定部1702、白画素最小閾値抽出部103、境界画素最小閾値抽出部1703、量子化部106は、実施例10と同じであるので説明を省略する。   FIG. 20 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold acquisition unit 1701, the white pixel determination unit 102, the boundary pixel determination unit 1702, the white pixel minimum threshold extraction unit 103, the boundary pixel minimum threshold extraction unit 1703, and the quantization unit 106 are the same as those in the tenth embodiment. Description is omitted.

全画素最小閾値抽出部2001は、画素値/閾値取得部1701から受け取った閾値を用いて、所定領域内の全画素に対応する閾値の中から最小の閾値(以下、全画素最小閾値)を抽出する。     The all-pixel minimum threshold value extraction unit 2001 uses the threshold value received from the pixel value / threshold value acquisition unit 1701 to extract the minimum threshold value (hereinafter, all-pixel minimum threshold value) from the threshold values corresponding to all the pixels in the predetermined area. To do.

閾値書換部2002は、全画素最小閾値抽出部2001で抽出した全画素最小閾値、白画素最小閾値抽出部103で抽出した白画素最小閾値、境界画素最小閾値抽出部1703で抽出した境界画素最小閾値を参照して、必要な場合のみ閾値の書換処理を行う。具体的には、白画素最小閾値が最も小さい場合(全画素最小閾値=白画素最小閾値の時)にのみ、境界画素最小閾値を白画素最小閾値で置換し、全画素最小閾値が白画素最小閾値より小さい場合(全画素最小閾値≠白画素最小閾値の時)は、置換を行わない。   The threshold rewriting unit 2002 includes an all pixel minimum threshold extracted by the all pixel minimum threshold extraction unit 2001, a white pixel minimum threshold extracted by the white pixel minimum threshold extraction unit 103, and a boundary pixel minimum threshold extracted by the boundary pixel minimum threshold extraction unit 1703. Referring to, threshold rewriting processing is performed only when necessary. Specifically, only when the white pixel minimum threshold is the smallest (when all pixel minimum threshold = white pixel minimum threshold), the boundary pixel minimum threshold is replaced with the white pixel minimum threshold, and the all pixel minimum threshold is the white pixel minimum. If it is smaller than the threshold value (when all pixel minimum threshold value ≠ white pixel minimum threshold value), no replacement is performed.

なお、画素値/閾値取得部1701の機能自体は実施例10と同じであるが、本実施例の場合、画素値/閾値取得部1701で取得された閾値が、全画素最小閾値抽出部2001にも送られる点で、実施例10とは異なっている。   The function of the pixel value / threshold acquisition unit 1701 is the same as that of the tenth embodiment. In the present embodiment, the threshold acquired by the pixel value / threshold acquisition unit 1701 is stored in the all-pixel minimum threshold extraction unit 2001. Is also different from the tenth embodiment in that it is also sent.

図21は、本実施例に係る画像処理装置で実行される処理のうち、全画素最小閾値抽出処理、白画素最小閾値抽出処理、境界画素最小閾値抽出処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 21 shows details of all pixel minimum threshold extraction processing, white pixel minimum threshold extraction processing, boundary pixel minimum threshold extraction processing, and threshold rewriting processing among the processing executed by the image processing apparatus according to the present embodiment. It is a flowchart.

ステップ2101において、全画素最小閾値抽出部2001は、所定領域内の全画素における最小閾値を保持する変数である全画素最小閾値(MinTHall)を初期化する。同様に、白画素最小閾値抽出部103は、白画素位置の最小閾値を保持する変数である白画素最小閾値(MinTHoff)を初期化する。さらに、境界画素最小閾値抽出部1703は、境界画素位置の最小閾値を保持する変数である境界画素最小閾値(MinTHadj)を初期化する。具体的には、MinTHall、MinTHoff及びMinTHadjの値に、スクリーン処理における閾値の最大値(又は入力画素値のレンジの最大値)をそれぞれセットする。なお、これら変数はRAMにて保持される。 In step 2101, the all-pixel minimum threshold value extraction unit 2001 initializes the all-pixel minimum threshold value (MinTH all ), which is a variable that holds the minimum threshold value for all the pixels in the predetermined area. Similarly, the white pixel minimum threshold value extraction unit 103 initializes a white pixel minimum threshold value (MinTH off ) that is a variable that holds the minimum threshold value of the white pixel position. Further, the boundary pixel minimum threshold value extraction unit 1703 initializes a boundary pixel minimum threshold value (MinTH adj ), which is a variable that holds the minimum threshold value of the boundary pixel position. Specifically, the maximum threshold value in screen processing (or the maximum value of the range of input pixel values) is set as the MinTH all , MinTH off, and MinTH adj values. These variables are held in the RAM.

ステップ2102において、全画素最小閾値抽出部2001は、所定領域内の注目画素に対応する閾値を取得する。また、白画素最小閾値抽出部103は、所定領域内の注目画素についての白画素情報、及び注目画素に対応する閾値を取得する。また、境界画素最小閾値抽出部1703は、所定領域内の注目画素についての境界画素情報、及び注目画素に対応する閾値を取得する。   In step 2102, the all-pixel minimum threshold value extraction unit 2001 acquires a threshold value corresponding to the target pixel in the predetermined area. Further, the white pixel minimum threshold value extraction unit 103 acquires white pixel information about the target pixel in the predetermined area and a threshold value corresponding to the target pixel. Further, the boundary pixel minimum threshold value extraction unit 1703 acquires boundary pixel information regarding the target pixel in the predetermined region and a threshold value corresponding to the target pixel.

ステップ2103において、全画素最小閾値抽出部2001は、現時点の全画素最小閾値(MinTHall)とステップ2102で取得した注目画素の閾値とを比較する。比較の結果、MinTHallの値が注目画素の閾値より大きい場合は、ステップ2104に進む。一方、MinTHallの値が注目画素の閾値より大きくない場合は、ステップ2105に進む。 In step 2103, the all-pixel minimum threshold value extraction unit 2001 compares the current all-pixel minimum threshold value (MinTH all ) with the threshold value of the target pixel acquired in step 2102. As a result of the comparison, if the value of MinTH all is larger than the threshold value of the target pixel, the process proceeds to step 2104. On the other hand, if the value of MinTH all is not larger than the threshold value of the target pixel, the process proceeds to step 2105.

ステップ2104において、全画素最小閾値抽出部2001は、MinTHallの値を、ステップ2102で取得した閾値に更新する。 In step 2104, the all-pixel minimum threshold value extraction unit 2001 updates the value of MinTH all to the threshold value acquired in step 2102.

ステップ2105において、白画素最小閾値抽出部103は、ステップ2102で取得した白画素情報に基づいて、注目画素が白画素であるかどうかを判定する。判定の結果、白画素である場合は、ステップ2106に進む。一方、白画素でない場合(非白画素である場合)は、ステップ2108に進む。   In step 2105, the white pixel minimum threshold value extraction unit 103 determines whether the target pixel is a white pixel based on the white pixel information acquired in step 2102. If it is determined that the pixel is a white pixel, the process proceeds to step 2106. On the other hand, if it is not a white pixel (if it is a non-white pixel), the process proceeds to step 2108.

ステップ2106において、白画素最小閾値抽出部103は、現時点の白画素最小閾値(MinTHoff)とステップ2102で取得した注目画素の閾値とを比較する。比較の結果、MinTHoffの値が注目画素の閾値より大きい場合は、ステップ2107に進む。一方、MinTHoffの値が処理対象画素の閾値より大きくない場合は、ステップ2111に進む。 In step 2106, the white pixel minimum threshold value extraction unit 103 compares the current white pixel minimum threshold value (MinTH off ) with the threshold value of the target pixel acquired in step 2102. As a result of the comparison, if the value of MinTH off is larger than the threshold value of the target pixel, the process proceeds to step 2107. On the other hand, if the value of MinTH off is not larger than the threshold value of the processing target pixel, the process proceeds to step 2111.

ステップ2107において、白画素最小閾値抽出部103は、MinTHoffの値を、ステップ2102で取得した閾値に更新する。 In step 2107, the white pixel minimum threshold value extraction unit 103 updates the value of MinTH off to the threshold value acquired in step 2102.

ステップ2108において、境界画素最小閾値抽出部1703は、ステップ1902で取得した境界画素情報に基づいて、注目画素が境界画素であるかどうかを判定する。判定の結果、境界画素である場合は、ステップ2109に進む。一方、境界画素でない場合(白画素と隣接していない非白画素である場合)は、ステップ2111に進む。   In step 2108, the boundary pixel minimum threshold value extraction unit 1703 determines whether the target pixel is a boundary pixel based on the boundary pixel information acquired in step 1902. If it is determined that the pixel is a boundary pixel, the process proceeds to step 2109. On the other hand, if it is not a boundary pixel (if it is a non-white pixel that is not adjacent to a white pixel), the process proceeds to step 2111.

ステップ2109において、境界画素最小閾値抽出部1703は、現時点の境界画素最小閾値(MinTHadj)とステップ2102で取得した注目画素の閾値とを比較する。比較の結果、MinTHadjの値が注目画素の閾値より大きい場合は、ステップ2110に進む。一方、MinTHadjの値が注目画素の閾値より大きくない場合は、ステップ2111に進む。 In step 2109, the boundary pixel minimum threshold value extraction unit 1703 compares the current boundary pixel minimum threshold value (MinTH adj ) with the threshold value of the target pixel acquired in step 2102. As a result of the comparison, if the value of MinTH adj is larger than the threshold value of the target pixel, the process proceeds to step 2110. On the other hand, if the value of MinTH adj is not larger than the threshold value of the target pixel, the process proceeds to step 2111.

ステップ2110において、境界画素最小閾値抽出部1703は、MinTHadjの値を、ステップ2102で取得した閾値に更新する。 In step 2110, the boundary pixel minimum threshold value extraction unit 1703 updates the value of MinTH adj to the threshold value acquired in step 2102.

ステップ2111では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ2112に進む。ステップ2112に進んだ時点で、所定領域内の全画素における最小閾値がMinTHallとして、所定領域内の白画素位置における最小閾値がMinTHoffとして、境界画素位置における最小閾値がMinTHadjとしてそれぞれ保持されていることになる。一方、所定領域内に未処理の画素があればステップ2102に戻り、次の画素を注目画素としてステップ2102〜ステップ2110の各処理を行なう。 In step 2111, it is determined whether or not processing has been completed for all pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 2112. At the time of proceeding to step 2112, the minimum threshold value for all pixels in the predetermined area is held as MinTH all , the minimum threshold value at the white pixel position in the predetermined area is set to MinTH off , and the minimum threshold value at the boundary pixel position is held as MinTH adj. Will be. On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to step 2102, and each process of step 2102 to step 2110 is performed with the next pixel as the target pixel.

ステップ2112において、閾値書換部2002は、所定領域内の注目画素に対応する閾値を取得する。   In step 2112, the threshold rewriting unit 2002 obtains a threshold corresponding to the target pixel in the predetermined area.

ステップ2113において、閾値書換部2002は、全画素最小閾値(MinTHall)が、白画素最小閾値(MinTHoff)より小さいかどうかを判定する。全画素最小閾値の方が小さい場合は、所定領域の中で最小の閾値が、境界画素又は残領域の画素に存在することを意味する為、閾値の置換を行うことなく、ステップ2116に進む。それ以外の場合(全画素最小閾値と白画素最小閾値とが等しい場合)は、ステップ2114に進む。 In step 2113, the threshold value rewriting unit 2002 determines whether or not the all pixel minimum threshold value (MinTH all ) is smaller than the white pixel minimum threshold value (MinTH off ). If the all pixel minimum threshold value is smaller, it means that the minimum threshold value in the predetermined region is present in the boundary pixel or the remaining region pixel, and thus the process proceeds to step 2116 without replacing the threshold value. In other cases (when the minimum threshold value for all pixels is equal to the minimum threshold value for white pixels), the process proceeds to step 2114.

ステップ2114において、閾値書換部2002は、ステップ2112で取得した閾値と、境界画素最小閾値(MinTHadj)とが同じであるかどうかを判定する。両者が同じ値である場合は、ステップ2115に進む。一方、両者が同じ値でない場合は、ステップ2116に進む。 In step 2114, the threshold rewriting unit 2002 determines whether the threshold acquired in step 2112 is the same as the boundary pixel minimum threshold (MinTH adj ). If both are the same value, the process proceeds to step 2115. On the other hand, if they are not the same value, the process proceeds to step 2116.

ステップ2115において、閾値書換部2002は、ステップ2112で取得した閾値を白画素最小閾値で置換する。すなわち、注目画素に対応する閾値として、白画素最小閾値(MinTHoff)の値が設定されることになる。 In step 2115, the threshold rewriting unit 2002 replaces the threshold acquired in step 2112 with the white pixel minimum threshold. That is, the value of the white pixel minimum threshold (MinTH off ) is set as the threshold corresponding to the target pixel.

ステップ2116では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。未処理の画素がある場合は、ステップ2112に戻り、次の画素を注目画素としてステップ2112〜ステップ2115の処理を繰り返す。一方、すべての画素に対して処理が終了していた場合は、本処理を終える。   In step 2116, it is determined whether or not the processing has been completed for all the pixels in the predetermined area. If there is an unprocessed pixel, the process returns to step 2112 to repeat the processing of step 2112 to step 2115 with the next pixel as the target pixel. On the other hand, if the processing has been completed for all the pixels, the present processing ends.

以上が、本実施例に係る画像処理装置で実行される処理のうち、全画素最小閾値抽出処理、白画素最小閾値抽出処理、境界画素最小閾値抽出処理、及び閾値書換処理の内容である。   The above is the contents of the all pixel minimum threshold extraction process, the white pixel minimum threshold extraction process, the boundary pixel minimum threshold extraction process, and the threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment.

本実施例によれば、境界画素最小閾値の所定領域毎の書換処理が必要なときにのみに制限され、量子化後の結果が必要以上に濃くなるのを防ぐことができる。   According to the present embodiment, it is limited only when rewriting processing for each predetermined area of the boundary pixel minimum threshold is necessary, and it is possible to prevent the result after quantization from becoming darker than necessary.

実施例11では、「残領域における最小閾値」=「所定領域内における最小閾値」である場合に、書換処理を行なわない態様について説明した。次に、残領域における最小閾値が所定領域内における最小閾値である場合に、残領域の最小閾値と境界画素の最小閾値とを交換する態様について、実施例12として説明する。なお、実施例10及び11と共通する部分については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   In the eleventh embodiment, a case has been described in which the rewriting process is not performed when “minimum threshold in the remaining area” = “minimum threshold in the predetermined area”. Next, an embodiment in which the minimum threshold of the remaining area and the minimum threshold of the boundary pixel are exchanged when the minimum threshold in the remaining area is the minimum threshold in the predetermined area will be described as a twelfth embodiment. In addition, about the part which is common in Example 10 and 11, description is abbreviate | omitted or simplified, and it shall demonstrate centering on difference below below.

図22は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部1701、境界画素判定部1702、全画素最小閾値抽出部2001、境界画素最小閾値抽出部1703、量子化部106は、実施例10又は11と共通であるので説明を省略する。   FIG. 22 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold value acquisition unit 1701, the boundary pixel determination unit 1702, the all pixel minimum threshold value extraction unit 2001, the boundary pixel minimum threshold value extraction unit 1703, and the quantization unit 106 are the same as those in the tenth or eleventh embodiment, description thereof is omitted. .

閾値書換部2201は、入力画像に対応する閾値マトリクスについて、全画素最小閾値と白画素最小閾値とを交換することにより閾値書換処理を行なう。具体的には、全画素最小閾値と境界画素最小閾値とを比較し、全画素最小閾値の方が境界画素最小閾値より小さい閾値(ドットが形成される確率が高い閾値)であった場合に、双方の閾値を入れ替える。     The threshold rewriting unit 2201 performs threshold rewriting processing by exchanging the all pixel minimum threshold and the white pixel minimum threshold for the threshold value matrix corresponding to the input image. Specifically, when the all pixel minimum threshold is compared with the boundary pixel minimum threshold, and the all pixel minimum threshold is smaller than the boundary pixel minimum threshold (threshold with a high probability of dot formation), Swap both thresholds.

なお、画素値/閾値取得部1701の機能自体は実施例10と同じであるが、本実施例の場合、画素値/閾値取得部1701で取得された閾値が、全画素最小閾値抽出部2001と境界画素最小閾値抽出部1703に送られる点で、実施例10とは異なっている。   The function of the pixel value / threshold acquisition unit 1701 is the same as that of the tenth embodiment. However, in this embodiment, the threshold acquired by the pixel value / threshold acquisition unit 1701 is the same as the all-pixel minimum threshold extraction unit 2001. This is different from the tenth embodiment in that it is sent to the boundary pixel minimum threshold value extraction unit 1703.

図23は、本実施例に係る画像処理装置で実行される処理のうち、全画素最小閾値抽出処理、境界画素最小閾値抽出処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 23 is a flowchart illustrating details of all pixel minimum threshold extraction processing, boundary pixel minimum threshold extraction processing, and threshold rewriting processing among the processing executed by the image processing apparatus according to the present embodiment.

ステップ2301において、全画素最小閾値抽出部2001は、所定領域内の全画素における最小閾値を保持する変数である全画素最小閾値(MinTHall)を初期化する。同様に、境界画素最小閾値抽出部1703は、境界画素位置の最小閾値を保持する変数である境界画素最小閾値(MinTHadj)を初期化する。具体的には、MinTHall、MinTHadjの値に、スクリーン処理における閾値の最大値(又は入力画素値のレンジの最大値)をそれぞれセットする。なお、これら変数はRAMにて保持される。 In step 2301, the all-pixel minimum threshold value extraction unit 2001 initializes the all-pixel minimum threshold value (MinTH all ), which is a variable that holds the minimum threshold value for all pixels in the predetermined area. Similarly, the boundary pixel minimum threshold value extraction unit 1703 initializes the boundary pixel minimum threshold value (MinTH adj ), which is a variable that holds the minimum threshold value of the boundary pixel position. Specifically, the maximum threshold value in screen processing (or the maximum value of the range of input pixel values) is set as the MinTH all and MinTH adj values. These variables are held in the RAM.

ステップ2302において、全画素最小閾値抽出部2001は、所定領域内の注目画素に対応する閾値を取得する。また、境界画素最小閾値抽出部1703は、所定領域内の注目画素についての境界画素情報、及び注目画素に対応する閾値を取得する。   In step 2302, the all-pixel minimum threshold value extraction unit 2001 acquires a threshold value corresponding to the target pixel in the predetermined area. Further, the boundary pixel minimum threshold value extraction unit 1703 acquires boundary pixel information regarding the target pixel in the predetermined region and a threshold value corresponding to the target pixel.

ステップ2303において、全画素最小閾値抽出部2001は、現時点の全画素最小閾値(MinTHall)とステップ2302で取得した注目画素の閾値とを比較する。比較の結果、MinTHallの値が注目画素の閾値より大きい場合は、ステップ2304に進む。一方、MinTHallの値が注目画素の閾値より大きくない場合は、ステップ2305に進む。 In step 2303, the all-pixel minimum threshold value extraction unit 2001 compares the current all-pixel minimum threshold value (MinTH all ) with the threshold value of the target pixel acquired in step 2302. As a result of the comparison, if the value of MinTH all is larger than the threshold value of the target pixel, the process proceeds to step 2304. On the other hand, if the value of MinTH all is not larger than the threshold value of the target pixel, the process proceeds to step 2305.

ステップ2304において、全画素最小閾値抽出部2001は、MinTHallの値を、ステップ2302で取得した閾値に更新する。 In step 2304, the all-pixel minimum threshold value extraction unit 2001 updates the value of MinTH all to the threshold value acquired in step 2302.

ステップ2305において、境界画素最小閾値抽出部1703は、ステップ2302で取得した境界画素情報に基づいて、注目画素が境界画素であるかどうかを判定する。判定の結果、境界画素である場合は、ステップ2306に進む。一方、境界画素でない場合(白画素と隣接していない非白画素である場合)は、ステップ2308に進む。   In step 2305, the boundary pixel minimum threshold value extraction unit 1703 determines whether the target pixel is a boundary pixel based on the boundary pixel information acquired in step 2302. If it is determined that the pixel is a boundary pixel, the process proceeds to step 2306. On the other hand, if it is not a boundary pixel (if it is a non-white pixel that is not adjacent to a white pixel), the process proceeds to step 2308.

ステップ2306において、境界画素最小閾値抽出部1703は、現時点の境界画素最小閾値(MinTHadj)とステップ2302で取得した注目画素の閾値とを比較する。比較の結果、MinTHadjの値が注目画素の閾値より大きい場合は、ステップ2307に進む。一方、MinTHadjの値が注目画素の閾値より大きくない場合は、ステップ2308に進む。 In step 2306, the boundary pixel minimum threshold value extraction unit 1703 compares the current boundary pixel minimum threshold value (MinTH adj ) with the threshold value of the target pixel acquired in step 2302. As a result of the comparison, if the value of MinTH adj is larger than the threshold value of the target pixel, the process proceeds to step 2307. On the other hand, if the value of MinTH adj is not larger than the threshold value of the target pixel, the process proceeds to step 2308.

ステップ2307において、境界画素最小閾値抽出部1703は、MinTHadjの値を、ステップ2302で取得した閾値に更新する。 In step 2307, the boundary pixel minimum threshold value extraction unit 1703 updates the value of MinTH adj to the threshold value acquired in step 2302.

ステップ2308では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ2309に進む。ステップ2309に進んだ時点で、所定領域内の全画素における最小閾値がMinTHallとして、境界画素位置における最小閾値がMinTHadjとしてそれぞれ保持されていることになる。一方、所定領域内に未処理の画素があればステップ2302に戻り、次の画素を注目画素としてステップ2302〜ステップ2307の各処理を行なう。 In step 2308, it is determined whether or not processing has been completed for all pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 2309. When the processing proceeds to step 2309, the minimum threshold value for all pixels in the predetermined area is held as MinTH all , and the minimum threshold value at the boundary pixel position is held as MinTH adj . On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to Step 2302, and each process of Step 2302 to Step 2307 is performed with the next pixel as the target pixel.

ステップ2309において、閾値書換部2201は、所定領域内の注目画素に対応する閾値を取得する。   In step 2309, the threshold value rewriting unit 2201 acquires a threshold value corresponding to the target pixel in the predetermined area.

ステップ2310において、閾値書換部2201は、境界画素最小閾値(MinTHadj)が全画素最小閾値(MinTHall)と同じであるかどうかを判定する。境界画素最小閾値の方と同じ値である場合は、閾値の交換を行う必要がないので、ステップ2315に進む。境界画素最小閾値と同じ値でない場合は、ステップ2311に進む。 In step 2310, the threshold rewriting unit 2201 determines whether or not the boundary pixel minimum threshold (MinTH adj ) is the same as the all pixel minimum threshold (MinTH all ). If it is the same value as the boundary pixel minimum threshold value, the threshold value does not need to be exchanged, and the process proceeds to step 2315. If it is not the same value as the boundary pixel minimum threshold value, the process proceeds to step 2311.

ステップ2311において、閾値書換部2201は、ステップ2309で取得した閾値と、境界画素最小閾値(MinTHadj)とが同じであるかどうかを判定する。両者が同じ値である場合は、ステップ2312に進む。一方、両者が同じ値でない場合は、ステップ2313に進む。 In step 2311, the threshold rewriting unit 2201 determines whether or not the threshold acquired in step 2309 and the boundary pixel minimum threshold (MinTH adj ) are the same. If both are the same value, the process proceeds to step 2312. On the other hand, if they are not the same value, the process proceeds to step 2313.

ステップ2312において、閾値書換部2201は、ステップ2309で取得した閾値を全画素最小閾値で置換する。すなわち、注目画素に対応する閾値として、全画素最小閾値(MinTHall)の値が設定されることになる。 In step 2312, the threshold rewriting unit 2201 replaces the threshold acquired in step 2309 with the all pixel minimum threshold. That is, the value of the all pixel minimum threshold (MinTH all ) is set as the threshold corresponding to the target pixel.

ステップ2313において、閾値書換部2201は、ステップ2309で取得した閾値と、全画素最小閾値(MinTHall)とが同じであるかどうかを判定する。両者が同じ値である場合は、ステップ2314に進む。一方、両者が同じ値でない場合は、ステップ2315に進む。 In step 2313, the threshold rewriting unit 2201 determines whether or not the threshold acquired in step 2309 is the same as the all pixel minimum threshold (MinTH all ). If both are the same value, the process proceeds to step 2314. On the other hand, if they are not the same value, the process proceeds to step 2315.

ステップ2314において、閾値書換部2201は、ステップ2309で取得した閾値を境界画素最小閾値で置換する。すなわち、注目画素に対応する閾値として、境界画素最小閾値(MinTHadj)の値が設定されることになる。 In step 2314, the threshold rewriting unit 2201 replaces the threshold acquired in step 2309 with the boundary pixel minimum threshold. That is, the value of the boundary pixel minimum threshold (MinTH adj ) is set as the threshold corresponding to the target pixel.

ステップ2315では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。未処理の画素がある場合は、ステップ2309に戻り、次の画素を注目画素としてステップ2309〜ステップ2314の処理を繰り返す。一方、すべての画素に対して処理が終了していた場合は、本処理を終える。   In step 2315, it is determined whether or not processing has been completed for all pixels in the predetermined area. If there is an unprocessed pixel, the process returns to step 2309, and the processing of step 2309 to step 2314 is repeated with the next pixel as the target pixel. On the other hand, if the processing has been completed for all the pixels, the present processing ends.

以上が、本実施例に係る画像処理装置で実行される処理のうち、全画素最小閾値抽出処理、境界画素最小閾値抽出処理、及び閾値書換処理の内容である。   The above is the contents of the all pixel minimum threshold extraction process, the boundary pixel minimum threshold extraction process, and the threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment.

本実施例によれば、量子化後の結果が必要以上に濃くなることを防ぎつつ、境界画素の細線の再現性向上及び、エッジ強調の効果を得ることができる。   According to the present embodiment, it is possible to improve the reproducibility of the fine line of the boundary pixel and obtain the effect of edge enhancement while preventing the result after quantization from becoming darker than necessary.

<変形例1>
また、回路構成を簡略化するため、白画素位置の閾値が所定領域内最小閾値の場合に、境界画素最小閾値と交換するようにしてもよい。白画素位置の閾値はいかなる値であってもドットは生成されないので、交換しても不自然な濃度変動等の問題は起きない。
<Modification 1>
In order to simplify the circuit configuration, when the threshold value of the white pixel position is the minimum threshold value within the predetermined area, the threshold value may be replaced with the minimum threshold value of the boundary pixel. Since dots are not generated regardless of the threshold value of the white pixel position, problems such as unnatural density fluctuations do not occur even if they are replaced.

次に、白画素における最小閾値、境界画素における最小閾値、残領域における最小閾値を抽出し、「境界画素最小閾値」<「残領域最小閾値」<「白画素最小閾値」の大小関係となるように閾値を並び換える態様について、実施例13として説明する。なお、実施例10と共通する部分については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   Next, the minimum threshold value in the white pixel, the minimum threshold value in the boundary pixel, and the minimum threshold value in the remaining area are extracted, and the magnitude relationship of “boundary pixel minimum threshold” <“remaining area minimum threshold” <“white pixel minimum threshold” is satisfied. An embodiment in which the threshold values are rearranged will be described as a thirteenth embodiment. In addition, about the part which is common in Example 10, description is abbreviate | omitted or simplified, and it shall demonstrate centering on difference below.

図24は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部1701、白画素判定部102、境界画素判定部1702、白画素最小閾値抽出部103、境界画素最小閾値抽出部1703、量子化部106は、実施例10と同じであるので説明を省略する。   FIG. 24 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold acquisition unit 1701, the white pixel determination unit 102, the boundary pixel determination unit 1702, the white pixel minimum threshold extraction unit 103, the boundary pixel minimum threshold extraction unit 1703, and the quantization unit 106 are the same as those in the tenth embodiment. Description is omitted.

残領域最小閾値抽出部2401は、白画素情報と境界画素情報を用いて、白画素及び境界画素を除いたその他の画素領域における閾値の中から最小の閾値(以下、残領域最小閾値)を抽出する。   The remaining area minimum threshold value extraction unit 2401 extracts the minimum threshold value (hereinafter referred to as the remaining area minimum threshold value) from the threshold values in other pixel areas excluding the white pixel and the boundary pixel, using the white pixel information and the boundary pixel information. To do.

閾値書換部2402は、残領域最小閾値抽出部2401で抽出した残領域最小閾値、白画素最小閾値抽出部103で抽出した白画素最小閾値、境界画素最小閾値抽出部1703で抽出した境界画素最小閾値を参照して閾値を書き換える。すなわち、「境界画素最小閾値」<「残領域最小閾値」<「白画素最小閾値」の大小関係となるように閾値マトリクスの閾値を並び換える。   The threshold rewriting unit 2402 includes a remaining region minimum threshold extracted by the remaining region minimum threshold extracting unit 2401, a white pixel minimum threshold extracted by the white pixel minimum threshold extracting unit 103, and a boundary pixel minimum threshold extracted by the boundary pixel minimum threshold extracting unit 1703. The threshold value is rewritten with reference to. In other words, the threshold matrix thresholds are rearranged so as to satisfy the relationship of “boundary pixel minimum threshold” <“remaining region minimum threshold” <“white pixel minimum threshold”.

なお、画素値/閾値取得部1701の機能自体は実施例10と同じであるが、本実施例の場合、画素値/閾値取得部1701で取得された閾値が、残領域最小閾値抽出部2401にも送られる点で、実施例10とは異なっている。   The function of the pixel value / threshold acquisition unit 1701 is the same as that of the tenth embodiment, but in the present embodiment, the threshold acquired by the pixel value / threshold acquisition unit 1701 is stored in the remaining region minimum threshold extraction unit 2401. Is also different from the tenth embodiment in that it is also sent.

図25は、本実施例に係る画像処理装置で実行される処理のうち、白画素最小閾値抽出処理、境界画素最小閾値抽出処理、残領域最小閾値抽出処理、及び閾値書換処理についての詳細を示すフローチャートである。   FIG. 25 shows details of the white pixel minimum threshold extraction process, the boundary pixel minimum threshold extraction process, the remaining area minimum threshold extraction process, and the threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment. It is a flowchart.

ステップ2501において、残領域最小閾値抽出部2401は、所定領域内の残領域(白画素及び境界画素を除いたその他の画素領域)における最小閾値を保持する変数である残領域最小閾値(MinTHrem)を初期化する。同様に、白画素最小閾値抽出部103は、白画素位置の最小閾値を保持する変数である白画素最小閾値(MinTHoff)を初期化する。さらに、境界画素最小閾値抽出部1703は、境界画素位置の最小閾値を保持する変数である境界画素最小閾値(MinTHadj)を初期化する。具体的には、MinTHrem、MinTHoff及びMinTHadjの値に、スクリーン処理における閾値の最大値(又は入力画素値のレンジの最大値)をそれぞれセットする。なお、これら変数はRAMにて保持される。 In step 2501, the remaining area minimum threshold value extraction unit 2401 has a remaining area minimum threshold value (MinTH rem ) that is a variable that holds a minimum threshold value in the remaining area (other pixel areas excluding white pixels and boundary pixels) in the predetermined area. Is initialized. Similarly, the white pixel minimum threshold value extraction unit 103 initializes a white pixel minimum threshold value (MinTH off ) that is a variable that holds the minimum threshold value of the white pixel position. Further, the boundary pixel minimum threshold value extraction unit 1703 initializes a boundary pixel minimum threshold value (MinTH adj ), which is a variable that holds the minimum threshold value of the boundary pixel position. Specifically, the maximum threshold value in screen processing (or the maximum value of the range of input pixel values) is set as the value of MinTH rem , MinTH off and MinTH adj . These variables are held in the RAM.

ステップ2502において、残領域最小閾値抽出部2401は、所定領域内の注目画素についての白画素情報、及び注目画素に対応する閾値を取得する。また、白画素最小閾値抽出部103は、所定領域内の注目画素についての白画素情報、及び注目画素に対応する閾値を取得する。また、境界画素最小閾値抽出部1703は、所定領域内の注目画素についての境界画素情報、及び注目画素に対応する閾値を取得する。   In step 2502, the remaining region minimum threshold value extraction unit 2401 acquires white pixel information about the target pixel in the predetermined region and a threshold value corresponding to the target pixel. Further, the white pixel minimum threshold value extraction unit 103 acquires white pixel information about the target pixel in the predetermined area and a threshold value corresponding to the target pixel. Further, the boundary pixel minimum threshold value extraction unit 1703 acquires boundary pixel information regarding the target pixel in the predetermined region and a threshold value corresponding to the target pixel.

ステップ2503において、白画素最小閾値抽出部103は、ステップ2502で取得した白画素情報に基づいて、注目画素が白画素であるかどうかを判定する。判定の結果、白画素である場合は、ステップ2504に進む。一方、白画素でない場合(非白画素である場合)は、ステップ2506に進む。   In step 2503, the white pixel minimum threshold value extraction unit 103 determines whether or not the target pixel is a white pixel based on the white pixel information acquired in step 2502. If it is determined that the pixel is a white pixel, the process proceeds to step 2504. On the other hand, when it is not a white pixel (when it is a non-white pixel), the process proceeds to Step 2506.

ステップ2504において、白画素最小閾値抽出部103は、現時点の白画素最小閾値(MinTHoff)とステップ2502で取得した注目画素の閾値とを比較する。比較の結果、MinTHoffの値が注目画素の閾値より大きい場合は、ステップ2505に進む。一方、MinTHoffの値が処理対象画素の閾値より大きくない場合は、ステップ2511に進む。 In step 2504, the white pixel minimum threshold value extraction unit 103 compares the current white pixel minimum threshold value (MinTH off ) with the threshold value of the target pixel acquired in step 2502. As a result of the comparison, if the value of MinTH off is larger than the threshold value of the target pixel, the process proceeds to step 2505. On the other hand, if the value of MinTH off is not larger than the threshold value of the processing target pixel, the process proceeds to step 2511.

ステップ2505において、白画素最小閾値抽出部103は、MinTHoffの値を、ステップ2502で取得した閾値に更新する。 In step 2505, the white pixel minimum threshold value extraction unit 103 updates the value of MinTH off to the threshold value acquired in step 2502.

ステップ2506において、境界画素最小閾値抽出部1703は、ステップ2502で取得した境界画素情報に基づいて、注目画素が境界画素であるかどうかを判定する。判定の結果、境界画素である場合は、ステップ2507に進む。一方、境界画素でない場合(白画素と隣接していない非白画素である場合)は、ステップ2509に進む。   In step 2506, the boundary pixel minimum threshold value extraction unit 1703 determines whether the target pixel is a boundary pixel based on the boundary pixel information acquired in step 2502. If it is determined that the pixel is a boundary pixel, the process proceeds to step 2507. On the other hand, if it is not a boundary pixel (if it is a non-white pixel that is not adjacent to a white pixel), the process proceeds to step 2509.

ステップ2507において、境界画素最小閾値抽出部1703は、現時点の境界画素最小閾値(MinTHadj)とステップ2502で取得した注目画素の閾値とを比較する。比較の結果、MinTHadjの値が注目画素の閾値より大きい場合は、ステップ2508に進む。一方、MinTHadjの値が注目画素の閾値より大きくない場合は、ステップ2511に進む。 In step 2507, the boundary pixel minimum threshold value extraction unit 1703 compares the current boundary pixel minimum threshold value (MinTH adj ) with the threshold value of the target pixel acquired in step 2502. As a result of the comparison, if the value of MinTH adj is larger than the threshold value of the target pixel, the process proceeds to step 2508. On the other hand, if the value of MinTH adj is not larger than the threshold value of the target pixel, the process proceeds to step 2511.

ステップ2508において、境界画素最小閾値抽出部1703は、MinTHadjの値を、ステップ2502で取得した閾値に更新する。 In step 2508, the boundary pixel minimum threshold value extraction unit 1703 updates the value of MinTH adj to the threshold value acquired in step 2502.

ステップ2509において、残領域最小閾値抽出部2401は、現時点の残領域最小閾値(MinTHrem)とステップ2502で取得した注目画素の閾値とを比較する。比較の結果、MinTHremの値が注目画素の閾値より大きい場合は、ステップ2510に進む。一方、MinTHremの値が注目画素の閾値より大きくない場合は、ステップ2511に進む。 In step 2509, the remaining region minimum threshold value extraction unit 2401 compares the current remaining region minimum threshold value (MinTH rem ) with the threshold value of the target pixel acquired in step 2502. As a result of the comparison, if the value of MinTH rem is larger than the threshold value of the target pixel, the process proceeds to step 2510. On the other hand, if the value of MinTH rem is not larger than the threshold value of the target pixel, the process proceeds to step 2511.

ステップ2510において、残領域最小閾値抽出部2401は、MinTHremの値を、ステップ2502で取得した閾値に更新する。 In step 2510, the remaining region minimum threshold value extraction unit 2401 updates the value of MinTH rem to the threshold value acquired in step 2502.

ステップ2511では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ2512に進む。ステップ2512に進んだ時点で、所定領域内の残領域における最小閾値がMinTHremとして、所定領域内の白画素位置における最小閾値がMinTHoffとして、境界画素位置における最小閾値がMinTHadjとしてそれぞれ保持されていることになる。一方、所定領域内に未処理の画素があればステップ2502に戻り、次の画素を注目画素としてステップ2502〜ステップ2510の各処理を行なう。 In step 2511, it is determined whether or not the processing has been completed for all the pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 2512. When the processing proceeds to step 2512, the minimum threshold value in the remaining area in the predetermined area is held as MinTH rem , the minimum threshold value in the white pixel position in the predetermined area is set to MinTH off , and the minimum threshold value in the boundary pixel position is held as MinTH adj. Will be. On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to step 2502, and each process of step 2502 to step 2510 is performed with the next pixel as a target pixel.

ステップ2512において、閾値書換部2402は、所定領域内の注目画素に対応する閾値を取得する。   In step 2512, the threshold rewriting unit 2402 obtains a threshold corresponding to the target pixel in the predetermined area.

ステップ2513において、閾値書換部2402は、ステップ2512で取得した閾値が、境界画素最小閾値(MinTHadj)或いは残領域最小閾値(MinTHrem)と同じであるかどうかを判定する。取得した閾値が、MinTHadj及びMinTHremのいずれかと同じ値である場合は、ステップ2514に進む。一方、取得した閾値が、MinTHadj及びMinTHremのいずれとも異なる値である場合は、ステップ2515に進む。 In step 2513, the threshold value rewriting unit 2402 determines whether or not the threshold value acquired in step 2512 is the same as the boundary pixel minimum threshold value (MinTH adj ) or the remaining area minimum threshold value (MinTH rem ). If the acquired threshold value is the same value as either MinTH adj or MinTH rem , the process proceeds to step 2514. On the other hand, if the acquired threshold value is different from both MinTH adj and MinTH rem , the process proceeds to step 2515.

ステップ2514において、閾値書換部2402は、白画素最小閾値、境界画素最小閾値、残領域最小閾値を比較し、閾値を並び換える処理を行なう。但し、ここでは簡略化のため白画素最小閾値については変更しないものとし、以下の条件に従って、閾値の並び替えを行なうものとする。   In step 2514, the threshold value rewriting unit 2402 compares the white pixel minimum threshold value, the boundary pixel minimum threshold value, and the remaining area minimum threshold value, and performs a process of rearranging the threshold values. However, for simplification, the white pixel minimum threshold value is not changed here, and the threshold value is rearranged according to the following conditions.

1)「境界画素最小閾値」<「残領域最小閾値」<「白画素最小閾値」の時は、注目画素の閾値はそのまま
2)「境界画素最小閾値」<「白画素最小閾値」<「残領域最小閾値」の時であって、
・注目画素の閾値が境界画素最小閾値と同じ場合は、注目画素の閾値はそのまま
・注目画素の閾値が残領域最小閾値と同じ場合は、注目画素の閾値を白画素最小閾値で置換
3)「残領域最小閾値」<「境界画素最小閾値」<「白画素最小閾値」の時であって、
・注目画素の閾値が境界画素最小閾値と同じ場合は、注目画素の閾値を残領域最小閾値で置換
・注目画素の閾値が残領域最小閾値と同じ場合は、注目画素の閾値を境界画素最小閾値で置換
4)「残領域最小閾値」<「白画素最小閾値」<「境界画素最小閾値」の時であって、
・注目画素の閾値が境界画素最小閾値と同じ場合は、注目画素の閾値を残領域最小閾値で置換
・注目画素の閾値が残領域最小閾値と同じ場合は、注目画素の閾値を白画素最小閾値で置換
5)「白画素最小閾値」<「境界画素最小閾値」<「残領域最小閾値」の時であって、
・注目画素の閾値が境界画素最小閾値と同じ場合は、注目画素の閾値を白画素最小閾値で置換
・注目画素の閾値が残領域最小閾値と同じ場合は、注目画素の閾値を境界画素最小閾値で置換
6)「白画素最小閾値」<「残領域最小閾値」<「境界画素最小閾値」の時であって、
・注目画素の閾値が境界画素最小閾値と同じ場合は、注目画素の閾値を白画素最小閾値で置換
・注目画素の閾値が残領域最小閾値と同じ場合は、注目画素の閾値はそのまま
図26は、上記条件に従った閾値の並び換えの流れをフローチャートで表現したものである。
1) When “boundary pixel minimum threshold” <“remaining region minimum threshold” <“white pixel minimum threshold”, the threshold value of the target pixel remains as it is 2) “boundary pixel minimum threshold” <“white pixel minimum threshold” <“remaining When the `` region minimum threshold '',
・ When the threshold value of the target pixel is the same as the minimum threshold value of the boundary pixel, the threshold value of the target pixel remains unchanged. ・ When the threshold value of the target pixel is the same as the minimum threshold value of the remaining area, the threshold value of the target pixel is replaced with the minimum threshold value of the white pixel.
3) When “remaining region minimum threshold” <“boundary pixel minimum threshold” <“white pixel minimum threshold”,
-If the threshold value of the target pixel is the same as the minimum threshold value of the boundary pixel, replace the threshold value of the target pixel with the minimum threshold value of the remaining region.-If the threshold value of the target pixel is the same as the minimum threshold value of the residual region, 4) When “remaining area minimum threshold” <“white pixel minimum threshold” <“boundary pixel minimum threshold”,
-If the threshold value of the target pixel is the same as the minimum threshold value of the boundary pixel, replace the threshold value of the target pixel with the minimum threshold value of the remaining region.-If the threshold value of the target pixel is the same as the minimum threshold value of the remaining region, 5) When “white pixel minimum threshold” <“boundary pixel minimum threshold” <“remaining region minimum threshold”,
-If the threshold value of the target pixel is the same as the minimum threshold value of the boundary pixel, replace the threshold value of the target pixel with the minimum threshold value of the white pixel.-If the threshold value of the target pixel is the same as the minimum threshold value of the remaining area, 6) When “white pixel minimum threshold” <“remaining region minimum threshold” <“boundary pixel minimum threshold”,
When the threshold value of the target pixel is the same as the minimum threshold value of the boundary pixel, the threshold value of the target pixel is replaced with the minimum threshold value of the white pixel. When the threshold value of the target pixel is the same as the minimum threshold value of the remaining area, the threshold value of the target pixel remains unchanged. The flow of rearrangement of threshold values according to the above conditions is represented by a flowchart.

ステップ2601において、閾値書換部2402は、境界画素最小閾値(MinTHadj)が、残領域最小閾値(MinTHrem)よりも小さいかどうかを判定する。MinTHadjの値が、MinTHremの値よりも小さい場合は、ステップ2602に進む。一方、MinTHadjの値が、MinTHremの値よりも小さくない場合は、ステップ2610に進む。 In step 2601, the threshold rewriting unit 2402 determines whether the boundary pixel minimum threshold (MinTH adj ) is smaller than the remaining area minimum threshold (MinTH rem ). If the value of MinTH adj is smaller than the value of MinTH rem , the process proceeds to step 2602. On the other hand, if the value of MinTH adj is not smaller than the value of MinTH rem , the process proceeds to step 2610.

ステップ2602において、閾値書換部2402は、残領域最小閾値(MinTHrem)が、白画素最小閾値(MinTHoff)よりも小さいかどうかを判定する。MinTHremの値がMinTHoffの値よりも小さい場合は、閾値の置換処理をすることなく、本処理を抜ける。一方、MinTHremの値がMinTHoffの値よりも小さくない場合は、ステップ2603に進む。 In step 2602, the threshold rewriting unit 2402 determines whether the remaining area minimum threshold (MinTH rem ) is smaller than the white pixel minimum threshold (MinTH off ). When the value of MinTH rem is smaller than the value of MinTH off , this process is exited without performing the threshold value replacement process. On the other hand, if the value of MinTH rem is not smaller than the value of MinTH off , the process proceeds to step 2603.

ステップ2603において、閾値書換部2402は、境界画素最小閾値(MinTHadj)が、白画素最小閾値(MinTHoff)よりも小さいかどうかを判定する。MinTHadjの値が、MinTHoffの値よりも小さい場合は、ステップ2604に進む。一方、MinTHadjの値が、MinTHoffの値よりも小さくない場合は、ステップ2606に進む。 In step 2603, the threshold rewriting unit 2402 determines whether or not the boundary pixel minimum threshold (MinTH adj ) is smaller than the white pixel minimum threshold (MinTH off ). If the value of MinTH adj is smaller than the value of MinTH off , the process proceeds to step 2604. On the other hand, if the value of MinTH adj is not smaller than the value of MinTH off , the process proceeds to step 2606.

ステップ2604において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、残領域最小閾値(MinTHrem)と同じであるかどうかを判定する。注目画素の閾値が、MinTHremの値と同じである場合は、ステップ2605に進む。一方、注目画素の閾値が、MinTHremの値と同じでない場合は、閾値の置換処理をすることなく、本処理を抜ける。 In step 2604, the threshold rewriting unit 2402 determines whether the threshold value of the target pixel acquired in step 2512 is the same as the remaining area minimum threshold value (MinTH rem ). If the threshold value of the target pixel is the same as the value of MinTH rem , the process proceeds to step 2605. On the other hand, when the threshold value of the pixel of interest is not the same as the MinTH rem value, the process exits without performing the threshold value replacement process.

ステップ2605において、閾値書換部2402は、注目画素の閾値を、白画素最小閾値(MinTHoff)の値で置換する。 In step 2605, the threshold value rewriting unit 2402 replaces the threshold value of the target pixel with the value of the white pixel minimum threshold value (MinTH off ).

ステップ2606において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、境界画素最小閾値(MinTHadj)と同じであるかどうかを判定する。注目画素の閾値が、MinTHadjの値と同じである場合は、ステップ2607に進む。一方、注目画素の閾値が、MinTHadjの値と同じでない場合は、ステップ2608に進む。
ステップ2607において、閾値書換部2402は、注目画素の閾値を、白画素最小閾値(MinTHoff)の値で置換する。
In step 2606, the threshold value rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the boundary pixel minimum threshold value (MinTH adj ). If the threshold value of the target pixel is the same as the value of MinTH adj , the process proceeds to step 2607. On the other hand, if the threshold value of the target pixel is not the same as the value of MinTH adj , the process proceeds to step 2608.
In step 2607, the threshold value rewriting unit 2402 replaces the threshold value of the target pixel with the value of the white pixel minimum threshold value (MinTH off ).

ステップ2608において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、残領域最小閾値(MinTHrem)と同じであるかどうかを判定する。注目画素の閾値が、MinTHremの値と同じである場合は、ステップ2609に進む。一方、注目画素の閾値が、MinTHremの値と同じでない場合は、閾値の置換処理をすることなく、本処理を抜ける。 In step 2608, the threshold rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the remaining region minimum threshold value (MinTH rem ). If the threshold value of the target pixel is the same as the value of MinTH rem , the process proceeds to step 2609. On the other hand, when the threshold value of the pixel of interest is not the same as the MinTH rem value, the process exits without performing the threshold value replacement process.

ステップ2609において、閾値書換部2402は、注目画素の閾値を、境界画素最小閾値(MinTHadj)の値で置換する。 In step 2609, the threshold value rewriting unit 2402 replaces the threshold value of the target pixel with the value of the boundary pixel minimum threshold value (MinTH adj ).

ステップ2610において、閾値書換部2402は、残領域最小閾値(MinTHrem)が、白画素最小閾値(MinTHoff)よりも小さいかどうかを判定する。MinTHremの値がMinTHoffの値よりも小さい場合は、ステップ2611に進む。一方、MinTHremの値がMinTHoffの値よりも小さくない場合は、ステップ2620に進む。 In step 2610, the threshold value rewriting unit 2402 determines whether or not the remaining area minimum threshold value (MinTH rem ) is smaller than the white pixel minimum threshold value (MinTH off ). If the value of MinTH rem is smaller than the value of MinTH off , the process proceeds to step 2611. On the other hand, if the value of MinTH rem is not smaller than the value of MinTH off , the process proceeds to step 2620.

ステップ2611において、閾値書換部2402は、境界画素最小閾値(MinTHadj)が、白画素最小閾値(MinTHoff)よりも小さいかどうかを判定する。MinTHadjの値がMinTHoffの値よりも小さい場合は、ステップ2612に進む。一方、MinTHadjの値がMinTHoffの値よりも小さくない場合は、ステップ2616に進む。 In step 2611, the threshold value rewriting unit 2402 determines whether the boundary pixel minimum threshold value (MinTH adj ) is smaller than the white pixel minimum threshold value (MinTH off ). If the value of MinTH adj is smaller than the value of MinTH off , the process proceeds to step 2612. On the other hand, if the value of MinTH adj is not smaller than the value of MinTH off , the process proceeds to step 2616.

ステップ2612において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、境界画素最小閾値(MinTHadj)と同じであるかどうかを判定する。注目画素の閾値が、MinTHadjの値と同じである場合は、ステップ2613に進む。一方、注目画素の閾値が、MinTHadjの値と同じでない場合は、ステップ2614に進む。 In step 2612, the threshold value rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the boundary pixel minimum threshold value (MinTH adj ). If the threshold value of the target pixel is the same as the value of MinTH adj , the process proceeds to step 2613. On the other hand, if the threshold value of the target pixel is not the same as the MinTH adj value, the process proceeds to step 2614.

ステップ2613において、閾値書換部2402は、注目画素の閾値を、残領域最小閾値(MinTHrem)の値で置換する。 In step 2613, the threshold value rewriting unit 2402 replaces the threshold value of the target pixel with the value of the remaining region minimum threshold value (MinTH rem ).

ステップ2614において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、残領域最小閾値(MinTHrem)と同じであるかどうかを判定する。注目画素の閾値が、MinTHremの値と同じである場合は、ステップ2615に進む。一方、注目画素の閾値が、MinTHremの値と同じでない場合は、閾値の置換処理をすることなく、本処理を抜ける。 In step 2614, the threshold rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the remaining region minimum threshold value (MinTH rem ). If the threshold value of the target pixel is the same as the value of MinTH rem , the process proceeds to step 2615. On the other hand, when the threshold value of the pixel of interest is not the same as the MinTH rem value, the process exits without performing the threshold value replacement process.

ステップ2615において、閾値書換部2402は、注目画素の閾値を、境界画素最小閾値(MinTHadj)の値で置換する。 In step 2615, the threshold value rewriting unit 2402 replaces the threshold value of the target pixel with the value of the boundary pixel minimum threshold value (MinTH adj ).

ステップ2616において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、境界画素最小閾値(MinTHadj)と同じであるかどうかを判定する。注目画素の閾値が、MinTHadjの値と同じである場合は、ステップ2617に進む。一方、注目画素の閾値が、MinTHadjの値と同じでない場合は、ステップ2618に進む。 In step 2616, the threshold value rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the boundary pixel minimum threshold value (MinTH adj ). If the threshold value of the target pixel is the same as the MinTH adj value, the process proceeds to step 2617. On the other hand, if the threshold value of the target pixel is not the same as the MinTH adj value, the process proceeds to step 2618.

ステップ2617において、閾値書換部2402は、注目画素の閾値を、残領域最小閾値(MinTHrem)の値で置換する。 In step 2617, the threshold value rewriting unit 2402 replaces the threshold value of the target pixel with the value of the remaining region minimum threshold value (MinTH rem ).

ステップ2618において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、残領域最小閾値(MinTHrem)と同じであるかどうかを判定する。注目画素の閾値が、MinTHremの値と同じである場合は、ステップ2619に進む。一方、注目画素の閾値が、MinTHremの値と同じでない場合は、閾値の置換処理をすることなく、本処理を抜ける。 In step 2618, the threshold value rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the remaining region minimum threshold value (MinTH rem ). If the threshold value of the target pixel is the same as the MinTH rem value, the process proceeds to step 2619. On the other hand, when the threshold value of the pixel of interest is not the same as the MinTH rem value, the process exits without performing the threshold value replacement process.

ステップ2619において、閾値書換部2402は、注目画素の閾値を、白画素最小閾値(MinTHoff)の値で置換する。 In step 2619, the threshold rewriting unit 2402 replaces the threshold value of the target pixel with the value of the white pixel minimum threshold value (MinTH off ).

ステップ2620において、閾値書換部2402は、ステップ2512で取得した注目画素の閾値が、境界画素最小閾値(MinTHadj)と同じであるかどうかを判定する。注目画素の閾値が、MinTHadjの値と同じである場合は、ステップ2621に進む。一方、注目画素の閾値が、MinTHadjの値と同じでない場合は、閾値の置換処理をすることなく、本処理を抜ける。 In step 2620, the threshold rewriting unit 2402 determines whether or not the threshold value of the target pixel acquired in step 2512 is the same as the boundary pixel minimum threshold value (MinTH adj ). If the threshold value of the target pixel is the same as the value of MinTH adj , the process proceeds to step 2621. On the other hand, if the threshold value of the pixel of interest is not the same as the MinTH adj value, the process exits without performing the threshold value replacement process.

ステップ2621において、閾値書換部2402は、注目画素の閾値を、白画素最小閾値(MinTHoff)の値で置換する。 In step 2621, the threshold rewriting unit 2402 replaces the threshold value of the target pixel with the value of the white pixel minimum threshold value (MinTH off ).

以上が、本実施例における閾値並び替え処理の内容である。   The above is the content of the threshold rearrangement process in the present embodiment.

図25のフローチャートの説明に戻る。   Returning to the flowchart of FIG.

ステップ2515では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。未処理の画素がある場合は、ステップ2512に戻り、次の画素を注目画素としてステップ2512〜ステップ2514の処理を繰り返す。一方、すべての画素に対して処理が終了していた場合は、本処理を終える。   In step 2515, it is determined whether or not processing has been completed for all pixels in the predetermined area. If there is an unprocessed pixel, the process returns to step 2512 to repeat the processing from step 2512 to step 2514 with the next pixel as the target pixel. On the other hand, if the processing has been completed for all the pixels, the present processing ends.

以上が、本実施例に係る画像処理装置で実行される処理のうち、残領域最小閾値抽出処理、白画素最小閾値抽出処理、境界画素最小閾値抽出処理、及び閾値置換処理の内容である。   The above is the contents of the remaining area minimum threshold extraction process, the white pixel minimum threshold extraction process, the boundary pixel minimum threshold extraction process, and the threshold replacement process among the processes executed by the image processing apparatus according to the present embodiment.

本実施例によれば、境界画素から順にドットが生成されるようになり、境界画素領域の鮮鋭性が向上する。   According to the present embodiment, dots are generated in order from the boundary pixel, and the sharpness of the boundary pixel region is improved.

これまでに述べた各実施例では、スクリーン処理の閾値の繰り返し単位である、閾値マトリクスのサイズよりも所定領域のサイズが小さいことを前提として説明を行なった。しかし、例えば、図27に示すように、太枠で示す所定領域2701(4x4の所定領域)に対して、細枠で示す閾値マトリクス2702(閾値a〜iを有する3x3の閾値マトリクス)が小さい場合、所定領域2701内にc〜gの閾値が複数存在することになる。この場合、これまでに説明してきた各実施例では、閾値の書換が複数回行われることになり、量子化後の結果が濃くなり過ぎてしまうという問題が起こり得る。   In each of the embodiments described so far, the description has been made on the assumption that the size of the predetermined area is smaller than the size of the threshold matrix, which is a unit for repeating the threshold of the screen processing. However, for example, as shown in FIG. 27, when a threshold matrix 2702 (3 × 3 threshold matrix having thresholds a to i) indicated by a thin frame is smaller than a predetermined area 2701 (4 × 4 predetermined area) indicated by a thick frame. In this case, a plurality of threshold values c to g exist in the predetermined area 2701. In this case, in each of the embodiments described so far, the threshold value is rewritten a plurality of times, which may cause a problem that the result after quantization becomes too dark.

そこで、例えば、前述の実施例10の場合であれば、閾値書換部1704で、閾値の書換を行ったかどうかを示すフラグを、所定領域内の各閾値に設定するようにする。そして、所定領域の処理の先頭でフラグをリセットし、1回目の書換を行ったときにフラグを立てて(例えば、フラグ値として「1」を設定して)、以降の処理ではフラグが立っている場合に書換を禁止するようにすればよい。   Therefore, for example, in the case of the above-described tenth embodiment, the threshold rewriting unit 1704 sets a flag indicating whether or not the threshold has been rewritten to each threshold in the predetermined area. Then, the flag is reset at the beginning of the processing in the predetermined area, and the flag is set when the first rewriting is performed (for example, “1” is set as the flag value), and the flag is set in the subsequent processing. If it is, rewriting should be prohibited.

同様に、例えば、前述の実施例12の場合であれば、閾値書換部2201で、境界画素最小閾値を全画素最小閾値に書き換えたかどうか、全画素最小閾値を境界画素最小閾値に書き換えたかどうかを示すフラグを、所定領域内の各閾値にそれぞれ設定するようにする。そして、所定領域の処理の先頭でフラグをリセットし、1回目の置換を行ったときにフラグを立てて(例えば、フラグ値として「1」を設定して)、以降の処理ではフラグが立っている場合に置換を禁止するようにすればよい。   Similarly, for example, in the case of the above-described embodiment 12, the threshold value rewriting unit 2201 determines whether the boundary pixel minimum threshold value has been rewritten to the all pixel minimum threshold value, and whether all pixel minimum threshold values have been rewritten to the boundary pixel minimum threshold value. The flag shown is set for each threshold in the predetermined area. Then, the flag is reset at the beginning of the processing of the predetermined area, and the flag is set when the first replacement is performed (for example, “1” is set as the flag value), and the flag is set in the subsequent processing. In such a case, the replacement may be prohibited.

同様に、例えば、前述の実施例13の場合であれば、閾値書換部2402で、境界画素最小閾値、残領域最小閾値、白画素最小閾値の書換を行ったかどうかを示すフラグを、所定領域内の各閾値に設定するようにする。そして、所定領域の処理の先頭でフラグをリセットし、1回目の書換を行ったときにフラグを立てて(例えば、フラグ値として「1」を設定して)、以降の処理ではフラグが立っている場合に書換を禁止するようにすればよい。   Similarly, for example, in the case of the above-described thirteenth embodiment, a flag indicating whether or not the threshold pixel rewriting unit 2402 has rewritten the boundary pixel minimum threshold value, the remaining area minimum threshold value, and the white pixel minimum threshold value is set in a predetermined area. Each threshold value is set. Then, the flag is reset at the beginning of the processing in the predetermined area, and the flag is set when the first rewriting is performed (for example, “1” is set as the flag value), and the flag is set in the subsequent processing. If it is, rewriting should be prohibited.

以上のような処理を行なうことにより、同一閾値に対する書換が所定領域内で複数回起こらないようにして、量子化後の結果が濃くなり過ぎることを防止できる。   By performing the processing as described above, it is possible to prevent the result after quantization from becoming too dark by preventing rewriting to the same threshold value from occurring a plurality of times within a predetermined region.

前述したように、入力画像データにおける階調変化が少ない平坦部では、均等な間隔で同一形状の網点を形成する方が良好な画像が得られる。そして、実施例1では、所定領域内の白画素の最小閾値が、ドットが形成される確率が高い閾値であった場合に、非白画素の最小閾値を、白画素の最小閾値と同じ値に書き換えている。その結果、所定領域毎に形成されるドット数が変化する可能性があるが、実施例1では、所定領域内に白画素がなければ閾値書換が発生しないため、白画素を含まない平坦部に関してはドット数が変化することなく、均等な間隔で同一形状の網点を形成することができる。   As described above, in the flat portion where the gradation change in the input image data is small, a better image can be obtained by forming halftone dots having the same shape at equal intervals. In the first embodiment, when the minimum threshold value of the white pixel in the predetermined area is a threshold value with a high probability of forming dots, the minimum threshold value of the non-white pixel is set to the same value as the minimum threshold value of the white pixel. Rewriting. As a result, there is a possibility that the number of dots formed for each predetermined area may change. In Example 1, however, threshold rewriting does not occur unless there is a white pixel in the predetermined area. Can form halftone dots of the same shape at equal intervals without changing the number of dots.

しかしながら、たとえ階調変化が少ない平坦部(例えば雲のような自然画)であっても、所定領域内に白画素が存在する場合、所定領域毎に形成されるドットが1ドット増加する可能性があるため、均等な間隔で同一形状の網点を形成することができない。   However, even in a flat portion (for example, a natural image such as a cloud) with little gradation change, if white pixels exist in a predetermined area, the number of dots formed in each predetermined area may increase by one dot. Therefore, halftone dots having the same shape cannot be formed at equal intervals.

そこで、階調変化が少なく、所定領域内に白画素が存在する入力画像データであっても、良好な画像を得ながら、濃度変動の抑制と細線の再現性向上を実現する態様について、実施例15として説明する。なお、実施例1と共通する部分(変形例も含む)については、説明を省略ないしは簡略化し、以下では差異点を中心に説明するものとする。   Therefore, an embodiment that realizes suppression of density fluctuation and improvement of reproducibility of fine lines while obtaining a good image even in the case of input image data with little gradation change and white pixels existing in a predetermined region. This will be described as 15. In addition, about the part (including a modification) which is common in Example 1, description is abbreviate | omitted or simplified, and it shall be demonstrated centering on difference below.

図28は、本実施例に係る、ハーフトーン処理を実現する画像処理装置の内部構成を示す機能ブロック図である。画素値/閾値取得部101、白画素判定部102、白画素最小閾値抽出部103、非白画素最小閾値抽出部104、量子化部106は、実施例1と同じであるので説明を省略する。   FIG. 28 is a functional block diagram illustrating an internal configuration of an image processing apparatus that realizes halftone processing according to the present embodiment. Since the pixel value / threshold acquisition unit 101, white pixel determination unit 102, white pixel minimum threshold extraction unit 103, non-white pixel minimum threshold extraction unit 104, and quantization unit 106 are the same as those in the first embodiment, description thereof will be omitted.

非白画素画素値判定部2801は、画素値/閾値取得部101から受け取った画素値と白画素判定部102から受け取った白画素情報に基づいて、所定領域内の非白画素の画素値が全て同じ値であるか、異なる値であるかを判定する。判定の結果は、非白画素画素値情報(本実施例では、所定領域内の非白画素の画素値が全て同じ値であった場合に「1」、全て同じ値ではなかった場合に「0」で表される1bitの情報)として、閾値書換部2802に送られる。   Based on the pixel value received from the pixel value / threshold value acquisition unit 101 and the white pixel information received from the white pixel determination unit 102, the non-white pixel value determination unit 2801 determines all the pixel values of the non-white pixels in the predetermined area. It is determined whether the values are the same or different. The result of the determination is non-white pixel pixel value information (in this embodiment, “1” when the pixel values of the non-white pixels in the predetermined area are all the same value, and “0” when the pixel values are not all the same value. Is sent to the threshold value rewriting unit 2802.

閾値書換部2802は、入力画像の所定領域に対応する閾値マトリクスについて、非白画素最小閾値を白画素最小閾値に置き換える処理を、非白画素画素値判定部2801から入力された非白画素画素値情報に基づいて行なう。具体的には、白画素最小閾値と非白画素最小閾値とを比較し、白画素最小閾値の方が小さい値(ドットが形成される確率が高い閾値)であって、所定領域内の非白画素の画素値が全て同じであった場合にのみ、非白画素最小閾値を白画素最小閾値に置き換える。そうすることで、非白画素の画素値が全て同じ値でない所定領域では閾値の書換が起こらず、白画素を含む階調変化が少ない平坦部においても、均等な間隔で同一形状の網点が形成され、良好な画像が得られる。   The threshold rewriting unit 2802 performs processing for replacing the non-white pixel minimum threshold value with the white pixel minimum threshold value for the threshold value matrix corresponding to the predetermined area of the input image, and the non-white pixel pixel value input from the non-white pixel pixel value determination unit 2801 Based on information. Specifically, the white pixel minimum threshold value is compared with the non-white pixel minimum threshold value, and the white pixel minimum threshold value is a smaller value (threshold value with a higher probability of forming dots), Only when the pixel values of all the pixels are the same, the non-white pixel minimum threshold value is replaced with the white pixel minimum threshold value. By doing so, the threshold value is not rewritten in a predetermined area where the pixel values of the non-white pixels are not all the same value, and halftone dots having the same shape are evenly spaced even in a flat portion including a white pixel and having a small gradation change. It is formed and a good image is obtained.

図29は、本実施例に係る画像処理装置で実行される処理のうち、白画素最小閾値抽出処理、非白画素最小閾値抽出処理、非白画素画素値判定処理、及び閾値書換処理についての詳細を示すフローチャートである。なお、この一連の処理は、回路もしくは以下に示す手順を記述したコンピュータ実行可能なプログラムを、ROM等からRAM上に読み込んだ後、CPUによって該プログラムを実行することによって実施される。   FIG. 29 shows details of the white pixel minimum threshold extraction process, the non-white pixel minimum threshold extraction process, the non-white pixel pixel value determination process, and the threshold rewriting process among the processes executed by the image processing apparatus according to the present embodiment. It is a flowchart which shows. This series of processing is carried out by reading a computer-executable program describing a circuit or a procedure shown below from a ROM or the like onto a RAM and then executing the program by the CPU.

ステップ2901において、白画素最小閾値抽出部103は、白画素位置の最小閾値を保持する変数である白画素最小閾値(MinTHoff)を初期化する。同様に、非白画素最小閾値抽出部104は、非白画素位置の最小閾値を保持する変数である非白画素最小閾値(MinTHon)を初期化する。 In step 2901, the white pixel minimum threshold value extraction unit 103 initializes a white pixel minimum threshold value (MinTH off ), which is a variable that holds the minimum threshold value of the white pixel position. Similarly, the non-white pixel minimum threshold extraction unit 104 initializes a non-white pixel minimum threshold (MinTH on ) that is a variable that holds the minimum threshold of the non-white pixel position.

ステップ2902において、非白画素画素値判定部2801は、所定領域の非白画素画素値情報を、非白画素の画素値が全て同じ値であることを示す状態(本実施例では「1」)に初期化する。また、非白画素画素値判定部2801は、所定領域内の非白画素の画素値を保持する変数である非白画素値を、白画素値(本実施例では「0」)に初期化する。   In step 2902, the non-white pixel pixel value determination unit 2801 indicates that the non-white pixel pixel value information of the predetermined area indicates that all the pixel values of the non-white pixels are the same value (“1” in this embodiment). Initialize to. Also, the non-white pixel value determination unit 2801 initializes a non-white pixel value, which is a variable that holds the pixel value of the non-white pixel in the predetermined area, to a white pixel value (“0” in this embodiment). .

ステップ2903において、白画素最小閾値抽出部103及び非白画素最小閾値抽出部104は、所定領域内の注目画素についての白画素情報、及び当該注目画素に対応する閾値を取得する。また、非白画素画素値判定部2801は、所定領域内の注目画素についての白画素情報、及び当該注目画素の画素値を取得する。   In step 2903, the white pixel minimum threshold value extraction unit 103 and the non-white pixel minimum threshold value extraction unit 104 obtain white pixel information about the target pixel in the predetermined region and a threshold value corresponding to the target pixel. In addition, the non-white pixel pixel value determination unit 2801 acquires white pixel information about a target pixel in a predetermined area and a pixel value of the target pixel.

ステップ2904では、ステップ2903で取得した白画素情報に基づいて、注目画素が白画素であるかどうかが判定される。判定の結果、白画素である場合は、ステップ2905に進む。一方、白画素でない場合(非白画素である場合)は、ステップ2907及びステップ2909に進む。なお、ここでは白画素判定部102の判定結果である白画素情報に基づいて注目画素が白画素であるかどうかを判定しているが、注目画素の画素値から直接に白画素であるかどうかを判定してもよい。   In step 2904, it is determined whether the pixel of interest is a white pixel based on the white pixel information acquired in step 2903. If it is determined that the pixel is a white pixel, the process proceeds to step 2905. On the other hand, when it is not a white pixel (when it is a non-white pixel), the process proceeds to Step 2907 and Step 2909. Here, it is determined whether or not the target pixel is a white pixel based on the white pixel information that is the determination result of the white pixel determination unit 102, but whether or not the target pixel is a white pixel directly from the pixel value of the target pixel. May be determined.

ステップ2905において、白画素最小閾値抽出部103は、現時点の白画素最小閾値(MinTHoff)とステップ2903で取得した注目画素の閾値とを比較する。比較の結果、MinTHoffの値が注目画素の閾値より大きい場合は、ステップ2906に進む。一方、MinTHoffの値が注目画素の閾値より大きくない場合は、ステップ2914に進む。 In step 2905, the white pixel minimum threshold value extraction unit 103 compares the current white pixel minimum threshold value (MinTH off ) with the threshold value of the target pixel acquired in step 2903. As a result of the comparison, if the value of MinTH off is larger than the threshold value of the target pixel, the process proceeds to step 2906. On the other hand, if the value of MinTH off is not greater than the threshold value of the target pixel, the process proceeds to step 2914.

ステップ2906において、白画素最小閾値抽出部103は、MinTHoffの値を、ステップ2903で取得した閾値に更新する。 In step 2906, the white pixel minimum threshold value extraction unit 103 updates the value of MinTH off to the threshold value acquired in step 2903.

ステップ2907において、非白画素最小閾値抽出部104は、非白画素最小閾値(MinTHon)とステップ2903で取得した注目画素の閾値とを比較する。比較の結果、MinTHonの値が注目画素の閾値より大きい場合は、ステップ2908に進む。一方、MinTHonの値が注目画素の閾値より大きくない場合は、ステップ2914に進む。 In step 2907, the non-white pixel minimum threshold value extraction unit 104 compares the non-white pixel minimum threshold value (MinTH on ) with the threshold value of the target pixel acquired in step 2903. As a result of the comparison, if the value of MinTH on is larger than the threshold value of the target pixel, the process proceeds to step 2908. On the other hand, if the value of MinTH on is not larger than the threshold value of the target pixel, the process proceeds to step 2914.

ステップ2908において、非白画素最小閾値抽出部104は、MinTHonの値を、ステップ2903で取得した閾値に更新する。 In step 2908, the non-white pixel minimum threshold value extraction unit 104 updates the value of MinTH on to the threshold value acquired in step 2903.

ステップ2909において、非白画素画素値判定部2801は、現時点の非白画素画素値情報が、非白画素の画素値が全て同じ値であることを示す状態かどうかを判定する。判定の結果、全て同じ値であることを示す状態であった場合(すなわち「1」)は、ステップ2910に進む。一方、全て同じ値であることを示す状態ではない場合(すなわち「0」)は、ステップ2914に進む。   In step 2909, the non-white pixel pixel value determination unit 2801 determines whether or not the current non-white pixel pixel value information indicates that all the pixel values of the non-white pixels are the same value. If the determination result shows that all values are the same (ie, “1”), the process proceeds to step 2910. On the other hand, if all the values are not the same (that is, “0”), the process proceeds to step 2914.

ステップ2910において、非白画素画素値判定部2801は、現時点の非白画素値が、白画素値(本実施例では「0」)かどうかを判定する。判定の結果、白画素値であった場合は、ステップ2913に進む。一方、白画素値でない場合は、ステップ2911に進む。   In step 2910, the non-white pixel value determination unit 2801 determines whether or not the current non-white pixel value is a white pixel value (“0” in this embodiment). If the result of determination is that the pixel value is white, the process proceeds to step 2913. On the other hand, if it is not a white pixel value, the process proceeds to step 2911.

ステップ2911において、非白画素画素値判定部2801は、ステップ2903で取得した注目画素の画素値と現時点の非白画素値とを比較する。両者が同じ値であった場合は、現時点の非白画素画素値情報を維持したままステップ2914に進む。一方、両者が同じ値でなかった場合は、ステップ2912に進む。   In step 2911, the non-white pixel value determination unit 2801 compares the pixel value of the target pixel acquired in step 2903 with the current non-white pixel value. If both values are the same, the process proceeds to step 2914 while maintaining the current non-white pixel pixel value information. On the other hand, if they are not the same value, the process proceeds to step 2912.

ステップ2912において、非白画素画素値判定部2801は、非白画素画素値情報を、非白画素の画素値が全て同じないことを示す状態(すなわち「0」)に設定する。   In step 2912, the non-white pixel pixel value determination unit 2801 sets the non-white pixel pixel value information to a state (that is, “0”) indicating that the pixel values of the non-white pixels are not all the same.

ステップ2913では、ステップ2903で取得した注目画素の画素値で、非白画素値が置き換えられる。   In step 2913, the non-white pixel value is replaced with the pixel value of the target pixel acquired in step 2903.

ステップ2914では、所定領域内のすべての画素に対して処理が終了したかどうかが判定される。すべての画素に対して処理が終了していた場合は、ステップ2915に進む。ステップ2915に進んだ時点で、所定領域内の白画素位置における最小閾値がMinTHoffとして保持され、非白画素位置における最小閾値がMinTHonとして保持されていることになる。一方、所定領域内に未処理の画素があればステップ2903に戻り、次の画素を注目画素としてステップ2903〜ステップ2913の各処理を行なう。 In step 2914, it is determined whether or not processing has been completed for all pixels in the predetermined area. If the processing has been completed for all pixels, the process proceeds to step 2915. When the processing proceeds to step 2915, the minimum threshold value at the white pixel position in the predetermined area is held as MinTH off , and the minimum threshold value at the non-white pixel position is held as MinTH on . On the other hand, if there is an unprocessed pixel in the predetermined area, the process returns to step 2903, and the processes of steps 2903 to 2913 are performed with the next pixel as the target pixel.

ステップ2915において、閾値書換部2802は、所定領域内の非白画素の画素値が全て同じであるかどうかを非白画素画素値情報に基づいて判定する。所定領域内の非白画素の画素値が全て同じであった場合は、ステップ2916に進む。一方、所定領域内の非白画素の画素値が全て同じではない場合は、閾値置換を実施せずに処理を終える。   In step 2915, the threshold value rewriting unit 2802 determines whether or not the pixel values of the non-white pixels in the predetermined area are all the same based on the non-white pixel pixel value information. If all the pixel values of the non-white pixels in the predetermined area are the same, the process proceeds to step 2916. On the other hand, if the pixel values of the non-white pixels in the predetermined area are not all the same, the process is terminated without performing threshold replacement.

ステップ2916〜ステップ2920は、実施例1におけるステップ309〜ステップ313にそれぞれ対応し、異なるところはないので説明を省略する。   Steps 2916 to 2920 correspond to steps 309 to 313 in the first embodiment, respectively, and are not different from each other, so the description thereof is omitted.

以上が、本実施例における、白画素最小閾値抽出処理、非白画素最小閾値抽出処理、非白画素画素値判定処理、及び閾値書換処理の内容である。これにより、所定領域内の非白画素の画素値が全て同じ値である場合にのみ、量子化に使用する閾値マトリクスの非白画素に対応する閾値の最小閾値が、ドットが形成される確率が高い閾値へと、所定領域毎に書き換えられる。   The above is the contents of the white pixel minimum threshold extraction process, the non-white pixel minimum threshold extraction process, the non-white pixel pixel value determination process, and the threshold rewriting process in the present embodiment. Thus, only when the pixel values of the non-white pixels in the predetermined area are all the same value, the minimum threshold value corresponding to the non-white pixels of the threshold matrix used for quantization has a probability that a dot is formed. It is rewritten every predetermined area to a high threshold.

なお、実施例1の変形例に関しても、非白画素画素値情報並びに非白画素値に関する各処理を追加することで同様に実現可能である。   Note that the modification of the first embodiment can be similarly realized by adding each process related to the non-white pixel pixel value information and the non-white pixel value.

(その他の実施例)
また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)がプログラムを読み出して実行する処理である。
(Other examples)
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and a computer (or CPU, MPU, or the like) of the system or apparatus reads the program. It is a process to be executed.

Claims (14)

画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理装置において、
入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定する判定手段と、
前記所定領域に含まれる全画素に対応する閾値のうち、最も小さい閾値を抽出する第一の抽出手段と、
前記所定領域における非白画素に対応する閾値のうち、最も小さい閾値を抽出する第二の抽出手段と、
前記第一の抽出手段により抽出された閾値が、前記第二の抽出手段により抽出された閾値よりも小さい場合、前記第一の抽出手段により抽出された閾値に基づいて、前記第二の抽出手段により抽出された閾値を書き換える書換手段と
を備えることを特徴とする画像処理装置。
In an image processing apparatus that generates a halftone image by quantizing with different threshold values according to pixel positions,
Determination means for determining whether or not the plurality of pixels included in the predetermined region in the input image are white pixels;
A first extraction means for extracting the smallest threshold value among the threshold values corresponding to all pixels included in the predetermined region;
A second extraction means for extracting the smallest threshold value among the threshold values corresponding to the non-white pixels in the predetermined region;
When the threshold extracted by the first extracting means is smaller than the threshold extracted by the second extracting means, the second extracting means is based on the threshold extracted by the first extracting means. An image processing apparatus comprising: rewriting means for rewriting the threshold extracted by
画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理装置において、
入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定する判定手段と、
前記所定領域に含まれる白画素に対応する閾値のうち、最も小さい閾値を抽出する第一の抽出手段と、
前記所定領域における非白画素に対応する閾値のうち、最も小さい閾値を抽出する第二の抽出手段と、
前記第一の抽出手段により抽出された閾値が、前記第二の抽出手段により抽出された閾値よりも小さい場合、前記第一の抽出手段により抽出された閾値に基づいて、前記第二の抽出手段により抽出された閾値を書き換える書換手段と
を備えることを特徴とする画像処理装置。
In an image processing apparatus that generates a halftone image by quantizing with different threshold values according to pixel positions,
Determination means for determining whether or not the plurality of pixels included in the predetermined region in the input image are white pixels;
A first extraction means for extracting the smallest threshold value among the threshold values corresponding to white pixels included in the predetermined region;
A second extraction means for extracting the smallest threshold value among the threshold values corresponding to the non-white pixels in the predetermined region;
When the threshold extracted by the first extracting means is smaller than the threshold extracted by the second extracting means, the second extracting means is based on the threshold extracted by the first extracting means. An image processing apparatus comprising: rewriting means for rewriting the threshold extracted by
さらに、前記書換手段により書き換えの結果に基づいて、前記入力画像における所定領域に含まれる各画素を量子化する量子化手段を有することを特徴とする請求項1又は2に記載の画像処理装置。   The image processing apparatus according to claim 1, further comprising: a quantizing unit that quantizes each pixel included in a predetermined region in the input image based on a result of rewriting by the rewriting unit. 前記書換手段は、前記第二の抽出手段により抽出された閾値を前記第一の抽出手段により抽出された閾値に書き換えることを示す閾値書換情報を生成し、
前記量子化手段は、前記閾値書換情報に基づいて閾値を変更した閾値マトリクスを用いて、前記量子化を行なうことを特徴とする請求項3に記載の画像処理装置。
The rewriting means generates threshold rewriting information indicating that the threshold extracted by the second extracting means is rewritten to the threshold extracted by the first extracting means;
The image processing apparatus according to claim 3, wherein the quantization unit performs the quantization using a threshold value matrix in which threshold values are changed based on the threshold value rewriting information.
前記書換手段は、前記第二の抽出手段により抽出された閾値を、前記第一の抽出手段により抽出された閾値に所定の係数を掛けた値に書き換えることを特徴とする請求項1又は2に記載の画像処理装置。   The rewriting means rewrites the threshold extracted by the second extracting means to a value obtained by multiplying the threshold extracted by the first extracting means by a predetermined coefficient. The image processing apparatus described. 前記所定の係数は、前記第二の抽出手段により抽出された閾値に対応する画素の入力値に応じて設定されることを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein the predetermined coefficient is set according to an input value of a pixel corresponding to the threshold extracted by the second extraction unit. 前記所定の係数は、入力値に応じた係数を格納したルックアップテーブルを用いて設定されることを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein the predetermined coefficient is set using a look-up table storing a coefficient corresponding to an input value. 前記所定の係数が、入力値に応じた係数を表す関数を用いて変更されることを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein the predetermined coefficient is changed using a function representing a coefficient corresponding to an input value. 前記所定領域内のコントラストを導出し、導出されたコントラストに応じて、前記所定の係数が決定されることを特徴とする請求項5に記載の画像処理装置。   The image processing apparatus according to claim 5, wherein a contrast in the predetermined area is derived, and the predetermined coefficient is determined according to the derived contrast. 画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理装置において、
入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定する判定手段と、
前記所定領域内の注目画素に対応する閾値及び当該注目画素の画素値を取得する取得手段と、
取得した前記注目画素に対応する閾値が、非白画素の最小閾値であって、かつ、白画素の最小閾値よりも大きい場合、前記白画素の最小閾値と、取得した前記注目画素の画素値とを比較し、画素値の方が大きければ、当該注目画素に対応する閾値を0に書き換える書換手段と、
を備えることを特徴とする画像処理装置。
In an image processing apparatus that generates a halftone image by quantizing with different threshold values according to pixel positions,
Determination means for determining whether or not the plurality of pixels included in the predetermined region in the input image are white pixels;
An acquisition means for acquiring a threshold value corresponding to a target pixel in the predetermined region and a pixel value of the target pixel;
If the acquired threshold corresponding to the target pixel is the minimum threshold of the non-white pixel and is larger than the minimum threshold of the white pixel, the minimum threshold of the white pixel and the pixel value of the acquired target pixel If the pixel value is larger, rewriting means for rewriting the threshold corresponding to the target pixel to 0,
An image processing apparatus comprising:
画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理方法において、
入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定するステップと、
前記所定領域に含まれる全画素に対応する閾値のうち、最も小さい閾値を抽出する第一の抽出ステップと、
前記所定領域における非白画素に対応する閾値のうち、最も小さい閾値を抽出する第二の抽出ステップと、
前記第一の抽出ステップで抽出された閾値が、前記第二の抽出ステップで抽出された閾値よりも小さい場合、前記第一の抽出ステップで抽出された閾値に基づいて、前記第二の抽出ステップで抽出された閾値を書き換えるステップと
を含むことを特徴とする画像処理方法。
In an image processing method for generating a halftone image by quantizing with different thresholds according to pixel positions,
Determining whether a plurality of pixels included in a predetermined region in the input image are white pixels;
A first extraction step of extracting the smallest threshold among the thresholds corresponding to all pixels included in the predetermined region;
A second extraction step of extracting the smallest threshold among the thresholds corresponding to the non-white pixels in the predetermined region;
If the threshold extracted in the first extraction step is smaller than the threshold extracted in the second extraction step, the second extraction step based on the threshold extracted in the first extraction step And a step of rewriting the threshold extracted in step (a).
画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理方法において、
入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定するステップと、
前記所定領域に含まれる白画素に対応する閾値のうち、最も小さい閾値を抽出する第一の抽出ステップと、
前記所定領域における非白画素に対応する閾値のうち、最も小さい閾値を抽出する第二の抽出ステップと、
前記第一の抽出ステップで抽出された閾値が、前記第二の抽出ステップで抽出された閾値よりも小さい場合、前記第一の抽出ステップで抽出された閾値に基づいて、前記第二の抽出ステップで抽出された閾値を書き換えるステップと
を含むことを特徴とする画像処理方法。
In an image processing method for generating a halftone image by quantizing with different thresholds according to pixel positions,
Determining whether a plurality of pixels included in a predetermined region in the input image are white pixels;
A first extraction step of extracting the smallest threshold value among the threshold values corresponding to white pixels included in the predetermined region;
A second extraction step of extracting the smallest threshold among the thresholds corresponding to the non-white pixels in the predetermined region;
If the threshold extracted in the first extraction step is smaller than the threshold extracted in the second extraction step, the second extraction step based on the threshold extracted in the first extraction step And a step of rewriting the threshold extracted in step (a).
画素位置に応じて閾値を異ならせて量子化することによってハーフトーン画像を生成する画像処理方法において、
入力画像における所定領域に含まれる複数の画素に対して白画素であるか否かを判定するステップと、
前記所定領域内の注目画素に対応する閾値及び当該注目画素の画素値を取得するステップと、
取得した前記注目画素に対応する閾値が、非白画素の最小閾値であって、かつ、白画素の最小閾値よりも大きい場合、前記白画素の最小閾値と、取得した前記注目画素の画素値とを比較し、画素値の方が大きければ、当該注目画素に対応する閾値を0に書き換えるステップと、
を含むことを特徴とする画像処理方法。
In an image processing method for generating a halftone image by quantizing with different thresholds according to pixel positions,
Determining whether a plurality of pixels included in a predetermined region in the input image are white pixels;
Obtaining a threshold value corresponding to a target pixel in the predetermined region and a pixel value of the target pixel;
If the acquired threshold corresponding to the target pixel is the minimum threshold of the non-white pixel and is larger than the minimum threshold of the white pixel, the minimum threshold of the white pixel and the pixel value of the acquired target pixel If the pixel value is larger, rewriting the threshold value corresponding to the target pixel to 0,
An image processing method comprising:
コンピュータを、請求項1乃至10のいずれか1項に記載の画像処理装置として機能させるためのプログラム。   A program for causing a computer to function as the image processing apparatus according to any one of claims 1 to 10.
JP2014136281A 2014-07-01 2014-07-01 Image processing apparatus, image processing method, and program Active JP6324239B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2014136281A JP6324239B2 (en) 2014-07-01 2014-07-01 Image processing apparatus, image processing method, and program
EP20186012.9A EP3754962B1 (en) 2014-07-01 2015-06-18 Image processing apparatus, image processing method, printing medium and storage medium
EP15001813.3A EP2963908B1 (en) 2014-07-01 2015-06-18 Image processing apparatus, image processing method and storage medium
US14/750,128 US10043118B2 (en) 2014-07-01 2015-06-25 Image processing apparatus, image processing method, printing medium and storage medium
CN201510379810.7A CN105323415B (en) 2014-07-01 2015-07-01 Image processing apparatus, image processing method and print media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014136281A JP6324239B2 (en) 2014-07-01 2014-07-01 Image processing apparatus, image processing method, and program

Publications (3)

Publication Number Publication Date
JP2016015598A JP2016015598A (en) 2016-01-28
JP2016015598A5 JP2016015598A5 (en) 2017-08-10
JP6324239B2 true JP6324239B2 (en) 2018-05-16

Family

ID=55231493

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014136281A Active JP6324239B2 (en) 2014-07-01 2014-07-01 Image processing apparatus, image processing method, and program

Country Status (1)

Country Link
JP (1) JP6324239B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2504225B2 (en) * 1989-10-19 1996-06-05 三菱電機株式会社 Image processing device
JP4169054B2 (en) * 2006-07-12 2008-10-22 コニカミノルタビジネステクノロジーズ株式会社 Image processing apparatus, image processing method, and program
JP2012157998A (en) * 2011-01-31 2012-08-23 Seiko Epson Corp Printing system and printing method

Also Published As

Publication number Publication date
JP2016015598A (en) 2016-01-28

Similar Documents

Publication Publication Date Title
US10043118B2 (en) Image processing apparatus, image processing method, printing medium and storage medium
AU2009201252B2 (en) Colour correcting foreground colours for visual quality improvement
JP6353271B2 (en) Image processing apparatus and method
JP5260865B2 (en) Method, apparatus and computer program for halftoning a digital image
US7251060B2 (en) Image-processing device using quantization threshold values produced according to a dither threshold matrix and arranging dot-on pixels in a plural-pixel field according to the dither threshold matrix
CN108012046B (en) Apparatus, method and storage medium for forming image on printing medium
JP2005354231A (en) Image processing apparatus, image processing method, image processing program, and storage medium
KR102067319B1 (en) Image processing apparatus, method of controlling the same, and storage medium
JP2011114413A (en) Image processing unit and method of processing image
JP6029305B2 (en) Image processing apparatus and control method thereof
JP5254740B2 (en) Image processing apparatus and image processing method
JP2015216455A (en) Image processing device, image processing method and program
US9147140B2 (en) Image processing apparatus, method, and product for converting image data into fewer gradations based on total value of pixels in a group except for a detected pixel having a specific value
JP2011142472A (en) Image processing apparatus and image processing method
CN110321087B (en) Image processing apparatus and method
JP6324239B2 (en) Image processing apparatus, image processing method, and program
JP4637766B2 (en) Color error diffusion
EP2894841B1 (en) Information processing apparatus, information processing method, and storage medium
JP6079720B2 (en) Image processing apparatus, image processing method, and program
JP4549306B2 (en) Image processing method, image processing apparatus, image forming apparatus, and computer program
JP2009135637A (en) Image processor, image processing method and program
JP2006270655A (en) Apparatus and method for image processing
JP2005323174A (en) Image forming apparatus and method
JP2006197411A (en) Halftone screening method and printer
JP5162430B2 (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170628

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170628

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171226

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180116

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180226

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180313

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180410

R151 Written notification of patent or utility model registration

Ref document number: 6324239

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151