JP4507279B2 - Image processing apparatus, image processing method, and program thereof - Google Patents

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

Info

Publication number
JP4507279B2
JP4507279B2 JP2005215743A JP2005215743A JP4507279B2 JP 4507279 B2 JP4507279 B2 JP 4507279B2 JP 2005215743 A JP2005215743 A JP 2005215743A JP 2005215743 A JP2005215743 A JP 2005215743A JP 4507279 B2 JP4507279 B2 JP 4507279B2
Authority
JP
Japan
Prior art keywords
image
value
area
colors
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005215743A
Other languages
Japanese (ja)
Other versions
JP2007036560A (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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2005215743A priority Critical patent/JP4507279B2/en
Publication of JP2007036560A publication Critical patent/JP2007036560A/en
Application granted granted Critical
Publication of JP4507279B2 publication Critical patent/JP4507279B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Color Image Communication Systems (AREA)
  • Color, Gradation (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Facsimile Image Signal Circuits (AREA)

Description

本発明は、入力画像を縮小させる画像処理装置に関する。   The present invention relates to an image processing apparatus that reduces an input image.

例えば、特許文献1は、2値画像において、線幅1の細線を検出して保存する縮小変換装置を開示する。
また、特許文献2は、2値画像において、水平方向、垂直方向及び斜め方向に対して細線の有無を判定し、細線の色を出力する画像の縮小変換方法を開示する。
また、特許文献3は、2値画像において、2×2を含む4×4ブロックに対して黒率が高い場合に、黒画素を、白率が高い場合に、白画素を出力する画像処理装置を開示する。
特開平5−41795号公報 特許第2525768号公報 特開平6−231238号公報
For example, Patent Document 1 discloses a reduction conversion device that detects and stores a thin line having a line width of 1 in a binary image.
Further, Patent Document 2 discloses a method for reducing and converting an image that determines the presence or absence of a fine line in a horizontal direction, a vertical direction, and an oblique direction in a binary image, and outputs the color of the fine line.
Patent Document 3 discloses an image processing apparatus that outputs a black pixel when a black rate is high for a 4 × 4 block including 2 × 2 in a binary image, and outputs a white pixel when a white rate is high. Is disclosed.
JP-A-5-41795 Japanese Patent No. 2525768 JP-A-6-231238

本発明は、高画質な縮小画像を生成する画像処理装置を提供することを目的とする。   An object of the present invention is to provide an image processing apparatus that generates a high-quality reduced image.

[画像処理装置]
上記目的を達成するために、本発明にかかる画像処理装置は、入力画像に対して、縮小処理の対象となる注目領域と、この注目領域の周囲にある周囲領域とからなる既定サイズの画像領域を複数設定する領域設定手段と、前記領域設定手段により設定された画像領域に含まれる色の数と、既定の基準値C(Cは2以上の値)との大小関係を判定する色数判定手段と、前記領域選択手段により設定された画像領域毎に、注目領域が縮小された縮小領域からなる縮小画像を構成する階調値の決定方法として、色の数が前記基準値Cよりも大きい場合には、階調値の平均化処理を用いる方法を選択し、色の数が前記基準値C以下である場合には、含まれている階調値のうちの1つを縮小画像の階調値とする方法を選択する選択手段と、画像領域に含まれる色の数が前記基準値Cよりも大きい場合に、注目領域の平均階調値を、この注目領域に対応する縮小領域の階調値とし、画像領域に含まれる色の数が前記基準値C以下である場合に、注目領域に含まれている階調値のうちの1つを、この注目領域に対応する縮小領域の階調値とする階調値決定手段とを有する。
[Image processing device]
In order to achieve the above object, an image processing apparatus according to the present invention, for an input image, has an image area of a predetermined size that includes an attention area to be reduced and a surrounding area around the attention area. A plurality of area setting means for setting a plurality of colors, and a color number determination for determining a magnitude relationship between the number of colors included in the image area set by the area setting means and a predetermined reference value C (C is a value of 2 or more) The number of colors is larger than the reference value C as a method for determining a gradation value constituting a reduced image composed of a reduced area obtained by reducing the attention area for each image area set by the means and the area selecting means In this case, a method using an averaging process of gradation values is selected, and when the number of colors is equal to or less than the reference value C, one of the included gradation values is converted to the scale of the reduced image. A selection means for selecting a method to be a tone value, and When the number of colors to be displayed is larger than the reference value C, the average gradation value of the attention area is set as the gradation value of the reduction area corresponding to the attention area, and the number of colors included in the image area is the reference value. In the case of C or less, there is provided a gradation value determining unit that uses one of the gradation values included in the attention area as the gradation value of the reduced area corresponding to the attention area.

好適には、それぞれの画像領域には、縮小処理の対象となる注目領域が含まれており、前記階調値決定手段は、前記注目領域に含まれる色の数が1である場合に、この画像領域に含まれる色、つまり階調値を、この注目領域に対応する縮小画像の階調値とし、1色のみからなる注目領域の数を、それぞれの色毎に計数するベタ領域計数手段をさらに有する。   Preferably, each image area includes an attention area to be subjected to a reduction process, and the gradation value determination unit is configured to perform the processing when the number of colors included in the attention area is 1. Solid area counting means for setting the color included in the image area, that is, the gradation value, as the gradation value of the reduced image corresponding to the attention area, and counting the number of attention areas consisting of only one color for each color. Also have.

好適には、前記色数判定手段は、前記画像領域それぞれに含まれる色の数が基準値C以下であるか否かを判定し、前記選択手段は、色の数が基準値C以下となる画像領域について、前記ベタ領域計数手段により計数された計数値を用いた階調値の決定方法を選択する。   Preferably, the number of colors determination unit determines whether or not the number of colors included in each of the image regions is equal to or less than a reference value C, and the selection unit determines that the number of colors is equal to or less than a reference value C. For the image area, a gradation value determination method using the count value counted by the solid area counting means is selected.

好適には、色の数が基準値C以下となる画像領域において、他の画像を透過させる透過領域が規則的に設けられた透過型パターンの有無を判定する透過型パターン判定手段をさらに有し、前記選択手段は、前記透過型パターン判定手段により透過型パターンが存在すると判定された画像領域について、階調値の平均化処理を用いる方法を選択する。   Preferably, in the image area where the number of colors is equal to or less than the reference value C, the image processing apparatus further includes a transmission pattern determination unit that determines whether or not there is a transmission pattern in which transmission areas for transmitting other images are regularly provided. The selection unit selects a method using a gradation value averaging process for the image region determined to have a transmission pattern by the transmission pattern determination unit.

また、本発明にかかる画像処理装置は、入力画像で出現する複数の色それぞれの出現頻度を評価し、それぞれの色に対する評価値を生成する頻度評価手段をさらに有し、前記階調値決定手段は、前記領域設定手段により設定された注目領域に複数の色が含まれている場合に、この注目領域に含まれている複数の色の中から、前記頻度評価手段により生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を縮小画像の階調値とする。 The image processing apparatus according to the present invention further includes frequency evaluation means for evaluating the appearance frequency of each of a plurality of colors appearing in the input image and generating an evaluation value for each color, and the gradation value determining means If the attention area set by the area setting means includes a plurality of colors, the evaluation value generated by the frequency evaluation means is selected from the plurality of colors included in the attention area. Based on this, one color is selected, and the gradation value corresponding to the selected color is set as the gradation value of the reduced image.

好適には、前記評価値は、入力画像における、単一の色のみからなる注目領域の出現回数であり、前記頻度評価手段は、前記領域設定手段により設定された複数の注目領域において、単一の色のみからなる注目領域の出現回数を、それぞれの色毎に計数し、前記階調値決定手段は、前記頻度評価手段により色毎に計数された出現回数に基づいて、縮小画像の階調値を決定する。   Preferably, the evaluation value is the number of appearances of an attention area consisting of only a single color in the input image, and the frequency evaluation means is a single item in a plurality of attention areas set by the area setting means. The number of appearances of the region of interest consisting only of the colors is counted for each color, and the gradation value determining means determines the gradation of the reduced image based on the number of appearances counted for each color by the frequency evaluation means. Determine the value.

好適には、前記注目領域を含む画像領域において、既定の階調変化パターンが存在するか否かを判定するパターン判定手段をさらに有し、前記階調値決定手段は、前記パターン判定手段により画像領域に階調変化パターンが存在すると判定された場合に、この画像領域に含まれる注目領域の色の中から、前記頻度評価手段により生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を、この注目領域に対応する縮小画像の階調値とする。   Preferably, the image determination apparatus further includes pattern determination means for determining whether or not a predetermined gradation change pattern exists in the image area including the attention area, wherein the gradation value determination means When it is determined that a gradation change pattern exists in the area, one color is selected from the colors of the attention area included in the image area based on the evaluation value generated by the frequency evaluation unit, The gradation value corresponding to the selected color is set as the gradation value of the reduced image corresponding to this attention area.

好適には、前記階調値決定手段は、前記パターン判定手段により画像領域において階調変化パターンが存在すると判定された場合に、この画像領域に含まれる注目領域の色それぞれに対応する評価値を互いに比較し、出現頻度が最も低いと評価される色を選択する。   Preferably, the gradation value determining means determines an evaluation value corresponding to each color of the attention area included in the image area when the pattern determination means determines that a gradation change pattern exists in the image area. Compare with each other and select the color that is evaluated as having the lowest frequency of appearance.

また、本発明にかかる画像処理装置は、入力画像に含まれる画像要素の一端と、この一端が含まれる前記注目領域との関係、及び、前記画像要素の他端と、この他端が含まれる注目領域との関係に基づいて、注目領域に含まれる階調値の中から、縮小画像に適用すべき階調値を選択する階調値選択手段をさらに有する。 The image processing apparatus according to the present invention includes a relationship between one end of an image element included in an input image and the region of interest including the one end, the other end of the image element, and the other end. The image processing apparatus further includes a gradation value selection unit that selects a gradation value to be applied to the reduced image from the gradation values included in the attention area based on the relationship with the attention area.

[画像処理方法]
また、本発明にかかる画像処理方法は、入力画像に対して、縮小処理の対象となる注目領域と、この注目領域の周囲にある周囲領域とからなる既定サイズの画像領域を複数設定し、設定された画像領域に含まれる色の数と、既定の基準値C(Cは2以上の値)との大小関係を判定し、設定された画像領域毎に、注目領域が縮小された縮小領域からなる縮小画像を構成する階調値の決定方法として、色の数が前記基準値Cよりも大きい場合には、階調値の平均化処理を用いる方法を選択し、色の数が前記基準値C以下である場合には、含まれている階調値のうちの1つを縮小画像の階調値とする方法を選択し、画像領域に含まれる色の数が前記基準値Cよりも大きい場合に、注目領域の平均階調値を、この注目領域に対応する縮小領域の階調値とし、画像領域に含まれる色の数が前記基準値C以下である場合に、注目領域に含まれている階調値のうちの1つを、この注目領域に対応する縮小領域の階調値とする。
[Image processing method]
The image processing method according to the present invention sets a plurality of image areas of a predetermined size including an attention area to be reduced and surrounding areas around the attention area for an input image, The size relationship between the number of colors included in the set image area and a predetermined reference value C (C is a value of 2 or more) is determined, and for each set image area, the attention area is reduced from the reduced area. If the number of colors is larger than the reference value C as a method for determining the gradation value constituting the reduced image, a method using gradation value averaging processing is selected, and the number of colors is the reference value. If it is C or less, a method of selecting one of the included gradation values as the gradation value of the reduced image is selected, and the number of colors included in the image area is larger than the reference value C. The average gradation value of the attention area is set to the gradation value of the reduction area corresponding to the attention area. When the number of colors included in the image area is equal to or less than the reference value C, one of the gradation values included in the attention area is used as the gradation value of the reduced area corresponding to the attention area. And

また、本発明にかかる画像処理方法は、入力画像で出現する複数の色それぞれの出現頻度を評価し、それぞれの色に対する評価値を生成し、設定された注目領域に複数の色が含まれている場合に、この注目領域に含まれている複数の色の中から、生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を縮小画像の階調値とする。 The image processing method according to the present invention evaluates the appearance frequency of each of a plurality of colors appearing in the input image, generates an evaluation value for each color, and includes a plurality of colors in the set attention area. If one of the plurality of colors included in the region of interest is selected, one color is selected based on the generated evaluation value, and the gradation value corresponding to the selected color is converted to the scale of the reduced image. Use the key value.

[プログラム]
また、本発明にかかるプログラムは、入力画像に対して、縮小処理の対象となる注目領域と、この注目領域の周囲にある周囲領域とからなる既定サイズの画像領域を複数設定するステップと、設定された画像領域に含まれる色の数と、既定の基準値C(Cは2以上の値)との大小関係を判定するステップと、設定された画像領域毎に、注目領域が縮小された縮小領域からなる縮小画像を構成する階調値の決定方法として、色の数が前記基準値Cよりも大きい場合には、階調値の平均化処理を用いる方法を選択し、色の数が前記基準値C以下である場合には、含まれている階調値のうちの1つを縮小画像の階調値とする方法を選択するステップと、画像領域に含まれる色の数が前記基準値Cよりも大きい場合に、注目領域の平均階調値を、この注目領域に対応する縮小領域の階調値とし、画像領域に含まれる色の数が前記基準値C以下である場合に、注目領域に含まれている階調値のうちの1つを、この注目領域に対応する縮小領域の階調値とするステップとをコンピュータに実行させる。
[program]
In addition, the program according to the present invention includes a step of setting a plurality of image areas of a predetermined size including an attention area to be reduced and surrounding areas around the attention area for the input image, and setting A step of determining the magnitude relationship between the number of colors included in the set image area and a predetermined reference value C (C is a value of 2 or more), and a reduction in which the attention area is reduced for each set image area When the number of colors is larger than the reference value C as a method for determining the gradation value constituting the reduced image composed of regions, a method that uses gradation value averaging processing is selected, and the number of colors is If the reference value C is equal to or less than the reference value C, a step of selecting one of the included gradation values as a gradation value of the reduced image, and the number of colors included in the image area is the reference value If it is larger than C, the average gradation value of the region of interest is When the gradation value of the reduced area corresponding to the eye area is set and the number of colors included in the image area is equal to or less than the reference value C, one of the gradation values included in the attention area is And causing the computer to execute the step of setting the gradation value of the reduced area corresponding to the attention area.

また、本発明にかかるプログラムは、入力画像で出現する複数の色それぞれの出現頻度を評価し、それぞれの色に対する評価値を生成するステップと、設定された注目領域に複数の色が含まれている場合に、この注目領域に含まれている複数の色の中から、生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を縮小画像の階調値とするステップとをさらにコンピュータに実行させる。 Further, the program according to the present invention evaluates the appearance frequency of each of a plurality of colors appearing in the input image, generates an evaluation value for each color, and includes a plurality of colors in the set attention area. If one of the plurality of colors included in the region of interest is selected, one color is selected based on the generated evaluation value, and the gradation value corresponding to the selected color is converted to the scale of the reduced image. And causing the computer to further execute a step of adjusting values.

本発明の画像処理装置によれば、高画質な縮小画像を得ることができる。   According to the image processing apparatus of the present invention, a high-quality reduced image can be obtained.

まず、本発明の理解を助けるために、その背景及び概略を説明する。
近年の電子文書の広汎な流通により、一般的にデジタル画像を高品質に表示または印刷することが求められている。高品質に表示または印刷するためには、画像の画質改善技術が必要となるが、とりわけ、異なる解像度を持った出力機器に画像を高画質出力するための技術が重要となる。
例えば、ディスプレイ解像度75dpiの画像を600dpiプリンタ装置で出力する場合には、8倍の画像拡大が必要となる。
また、その逆に例えば600dpiでスキャンされた画像を75dpiのディスプレイで閲覧する場合には1/8倍の画像縮小が必要となる。
First, in order to help understanding of the present invention, its background and outline will be described.
Due to the wide distribution of electronic documents in recent years, it is generally required to display or print digital images with high quality. In order to display or print with high quality, a technique for improving the image quality of an image is required. In particular, a technique for outputting an image with high quality to an output device having a different resolution is important.
For example, when an image with a display resolution of 75 dpi is output by a 600 dpi printer, it is necessary to enlarge the image by 8 times.
Conversely, for example, when an image scanned at 600 dpi is viewed on a 75 dpi display, the image must be reduced by a factor of 1/8.

ところで、デジタル画像は、画像全体に渡って使用されている色数によって、分類をすることができる。例えば、デジタルカメラで撮影された画像は、多くの色数を含んでおり、連続階調画像に分類できる。連続階調画像には明確な定義はないが、簡易的には、画像中で使用されている色数が257色以上の画像と考えればよい。
また、例えばプリンタ装置やファックス装置で出力される画像の中には、白黒の2色しか使われていない画像があり、これは2値画像に分類できる。
更に、連続階調画像と2値画像の中間に位置するものとして、限定色画像がある。限定色画像にも明確な定義はないが、簡易的には、画像全体で使用されている色数が256色以下の画像と考えればよい。その意味では、2値画像は、限定色画像のうちで2色しか使われていない画像という見方ができ、限定色画像の特別な場合と言える。
また、限定色画像は、連続階調画像の色数を256色に減色して作成される画像(例えば自然画像を減色処理して得られる256色画像)と、もともとの色数が256色以下しかない画像(例えば、地図、地形図、GIS(地理情報システム)情報、CAD図面画像、コンピュータグラフィック画像)などに分類できる。
By the way, digital images can be classified according to the number of colors used throughout the image. For example, an image photographed with a digital camera includes many colors and can be classified as a continuous tone image. Although there is no clear definition for a continuous tone image, it can be simply considered as an image having 257 or more colors used in the image.
Further, for example, among images output by a printer device or a fax device, there are images in which only two colors of black and white are used, and these can be classified into binary images.
Furthermore, a limited color image is located between the continuous tone image and the binary image. Although there is no clear definition for the limited color image, it can be simply considered as an image having 256 or less colors used in the entire image. In that sense, the binary image can be regarded as an image in which only two colors are used among the limited color images, and can be said to be a special case of the limited color image.
In addition, the limited color image includes an image created by reducing the number of colors of a continuous tone image to 256 colors (for example, a 256 color image obtained by color reduction processing of a natural image), and an original color number of 256 colors or less. The images can be classified into only images (for example, maps, topographic maps, GIS (geographic information system) information, CAD drawing images, computer graphic images).

なお、例えば、RGBの連続階調画像を分版した画像や輝度成分のみに変換した画像は、いずれも256色以下の画像となるが、これらの画像は、限定色画像に含めずに、連続階調画像と見なされる。このようなことから、限定色画像の定義は、より厳密には、256色以下であり、自明でないカラーマップが付いている画像、ということができる。このようなことから、限定色画像は、カラーマップ付き画像、あるいはインデックスカラー画像、などと呼ぶこともある。   Note that, for example, an image obtained by separating RGB continuous tone images or an image converted into only luminance components is an image of 256 colors or less, but these images are not included in the limited color image and are continuously displayed. It is regarded as a gradation image. For this reason, it can be said that the definition of the limited color image is more strictly an image having 256 or less colors and a non-trivial color map. For this reason, the limited color image may be called an image with a color map or an index color image.

上述した、画像を高画質に拡大/縮小するという課題は、デジタル画像共通の課題である。
しかしながら、このように一般に使われているデジタル画像には幾つかの種類があり、画像の持つ性質が異なっているため、高画質に拡大/縮小する際には、それぞれの性質を捉えた処理方法が必要となる。
実際、画像の拡大処理については、連続階調画像、2値文字線画画像、限定色画像の高画質な拡大方法が、それぞれ本願発明者が先に出願した特開2003−283811号公報、特願2004−184114号、及び、特願2005−194051号に開示されている。これらの拡大方法は、高画質な拡大画像の生成を実現する。そしてこれらの発明のうち自然画と限定色画像とでは、個々の画像の特徴によってそれぞれ異なる処理を行っており、それぞれ高画質を達成できている。
The above-described problem of enlarging / reducing an image with high image quality is a problem common to digital images.
However, there are several types of digital images that are generally used in this way, and the properties of the images are different. Therefore, when enlarging / reducing to high image quality, a processing method that captures each property is used. Is required.
Actually, as for the image enlargement process, a high-quality enlargement method for a continuous tone image, a binary character line drawing image, and a limited color image is disclosed in Japanese Patent Application Laid-Open No. 2003-283811 and Japanese Patent Application No. No. 2004-184114 and Japanese Patent Application No. 2005-194051. These enlargement methods realize generation of enlarged images with high image quality. Of these inventions, the natural image and the limited color image are processed differently depending on the characteristics of the individual images, thereby achieving high image quality.

次に、画像の縮小方法に目を向けてみると、連続階調画像の縮小方法としては、一般には各画素の(重み付き)平均値を縮小画素とする平均値縮小法が、画質の観点から優れている。実際、画像の縮小は、基本的に原画像の情報を減らす処理であり、拡大のような復元の要素が薄いため、一般には拡大処理よりも簡単な処理で行える。特に、連続階調画像は、前記したように自然画像などを対象としており、画像全面に渡って情報があるため、平均値縮小法や単純間引き法で、原画像の情報を全体に残して縮小を行うことができる。
また、平均値縮小法や単純間引き法は、処理が単純であり高速実行できる点も有利となっている。しかしその一方で、2値文字線画画像を含む限定色画像では、一般に画像全面に渡っての情報よりも、文字や線の部分に情報が集中しているため、平均値縮小法や単純間引き法による縮小処理を行った場合に、文字や線の部分の劣化が目立ちやすいという特徴がある。
実際に、限定色画像を平均値縮小法で縮小した場合、文字や線のぼけの問題が生じる。これは、例えば白地に黒文字が描かれているような画像を縮小した場合に、平均化処理により、中間調のグレー値が発生するためである。この効果は、画面上などでの閲覧時には、適度なアンチエイリアス効果となる場合もあるが、一般には縮小画像がぼけた印象となることは否めない。
また、単純間引き法で画像を縮小した場合には、ぼけが発生しない代わりに、線の消えが発生する、線の太さの均一性が失われる、などの問題が発生する。
なお、実際には、平均値縮小法を適用した場合においても、縮小処理後に2値化処理(ハーフトーン化処理)が行われると、ぼけた部分の値が0か1に振られた結果、線の消えが起こるため、平均値縮小法においても文字や線の消えの問題が出る。
Next, when looking at the image reduction method, the average value reduction method in which the average value of each pixel (weighted) is a reduction pixel is generally used as the reduction method of the continuous tone image. Is excellent from. Actually, image reduction is basically processing for reducing information of an original image, and since restoration elements such as enlargement are thin, it can be generally performed by simpler processing than enlargement processing. In particular, as described above, a continuous tone image is intended for a natural image or the like, and there is information over the entire surface of the image. Therefore, the average image reduction method or simple thinning method is used to reduce the original image information as a whole. It can be performed.
Further, the average value reduction method and the simple thinning method are advantageous in that the processing is simple and can be executed at high speed. However, on the other hand, in the limited color image including the binary character line drawing image, since the information is generally concentrated on the character and line portion rather than the information over the entire image, the average value reduction method or the simple thinning method is used. There is a feature that deterioration of characters and lines tends to be conspicuous when the reduction process is performed.
Actually, when the limited color image is reduced by the average value reduction method, a problem of blurring of characters and lines occurs. This is because, for example, when an image in which black characters are drawn on a white background is reduced, a halftone gray value is generated by the averaging process. This effect may be an appropriate anti-aliasing effect when viewed on a screen or the like, but generally it cannot be denied that the reduced image is blurred.
In addition, when the image is reduced by the simple thinning method, problems such as disappearance of lines and loss of uniformity of line thickness occur instead of blurring.
Actually, even when the average value reduction method is applied, when binarization processing (halftoning processing) is performed after the reduction processing, the value of the blurred portion is shifted to 0 or 1, Since disappearance of lines occurs, the problem of disappearance of characters and lines also occurs in the average value reduction method.

このように、限定色画像に対する画像縮小処理においては、平均値縮小法や単純間引き法などを適用すると、文字や線の消え、ぼけ、線幅不均一が発生し、縮小画像の画質を劣化させる原因となる。   As described above, in the image reduction processing for the limited color image, when the average value reduction method or the simple thinning method is applied, the disappearance of characters and lines, blurring, and line width non-uniformity occur, and the image quality of the reduced image is deteriorated. Cause.

これらの問題を解決するための方法として、いくつかの方法が開示されている。例えば、特許文献1では、2値画像の原画像から線幅1の細線を検出し、細線を消失させることなく1/2に縮小する方法が開示されている。また、特許文献2では、2値画像に対して、水平方向、垂直方向、斜め方向に対して細線の有無を判定し、細線の色を出力する方法が開示されている。さらに、特許文献3では、2値画像に対して2×2を含む4×4ブロックに対して黒率が高ければ黒画素、白率が高ければ白画素を出力する方法が開示されている。
これらの方法は、前述した文字や線の消え、ぼけ、線幅不均一の問題を部分的に解決することができ、画質を向上することができるが、いずれも2値画像以外の限定色画像を処理することができないという問題がある。
Several methods have been disclosed as methods for solving these problems. For example, Patent Document 1 discloses a method of detecting a thin line having a line width of 1 from an original image of a binary image and reducing it to 1/2 without erasing the thin line. Patent Document 2 discloses a method of determining the presence or absence of a fine line in a horizontal direction, a vertical direction, and an oblique direction with respect to a binary image, and outputting the color of the fine line. Further, Patent Document 3 discloses a method of outputting a black pixel if the black rate is high and a white pixel if the white rate is high for a 4 × 4 block including 2 × 2 for a binary image.
These methods can partially solve the above-mentioned problems of disappearance, blurring, and uneven line width of characters and lines, and can improve image quality. However, both methods are limited color images other than binary images. There is a problem that cannot be processed.

以上述べたように、限定色画像に対する画像縮小処理において、文字や線の消え、ぼけ、線幅不均一などを発生させない高速で高画質な縮小方式が必要となっている。   As described above, an image reduction process for a limited color image requires a high-speed and high-quality reduction method that does not cause disappearance of characters and lines, blurring, and uneven line width.

そこで、本実施形態における画像処理装置は、縮小処理の対象が限定色画像であるか否かを判定し、限定色画像の縮小においては、文字や線の消え、ぼけ、線幅不均一がない縮小方法を適用して、高画質な縮小画像を高速に得ることを可能にする。   Therefore, the image processing apparatus according to the present embodiment determines whether or not a reduction process target is a limited color image. In reducing the limited color image, there is no disappearance of characters or lines, blurring, or uneven line width. By applying a reduction method, a high-quality reduced image can be obtained at high speed.

[第1実施形態]
以下、本発明の第1の実施形態を説明する。
まず、本実施形態における画像処理装置2のハードウェア構成を説明する。
図1は、本発明にかかる画像処理方法が適応される画像処理装置2のハードウェア構成を、制御装置20を中心に例示する図である。
図1に例示するように、画像処理装置2は、CPU202及びメモリ204などを含む制御装置20、通信装置22、HDD・CD装置などの記録装置24、並びに、LCD表示装置あるいはCRT表示装置及びキーボード・タッチパネルなどを含むユーザインターフェース装置(UI装置)26から構成される。
画像処理装置2は、例えば、画像処理プログラム5(後述)がインストールされた汎用コンピュータであり、通信装置22又は記録装置24などを介して画像データを取得し、取得された画像データを出力解像度に応じて縮小する。例えば、画像処理装置2は、プリンタ装置10に対して画像データを出力する場合には、600dpi又は2400dpiなどの解像度に変換し、UI装置26に対して画像データを出力する場合には、75dpiなどの解像度に変換する。
[First Embodiment]
Hereinafter, a first embodiment of the present invention will be described.
First, the hardware configuration of the image processing apparatus 2 in the present embodiment will be described.
FIG. 1 is a diagram illustrating a hardware configuration of an image processing apparatus 2 to which an image processing method according to the present invention is applied, centering on a control apparatus 20.
As illustrated in FIG. 1, the image processing apparatus 2 includes a control device 20 including a CPU 202 and a memory 204, a communication device 22, a recording device 24 such as an HDD / CD device, an LCD display device or a CRT display device, and a keyboard. A user interface device (UI device) 26 including a touch panel and the like is included.
The image processing device 2 is, for example, a general-purpose computer in which an image processing program 5 (described later) is installed, acquires image data via the communication device 22 or the recording device 24, and the acquired image data is set to an output resolution. Scale down accordingly. For example, the image processing apparatus 2 converts the resolution to 600 dpi or 2400 dpi when outputting image data to the printer apparatus 10, and 75 dpi or the like when outputting image data to the UI apparatus 26. Convert to the resolution.

[画像処理プログラム]
図2は、制御装置20(図1)により実行され、本発明にかかる画像処理方法を実現する画像処理プログラム5の機能構成を例示する図である。
図2に例示するように、画像処理プログラム5は、画像入力部500、記憶部505、ブロック抽出部510、ベタ領域判定部515、色数反低部520、算出方法決定部525、ベタ領域計数部530、画素値決定部540、及び画像出力部590を有する。また、画素値決定部540は、平均値算出部545、画素値選択部550、及び単一値出力部570を含む。
なお、画像処理プログラム5の全部又は一部をASICなどのハードウェアで実現してもよい。
[Image processing program]
FIG. 2 is a diagram illustrating a functional configuration of the image processing program 5 which is executed by the control device 20 (FIG. 1) and implements the image processing method according to the present invention.
As illustrated in FIG. 2, the image processing program 5 includes an image input unit 500, a storage unit 505, a block extraction unit 510, a solid region determination unit 515, a color number anti-low unit 520, a calculation method determination unit 525, a solid region count. A unit 530, a pixel value determination unit 540, and an image output unit 590. The pixel value determination unit 540 includes an average value calculation unit 545, a pixel value selection unit 550, and a single value output unit 570.
Note that all or part of the image processing program 5 may be realized by hardware such as an ASIC.

画像処理プログラム5において、画像入力部500は、通信装置22(図1)又は記憶装置24(図1)を介して、デジタル化された画像データ(入力画像)を入力し、記憶部505に出力する。
記憶部505は、画像入力部500から入力された入力画像の画像データ、画像処理後の画像データ、及び、画像処理に用いられる各種の途中演算結果又は処理パラメータなどを保持する。
In the image processing program 5, the image input unit 500 inputs digitized image data (input image) via the communication device 22 (FIG. 1) or the storage device 24 (FIG. 1) and outputs it to the storage unit 505. To do.
The storage unit 505 holds image data of an input image input from the image input unit 500, image data after image processing, and various intermediate calculation results or processing parameters used for image processing.

ブロック抽出部510(領域設定手段)は、入力画像から、既定サイズの注目ブロック及び画像ブロックを抽出する。注目ブロックとは、画像処理(縮小処理)の対象となる画像領域であり、他の注目ブロックと重なりあわないように設定される。また、画像ブロックとは、注目ブロックを中心位置に含む画像領域であり、本例では、注目ブロックと、注目ブロックの周囲に隣接する画素群とが含まれた画像領域である。なお、互いに隣接する画像ブロック同士は、互いに重なり合う。
本例のブロック抽出部510は、2×2サイズの注目ブロックと、この注目ブロックを中心位置に含む4×4サイズの画像ブロックとを設定する。2×2サイズのブロックとは、互いに直交する方向(本例では、主走査方向及び副走査方向)が2画素で構成される矩形領域であり、4×4サイズのブロックとは、互いに直交する方向が4画素で構成される矩形領域である。
The block extraction unit 510 (region setting unit) extracts a target block and an image block having a predetermined size from the input image. The target block is an image area that is a target of image processing (reduction processing), and is set so as not to overlap with another target block. The image block is an image region including the target block at the center position. In this example, the image block is an image region including the target block and a pixel group adjacent to the periphery of the target block. Note that adjacent image blocks overlap each other.
The block extraction unit 510 in this example sets a 2 × 2 size target block and a 4 × 4 size image block including the target block at the center position. The 2 × 2 size block is a rectangular area composed of two pixels in the directions orthogonal to each other (in this example, the main scanning direction and the sub scanning direction), and the 4 × 4 size block is orthogonal to each other. This is a rectangular area whose direction is composed of four pixels.

ベタ領域判定部515は、入力画像において、単一の画素値(階調値)のみを有する画像領域(以下、ベタ領域)を検出する。
本例のベタ領域判定部515は、ブロック抽出部510により抽出される注目ブロックが単一の画素値のみを有するか否か(すなわち、2×2の注目ブロックがベタ領域であるか否か)を判定し、判定結果をベタ領域計数部530に出力する。
The solid area determination unit 515 detects an image area (hereinafter referred to as a solid area) having only a single pixel value (gradation value) in the input image.
The solid area determination unit 515 of this example determines whether or not the target block extracted by the block extraction unit 510 has only a single pixel value (that is, whether or not the 2 × 2 target block is a solid area). And the determination result is output to the solid area counting unit 530.

色数判定部520(色数判定手段)は、入力画像の既定領域に含まれる色の数が基準値C以下であるか否かを判定する。既定領域とは、例えば、ブロック抽出部510により抽出された画像ブロック又は注目ブロック、入力画像を既定のサイズで分割した分割領域、あるいは、入力画像全体であり、本例では、画像ブロックである。また、基準値Cとは、2以上の値であり、例えば、既定領域に含まれる画素数に応じて設定される。例えば、2×2サイズの注目ブロック毎に色の数が判定される場合には、基準値Cは2であり、4×4サイズの画像ブロック毎に色の数が判定される場合には、基準値Cは、3又は4である。
また、色数判定部520は、カラー画像が複数の色成分(例えば、R成分、G成分、及びB成分)に分解された場合には、それぞれの色成分画像において出現する複数の階調値をそれぞれカウントする。例えば、色数判定部520は、既定領域の輝度成分又は明度成分の画像において(Y成分画像又はL成分画像において)、階調値0、階調値123、及び階調値255が出現する場合に、階調値の数3を色の数として、基準値Cと比較する。
本例の色数判定部520は、ブロック抽出部510により抽出された注目ブロックそれぞれについて、色の数を計数し、それぞれの注目ブロックに含まれる色の数が基準値C以下であるか否かを判定し、判定結果を算出方法決定部525に出力する。
The color number determination unit 520 (color number determination unit) determines whether or not the number of colors included in the predetermined area of the input image is equal to or less than the reference value C. The predetermined area is, for example, an image block or block of interest extracted by the block extraction unit 510, a divided area obtained by dividing the input image by a predetermined size, or the entire input image, and is an image block in this example. The reference value C is a value of 2 or more, and is set according to the number of pixels included in the predetermined area, for example. For example, when the number of colors is determined for each 2 × 2 size target block, the reference value C is 2, and when the number of colors is determined for each 4 × 4 size image block, The reference value C is 3 or 4.
In addition, when the color image is decomposed into a plurality of color components (for example, an R component, a G component, and a B component), the color number determination unit 520 has a plurality of gradation values that appear in each color component image. Is counted. For example, the color number determination unit 520 has a gradation value 0, a gradation value 123, and a gradation value 255 appearing in the luminance component or lightness component image of the predetermined area (in the Y component image or the L component image). Further, the number 3 of gradation values is compared with the reference value C as the number of colors.
The number-of-colors determination unit 520 of this example counts the number of colors for each target block extracted by the block extraction unit 510, and determines whether the number of colors included in each target block is equal to or less than a reference value C. And the determination result is output to the calculation method determination unit 525.

算出方法決定部525(選択手段)は、色数判定部520による判定結果に応じて、縮小画像を構成する画素値(階調値)の決定方法(算出方法)を選択し、選択された決定方法を画素値決定部540に通知する。画素値の決定方法には、例えば、平均値縮小法、及び、単純間引き法に加えて、注目ブロックに含まれる色の中から、適用すべき色を選択する画素値選択法などが含まれる。
本例の算出方法決定部525は、色数判定部520により注目ブロックに含まれる色の数が基準値Cよりも大きいと判定された場合には、平均値縮小法を選択し、色数判定部520により注目ブロックに含まれる色の数が2(すなわち、既定の基準値C以下)であると判定された場合に、画素値選択法を選択し、色数判定部520により注目ブロックに含まれる色の数が1であると判定された場合に、注目ブロックに含まれる単一の色をそのまま適用する単純適用法(単純間引き法)を選択する。
The calculation method determination unit 525 (selection means) selects a determination method (calculation method) of pixel values (gradation values) constituting the reduced image according to the determination result by the color number determination unit 520, and the selected determination The method is notified to the pixel value determination unit 540. The pixel value determination method includes, for example, a pixel value selection method for selecting a color to be applied from among colors included in the target block in addition to the average value reduction method and the simple thinning method.
When the color number determination unit 520 determines that the number of colors included in the block of interest is larger than the reference value C, the calculation method determination unit 525 of this example selects the average value reduction method and determines the number of colors. When the number of colors included in the target block is determined by the unit 520 to be 2 (that is, a predetermined reference value C or less), the pixel value selection method is selected, and the number of colors determination unit 520 includes the target block. When it is determined that the number of colors to be displayed is 1, a simple application method (simple thinning method) that applies a single color included in the target block as it is is selected.

ベタ領域計数部530(ベタ領域計数手段、頻度評価手段)は、入力画像で出現する複数の色それぞれの出現頻度を評価して、それぞれの色に対する評価値を生成する。ここで、出現頻度の評価値とは、それぞれの色が出現する頻度に関する評価値であり、例えば、既定サイズの単色領域の出現回数、又は、それぞれの色を有する画素の数などである。
本例のベタ領域計数部530は、単一の色からなる2×2サイズの画像領域(単色領域)を色毎に計数し、色毎の計数値を出現頻度の評価値とする。すなわち、本例のベタ領域計数部530は、ベタ領域判定部515によりベタ領域として判定された注目ブロックの数を、色毎にカウントする。
The solid area counting unit 530 (solid area counting means, frequency evaluation means) evaluates the appearance frequency of each of a plurality of colors appearing in the input image, and generates an evaluation value for each color. Here, the evaluation value of the appearance frequency is an evaluation value related to the frequency of appearance of each color, and is, for example, the number of appearances of a single-color region of a predetermined size or the number of pixels having each color.
The solid area counting unit 530 of this example counts a 2 × 2 size image area (single color area) composed of a single color for each color, and uses the count value for each color as an evaluation value of appearance frequency. That is, the solid area counting unit 530 of this example counts the number of blocks of interest determined as a solid area by the solid area determination unit 515 for each color.

画素値決定部540(階調値決定手段)は、算出方法決定部525により選択された決定方法を用いて、縮小画像の画素値を決定する。
本例の画素値決定部540は、平均値算出部545、画素値選択部550及び単一値出力部570を含み、注目ブロックに含まれる色の数が基準値Cよりも大きい場合には、平均値算出部545が、平均値縮小法を用いて、この注目ブロックに対応する縮小画素の画素値を算出し、注目ブロックに含まれる色の数が2(すなわち、既定の基準値C以下)である場合に、画素値選択部550が、画素値選択法を用いて、この注目ブロックに対応する縮小画素の画素値を、注目ブロックに含まれる画素値の中から選択し、注目ブロックに含まれる色の数が1である場合に、単一値出力部570が、単純適用法を用いて、注目ブロックに含まれる単一の色を、そのまま縮小画素の色として適用する。
The pixel value determination unit 540 (tone value determination unit) determines the pixel value of the reduced image using the determination method selected by the calculation method determination unit 525.
The pixel value determination unit 540 of this example includes an average value calculation unit 545, a pixel value selection unit 550, and a single value output unit 570, and when the number of colors included in the target block is larger than the reference value C, The average value calculation unit 545 calculates the pixel value of the reduced pixel corresponding to the target block using the average value reduction method, and the number of colors included in the target block is 2 (that is, the predetermined reference value C or less). The pixel value selection unit 550 selects the pixel value of the reduced pixel corresponding to the target block from the pixel values included in the target block by using the pixel value selection method, and includes the pixel value in the target block. When the number of colors to be displayed is 1, the single value output unit 570 applies the single color included in the block of interest as a reduced pixel color using the simple application method.

平均値算出部545は、注目ブロックに含まれる画素の平均画素値を算出し、算出された平均画素値を、縮小画素の画素値として出力する。
画素値選択部550は、注目ブロックに含まれる複数の画素の画素値の中から、1つの画素値を選択し、選択された画素値を、縮小画素の画素値として出力する。
単一値出力部570は、注目ブロックに含まれる単一の画素値を、そのまま縮小画素の画素値として出力する。
The average value calculation unit 545 calculates the average pixel value of the pixels included in the block of interest, and outputs the calculated average pixel value as the pixel value of the reduced pixel.
The pixel value selection unit 550 selects one pixel value from among the pixel values of a plurality of pixels included in the block of interest, and outputs the selected pixel value as the pixel value of the reduced pixel.
The single value output unit 570 outputs the single pixel value included in the target block as it is as the pixel value of the reduced pixel.

画像出力部590は、画素値決定部540により決定された縮小画素の画素値を、縮小画像の画像データとして、プリンタ装置10(図1)等に出力する。   The image output unit 590 outputs the pixel value of the reduced pixel determined by the pixel value determination unit 540 to the printer device 10 (FIG. 1) or the like as image data of the reduced image.

図3は、図2に示された画素値選択部550の機能をより詳細に説明する図である。
図3に例示するように、画素値選択部550は、最大最小選択部552、色属性決定部554、特定パターン判定部556、閾値設定部558、閾値比較部560、起点パターン登録部562、既定情報記憶部564、及び終点パターン判定部566を含む。
画素値選択部550において、最大最小選択部552は、注目ブロックに含まれる画素の画素値から、最大画素値CMAX、及び、最小画素値CMINを選択し、選択された最大画素値CMAX及び最小画素値CMINを色属性決定部554に出力する。
FIG. 3 is a diagram for explaining the function of the pixel value selection unit 550 shown in FIG. 2 in more detail.
As illustrated in FIG. 3, the pixel value selection unit 550 includes a maximum / minimum selection unit 552, a color attribute determination unit 554, a specific pattern determination unit 556, a threshold setting unit 558, a threshold comparison unit 560, a starting pattern registration unit 562, a default An information storage unit 564 and an end point pattern determination unit 566 are included.
In the pixel value selection unit 550, the maximum / minimum selection unit 552 selects the maximum pixel value CMAX and the minimum pixel value CMIN from the pixel values of the pixels included in the target block, and selects the selected maximum pixel value CMAX and the minimum pixel. The value CMIN is output to the color attribute determination unit 554.

色属性決定部554は、注目ブロックに含まれる最大画素値CMAX及び最小画素値CMINそれぞれが背景色CBであるか前景色CFであるかを判定する。
より具体的には、色属性決定部554は、ベタ領域計数部530により色毎にカウントされたベタ領域の出現回数に基づいて、最大画素値CMAX及び最小画素値CMINのいずれか一方を背景色CBとし、いずれか他方を前景色CFとする。
本例の色属性決定部554は、最大画素値CMAXに対応する出現回数と、最小画素値CMINに対応する出現回数とを比較して、出現回数がより少ない方の画素値を前景色CFと判定し、出現回数がより多い方の画素値を背景色CBと判定し、判定結果を閾値設定部558に出力する。すなわち、入力画像において、同一の画素値を有する2×2サイズの画像領域(すなわち、同一画素値のベタ領域)が多数出現する場合には、この画素値が背景色である可能性が高く、本例の色属性決定部554は、最大画素値CMAX及び最小画素値CMINそれぞれのベタ領域が出現する回数を比較して、最大画素値CMAX及び最小画素値CMINそれぞれを背景色と前景色とに分類する。
The color attribute determination unit 554 determines whether each of the maximum pixel value CMAX and the minimum pixel value CMIN included in the block of interest is the background color CB or the foreground color CF.
More specifically, the color attribute determination unit 554 uses either the maximum pixel value CMAX or the minimum pixel value CMIN as the background color based on the number of appearances of the solid region counted for each color by the solid region counting unit 530. Let CB be the other foreground color CF.
The color attribute determination unit 554 in this example compares the number of appearances corresponding to the maximum pixel value CMAX and the number of appearances corresponding to the minimum pixel value CMIN, and determines the pixel value having the smaller number of appearances as the foreground color CF. The pixel value with the larger number of appearances is determined as the background color CB, and the determination result is output to the threshold setting unit 558. That is, when a large number of 2 × 2 size image regions having the same pixel value (that is, solid regions having the same pixel value) appear in the input image, it is highly possible that the pixel value is the background color. The color attribute determination unit 554 in this example compares the number of times each of the solid areas of the maximum pixel value CMAX and the minimum pixel value CMIN appears, and sets the maximum pixel value CMAX and the minimum pixel value CMIN as the background color and the foreground color, respectively. Classify.

特定パターン判定部556(パターン判定手段)は、画像ブロックにおける階調変化のパターンと、既定の特定パターンとを比較して、この画像ブロックに含まれる注目ブロックが細線又は端点であるかどうかを判定し、細線又は端点の有無を閾値設定部558に出力する。ここで、特定パターンとは、細線又は端点を検出するための階調変化パターンであり、予め複数用意されている。
本例の特定パターン判定部556は、いずれかの特定パターンに対応する階調変化パターンが画像ブロックに含まれている場合に、細線又は端点が存在するものと判定し、いずれの特定パターンに対応する階調変化パターンが画像ブロックに含まれていない場合に、細線及び端点が存在しないものと判定する。
The specific pattern determination unit 556 (pattern determination unit) compares the gradation change pattern in the image block with a predetermined specific pattern, and determines whether the target block included in the image block is a thin line or an end point. Then, the presence / absence of a thin line or an end point is output to the threshold setting unit 558. Here, the specific pattern is a gradation change pattern for detecting a thin line or an end point, and a plurality of specific patterns are prepared in advance.
The specific pattern determination unit 556 in this example determines that a thin line or an end point exists when a gradation change pattern corresponding to any specific pattern is included in the image block, and corresponds to any specific pattern. When the gradation change pattern to be included is not included in the image block, it is determined that the thin line and the end point do not exist.

閾値設定部558は、色属性決定部554から入力された判定結果(すなわち、背景色の画素値、及び、前景色の画素値)と、判定パターン判定部556から入力された判定結果(細線又は端点の有無)とに応じて、縮小画素の画素値を決定するための閾値THを算出する。
より具体的には、閾値設定部558は、判定パターン判定部556により細線又は端点が存在すると判定された場合(すなわち、画像ブロックに特定パターンが存在する場合)に、第1の閾値THを算出し、細線及び端点が存在しないと判定された場合(すなわち、画像ブロックに特定パターンが存在しない場合)に、第1の閾値THとは異なる第2の閾値THを算出する。
本例の第1の閾値THは、以下の数式により算出される。なお、CBは、注目ブロックにおける背景色の画素値であり、CFは、注目ブロックにおける前景色の画素値である。
The threshold value setting unit 558 receives the determination result (that is, the background color pixel value and the foreground pixel value) input from the color attribute determination unit 554 and the determination result input from the determination pattern determination unit 556 (thin line or The threshold TH for determining the pixel value of the reduced pixel is calculated according to the presence / absence of the end point).
More specifically, the threshold value setting unit 558 calculates the first threshold value TH when the determination pattern determination unit 556 determines that a thin line or an end point exists (that is, when a specific pattern exists in the image block). When it is determined that the thin line and the end point do not exist (that is, when the specific pattern does not exist in the image block), a second threshold value TH different from the first threshold value TH is calculated.
The first threshold value TH in this example is calculated by the following mathematical formula. Note that CB is the pixel value of the background color in the block of interest, and CF is the pixel value of the foreground color in the block of interest.

TH=(CB×4+CF)/5   TH = (CB × 4 + CF) / 5

同様に、第2の閾値THは、以下の数式により算出される。   Similarly, the second threshold value TH is calculated by the following formula.

TH=(CB×2+CF)/3   TH = (CB × 2 + CF) / 3

閾値比較部560は、閾値設定部558により算出された閾値THと、注目ブロックの平均画素値Vとを比較して、縮小画素の画素値として選択すべき画素値を選択する。
本例の閾値比較部560は、平均画素値Vが閾値THよりも小さい場合に、最小画素値CMINを縮小画素の画素値として選択し、平均画素値Vが閾値THよりも大きい場合に、最大画素値CMAXを縮小画素の画素値として選択する。
The threshold comparison unit 560 compares the threshold TH calculated by the threshold setting unit 558 with the average pixel value V of the target block, and selects a pixel value to be selected as the pixel value of the reduced pixel.
The threshold value comparison unit 560 of this example selects the minimum pixel value CMIN as the pixel value of the reduced pixel when the average pixel value V is smaller than the threshold value TH, and increases the maximum when the average pixel value V is larger than the threshold value TH. The pixel value CMAX is selected as the pixel value of the reduced pixel.

起点パターン登録部562は、線幅保存処理が必要な画像要素の一方の端部(以下、処理順の上流側を起点という)を検出し、起点が検出された場合に、その旨を起点情報記憶部564に登録する。線幅保存処理とは、縮小前に同一の線幅を有する複数の細線を、縮小後にも互いに同一の線幅となるように調整する処理である。
本例の起点パターン登録部562は、画素の配列方向(すなわち、主走査方向及び副走査方向)に対して平行な端部(すなわち、主走査方向の端部及び副走査方向の端部)を検出し、検出された端部の種類(主走査方向の起点、又は、副走査方向の起点)を起点情報記憶部564に登録する。
The starting point pattern registration unit 562 detects one end of an image element that requires line width storage processing (hereinafter, the upstream side in the processing order is referred to as the starting point), and when the starting point is detected, the starting point information Register in the storage unit 564. The line width saving process is a process of adjusting a plurality of thin lines having the same line width before reduction so that the same line width is obtained after reduction.
The starting point pattern registration unit 562 of this example uses end portions (that is, end portions in the main scanning direction and end portions in the sub scanning direction) parallel to the pixel arrangement direction (that is, the main scanning direction and the sub scanning direction). The detected end type (starting point in the main scanning direction or starting point in the sub-scanning direction) is registered in the starting point information storage unit 564.

起点情報記憶部564は、起点パターン登録部562により登録された起点情報(主走査方向の起点、及び、副走査方向の起点の有無を示す情報)を記憶する。
また、本例の起点情報記憶部564は、線幅保存処理がなされた場合、又は、画素の配列方向と平行でない端部が検出された場合に、記憶している起点情報を削除する。
なお、本例では、主走査方向に1ライン処理して副走査方向に1つ進める処理順で縮小処理を行うため、主走査方向の起点の有無を示す起点情報に対して、1ライン分のメモリが必要になる。これは、起点情報記憶部564が、主走査方向に配列された画素それぞれに対して起点の有無を記憶する必要があるからである。また、副走査方向の起点の有無を示す起点情報に対して、1画素分のメモリが必要になる。これは、常に、直前に処理した副走査方向の起点情報のみが対象となるからである。
The starting point information storage unit 564 stores the starting point information registered by the starting point pattern registration unit 562 (information indicating whether or not there is a starting point in the main scanning direction and a starting point in the sub scanning direction).
In addition, the starting point information storage unit 564 of this example deletes the starting point information stored when the line width storing process is performed or when an end portion that is not parallel to the pixel arrangement direction is detected.
In this example, since the reduction process is performed in the processing order in which one line is processed in the main scanning direction and one is advanced in the sub-scanning direction, one line's worth of the starting point information indicating the presence or absence of the starting point in the main scanning direction. Memory is required. This is because the starting point information storage unit 564 needs to store the presence or absence of a starting point for each pixel arranged in the main scanning direction. Further, a memory for one pixel is required for starting point information indicating the presence or absence of a starting point in the sub-scanning direction. This is because only the starting point information in the sub-scanning direction processed immediately before is always targeted.

終点パターン判定部566は、線幅保存処理が必要な画像要素の他方の端部(以下、処理順の下流側を終点という)を検出し、終点が検出された場合に、検出された終点に対応する起点が起点情報記憶部564に登録されているか否かを判断し、終点に対応する起点が登録されている場合に、線幅保存処理を行うよう決定する。
本例の終点パターン判定部566は、主走査方向の終点又は副走査方向の終点を検出し、いずれかの終点が検出された場合に、対応する起点(すなわち、主走査方向の端部及び副走査方向の端部)が起点情報記憶部564に登録されているか否かを判断し、登録されている場合に、第2の閾値THを再計算するよう閾値設定部558に指示する。閾値比較部560は、終点パターン判定部566の指示により再計算された第2の閾値THを適用して、細線の終点における縮小画素の画素値を選択することにより、線幅保存処理を実現する。
The end point pattern determination unit 566 detects the other end of the image element that needs the line width storage processing (hereinafter, the downstream side in the processing order is referred to as the end point), and when the end point is detected, the end point pattern is determined as the detected end point. It is determined whether or not the corresponding starting point is registered in the starting point information storage unit 564, and when the starting point corresponding to the end point is registered, it is determined to perform the line width saving process.
In this example, the end point pattern determination unit 566 detects the end point in the main scanning direction or the end point in the sub scanning direction, and when any end point is detected, the corresponding starting point (that is, the end point and the sub scanning direction in the main scanning direction). It is determined whether or not the edge in the scanning direction is registered in the starting point information storage unit 564, and if it is registered, the threshold setting unit 558 is instructed to recalculate the second threshold TH. The threshold comparison unit 560 implements the line width storage process by selecting the pixel value of the reduced pixel at the end point of the thin line by applying the second threshold value TH recalculated according to the instruction of the end point pattern determination unit 566. .

図4は、ブロック抽出部510(図2)により設定される注目ブロック及び画像ブロックを例示する図である。
図4に例示するように、ブロック抽出部510は、入力画像において、主走査方向に2画素、副走査方向に2画素を有する注目ブロックと、この注目ブロックを中心位置に含む画像ブロックとを設定する。注目ブロックは、入力画像の最上端の左側から、主走査方向に順に設定される。また、順に設定される複数の注目ブロックは、互いに隣接して重なり合うことはない。
ブロック抽出部510は、入力画像の右端まで注目ブロックを設定すると、副走査方向に2画素分移動して、左端から注目ブロックを設定していく。
FIG. 4 is a diagram illustrating the target block and the image block set by the block extraction unit 510 (FIG. 2).
As illustrated in FIG. 4, the block extraction unit 510 sets a target block having two pixels in the main scanning direction and two pixels in the sub-scanning direction and an image block including the target block at the center position in the input image. To do. The target block is sequentially set in the main scanning direction from the left side of the uppermost end of the input image. Further, the plurality of blocks of interest set in order do not overlap adjacent to each other.
When the block of interest 510 sets the block of interest to the right end of the input image, it moves by two pixels in the sub-scanning direction and sets the block of interest from the left end.

図5(A)は、算出方法決定部525(図2)により選択される縮小法(縮小画素値の決定方法)を例示し、図5(B)は、ベタ領域計数部530(図2)により計数される計数値を例示する図である。
図5(A)に例示するように、本例の算出方法決定部525は、入力画像の既定領域に含まれる色の数と、それぞれの色の数で適用される決定方法とを予め対応付けておく。本例では、色数1に対して、単一値出力部570による単純適用法が対応付けられており、2以上基準値C以下の色数に対して、画素値選択部550による画素値選択法が対応付けられており、基準値Cよりも多い色数に対して、平均値算出部545による平均値縮小法が対応付けられている。
FIG. 5A illustrates a reduction method (reduction pixel value determination method) selected by the calculation method determination unit 525 (FIG. 2), and FIG. 5B illustrates a solid area counting unit 530 (FIG. 2). It is a figure which illustrates the count value counted by this.
As illustrated in FIG. 5A, the calculation method determination unit 525 of the present example associates in advance the number of colors included in the default area of the input image and the determination method applied for each number of colors. Keep it. In this example, the simple application method by the single value output unit 570 is associated with the number of colors 1, and the pixel value selection unit 550 selects the pixel value with respect to the number of colors of 2 or more and the reference value C or less. The methods are associated with each other, and the average value reduction method by the average value calculation unit 545 is associated with the number of colors larger than the reference value C.

図5(B)に例示するように、本例のベタ領域計数部530は、それぞれの階調値のみを含む注目ブロックの出現回数(カウント値)を、それぞれの階調値に対応付けて記憶している。なお、本例では、カラー画像が分版されて、それぞれの色成分画像毎に縮小処理されるために、ベタ領域の出現回数(カウント値)が階調値毎に計数されているが、カラー画像を分版せずにそのまま縮小処理する場合には、ベタ領域の出現回数を、色毎(すなわち、複数の色成分それぞれの階調値の組合せ毎)に計数してもよい。   As illustrated in FIG. 5B, the solid area counting unit 530 of the present example stores the number of appearances (count value) of the target block including only each gradation value in association with each gradation value. is doing. In this example, since the color image is separated and reduced for each color component image, the number of appearances (count value) of the solid area is counted for each gradation value. When the image is reduced without being separated, the number of appearances of the solid area may be counted for each color (that is, for each combination of gradation values of a plurality of color components).

図6は、特定パターン判定部556(図3)により判定される特定パターンを例示する図であり、図6(A)は、注目ブロック及び画像ブロックに含まれる画素の位置を例示し、図6(B)は、複数の細線端点パターン(特定パターン)を例示する。
図6(A)に例示するように、注目ブロック及び画像ブロックに含まれる画素を特定した場合に、特定パターン判定部556は、画像ブロックに含まれる画素の画素値と、図6(B)に例示する細線端点パターンとを比較して、いずれかの細線端点パターンが画像ブロックに含まれているか否かを判断する。
なお、図6(B)において、「A」及び「B」は、互いに異なる色又は画素値を示す。すなわち、細線端点パターンAは、画像ブロックに含まれる画素X1、画素X2、画素X3及び画素Y6が同一の画素値であり、画素X4が画素X1等と異なる画素値を有することを意味する。同様に、細線端点パターンBは、画像ブロックに含まれる画素X1、画素X2、画素X3及び画素Y7が同一の画素値であり、画素X4が画素X1等と異なる画素値であることを意味し、細線端点パターンCは、画像ブロックに含まれる画素X1、画素X3、画素X4及び画素Y5が同一の画素値であり、画素X2が画素X1等と異なる画素値であることを意味し、細線端点パターンDは、画像ブロックに含まれる画素X1、画素X3、画素X4及び画素Y4が同一の画素値であり、画素X2が画素X1等と異なる画素値であることを意味する。
6 is a diagram illustrating a specific pattern determined by the specific pattern determination unit 556 (FIG. 3), and FIG. 6A illustrates the positions of pixels included in the target block and the image block. (B) illustrates a plurality of fine line end point patterns (specific patterns).
As illustrated in FIG. 6A, when the pixels included in the target block and the image block are specified, the specific pattern determination unit 556 displays the pixel values of the pixels included in the image block and the pixel values illustrated in FIG. By comparing with the exemplified fine line end point pattern, it is determined whether or not any of the fine line end point patterns is included in the image block.
In FIG. 6B, “A” and “B” indicate different colors or pixel values. That is, the fine line end point pattern A means that the pixel X1, the pixel X2, the pixel X3, and the pixel Y6 included in the image block have the same pixel value, and the pixel X4 has a different pixel value from the pixel X1 and the like. Similarly, the fine line end point pattern B means that the pixel X1, the pixel X2, the pixel X3, and the pixel Y7 included in the image block have the same pixel value, and the pixel X4 has a different pixel value from the pixel X1, etc. The fine line end point pattern C means that the pixel X1, the pixel X3, the pixel X4, and the pixel Y5 included in the image block have the same pixel value, and the pixel X2 has a different pixel value from the pixel X1, etc. D means that the pixel X1, the pixel X3, the pixel X4, and the pixel Y4 included in the image block have the same pixel value, and the pixel X2 has a different pixel value from the pixel X1 and the like.

図7(A)は、起点パターン登録部562により検出される起点を例示し、図7(B)は、終点パターン判定部566により検出される終点を例示し、図7(C)は、終点パターン判定部566による判定結果を例示する図である。
図7(A)に例示するように、起点パターン登録部562は、主走査方向の起点に相当する線左端パターンを、注目ブロック内で検出する。線左端パターンは、注目ブロックの左側(すなわち、主走査方向上流側)の2画素が背景色CBの画素値であり、注目ブロックの右側(すなわち、主走査方向下流側)の2画素が前景色CFである。すなわち、起点パターン登録部562は、図7(A)に例示された線左端パターンを用いて、副走査方向に長軸を有する細線の左端を検出する。なお、起点パターン登録部562は、色属性決定部554による決定に基づいて、注目ブロックに含まれる画素の画素値それぞれが、前景色CFであるか背景色CBであるかを判別する。
同様に、起点パターン登録部562は、副走査方向の起点に相当する線上端パターンを、注目ブロック内で検出する。線上端パターンは、注目ブロックの上側(すなわち、副走査方向上流側)の2画素が背景色CBの画素値であり、注目ブロックの下側(すなわち、副走査方向下流側)の2画素が前景色CFである。すなわち、起点パターン登録部562は、図7(A)に例示された線上端パターンを用いて、主走査方向に長軸を有する細線の上端を検出する。
7A illustrates the starting point detected by the starting point pattern registration unit 562, FIG. 7B illustrates the end point detected by the end point pattern determination unit 566, and FIG. 7C illustrates the end point. It is a figure which illustrates the determination result by the pattern determination part 566.
As illustrated in FIG. 7A, the starting point pattern registration unit 562 detects a line left end pattern corresponding to the starting point in the main scanning direction within the target block. In the line left edge pattern, two pixels on the left side of the target block (that is, upstream in the main scanning direction) are the pixel values of the background color CB, and two pixels on the right side of the target block (that is, downstream in the main scanning direction) are foreground colors. CF. That is, the starting point pattern registration unit 562 detects the left end of a thin line having a long axis in the sub-scanning direction, using the line left end pattern illustrated in FIG. The origin pattern registration unit 562 determines whether each pixel value of the pixel included in the block of interest is the foreground color CF or the background color CB based on the determination by the color attribute determination unit 554.
Similarly, the starting point pattern registration unit 562 detects a line upper end pattern corresponding to the starting point in the sub-scanning direction within the target block. In the line upper end pattern, two pixels on the upper side of the target block (that is, the upstream side in the sub-scanning direction) are the pixel values of the background color CB, and two pixels on the lower side of the target block (that is, the downstream side in the sub-scanning direction) It is scenery CF. That is, the starting point pattern registration unit 562 detects the upper end of a thin line having a long axis in the main scanning direction, using the line upper end pattern illustrated in FIG.

また、図7(B)に例示するように、終点パターン判定部566は、主走査方向の終点に相当する線右端パターンを、注目ブロック内で検出する。線右端パターンは、注目ブロックの左側(すなわち、主走査方向上流側)の2画素が前景色CFの画素値であり、注目ブロックの右側(すなわち、主走査方向下流側)の2画素が背景色CBである。すなわち、終点パターン判定部566は、図7(B)に例示された線右端パターンを用いて、副走査方向に長軸を有する細線の右端を検出する。なお、終点パターン判定部566も、色属性決定部554による決定に基づいて、注目ブロックに含まれる画素の画素値それぞれが、前景色CFであるか背景色CBであるかを判別する。
同様に、終点パターン判定部566は、副走査方向の終点に相当する線下端パターンを、注目ブロック内で検出する。線下端パターンは、注目ブロックの上側(すなわち、副走査方向上流側)の2画素が前景色CFの画素値であり、注目ブロックの下側(すなわち、副走査方向下流側)の2画素が背景色CBである。すなわち、終点パターン判定部566は、図7(B)に例示された線下端パターンを用いて、主走査方向に長軸を有する細線の下端を検出する。
Further, as illustrated in FIG. 7B, the end point pattern determination unit 566 detects a line right end pattern corresponding to the end point in the main scanning direction within the block of interest. In the line right edge pattern, two pixels on the left side of the target block (that is, upstream in the main scanning direction) are the pixel values of the foreground color CF, and two pixels on the right side of the target block (that is, downstream in the main scanning direction) are the background color. CB. That is, the end point pattern determination unit 566 detects the right end of a thin line having a long axis in the sub-scanning direction, using the line right end pattern illustrated in FIG. The end point pattern determination unit 566 also determines whether each pixel value of the pixel included in the block of interest is the foreground color CF or the background color CB based on the determination by the color attribute determination unit 554.
Similarly, the end point pattern determination unit 566 detects a line lower end pattern corresponding to the end point in the sub-scanning direction in the target block. In the line lower end pattern, two pixels on the upper side of the target block (that is, the upstream side in the sub-scanning direction) are the pixel values of the foreground color CF, and two pixels on the lower side of the target block (that is, the downstream side in the sub-scanning direction) Color CB. That is, the end point pattern determination unit 566 detects the lower end of a thin line having a long axis in the main scanning direction, using the line lower end pattern illustrated in FIG.

終点パターン判定部566は、起点パターン登録部562により起点(線左端パターン又は線上端パターン)が注目ブロックで検出された後に、次の注目ブロックで、対応する終点(線右端パターン又は線下端パターン)が検出した場合に、図7(C)に例示するように、線幅保存処理を行うよう閾値設定部558に指示する。   After the start point (line left end pattern or line top end pattern) is detected in the target block by the start point pattern registration unit 562, the end point pattern determination unit 566 detects the corresponding end point (line right end pattern or line bottom end pattern) in the next target block. Is detected, the threshold value setting unit 558 is instructed to perform the line width saving process as illustrated in FIG.

[動作]
次に、画像処理プログラム5(図2)の動作を説明する。
図8は、画像処理プログラム5による画像処理(S10)の動作を示すフローチャートである。なお、以下の説明では、最大256階調値を持った原画像を1/2サイズに縮小する場合を具体例として説明する。従って、カラーRGB画像は、R面、G面及びB面に分版してそれぞれ本実施例を適用すればよく、CMYK画像も4版に分けて適用すればよい。また、256階調値自体は本質的ではなく、任意のn階調値の画像に適用することができる。
[Operation]
Next, the operation of the image processing program 5 (FIG. 2) will be described.
FIG. 8 is a flowchart showing the operation of the image processing (S10) by the image processing program 5. In the following description, a case where an original image having a maximum of 256 gradation values is reduced to 1/2 size will be described as a specific example. Therefore, the color RGB image may be divided into the R plane, the G plane, and the B plane and applied to the present embodiment, and the CMYK image may be divided into four versions. The 256 gradation values themselves are not essential, and can be applied to an image having an arbitrary n gradation value.

ステップ100(S100)において、記憶部510(図2)は、画像処理を開始する前の準備として、メモリ204(図1)内にメモリ領域を確保して、0で初期化する。また、記憶部510は、ベタ領域計数部530がベタ領域の出現回数をカウントするためのカウンタ、及び、起点情報記憶部564が起点情報を記憶する記憶領域も初期化する。
画像入力部500は、通信装置22(図1)又は記録装置24(図1)等を介して、入力画像を取得し、取得された入力画像の画像データを記憶部510に出力する。
ブロック抽出部510は、入力画像において、図4に例示した注目ブロック及び画像ブロックを設定する。
In step 100 (S100), the storage unit 510 (FIG. 2) reserves a memory area in the memory 204 (FIG. 1) and initializes it with 0 as preparation before starting image processing. The storage unit 510 also initializes a counter for the solid region counting unit 530 to count the number of appearances of the solid region, and a storage region for storing the starting point information by the starting point information storing unit 564.
The image input unit 500 acquires an input image via the communication device 22 (FIG. 1) or the recording device 24 (FIG. 1), and outputs image data of the acquired input image to the storage unit 510.
The block extraction unit 510 sets the target block and the image block illustrated in FIG. 4 in the input image.

ステップ110(S110)において、ベタ領域判定部515は、2×2サイズの注目ブロックに含まれる4画素が全て同一の画素値であるかどうかを判定する。
画像処理プログラム5は、注目ブロックに含まれる4画素が全て同一の画素値である場合(すなわち、注目ブロックがベタ領域である場合)に、S120の処理に移行し、注目ブロックに含まれる4画素が2種類以上の画素値を有する場合(すなわち、注目ブロックがベタ領域でない場合)に、S140の処理に移行する。
In step 110 (S110), the solid area determination unit 515 determines whether all four pixels included in the 2 × 2 size block of interest have the same pixel value.
When all four pixels included in the block of interest have the same pixel value (that is, when the block of interest is a solid area), the image processing program 5 proceeds to the processing of S120, and the four pixels included in the block of interest When there are two or more types of pixel values (that is, when the target block is not a solid area), the process proceeds to S140.

ステップ120(S120)において、ベタ領域計数部530(図2)は、注目ブロックに含まれる画素値に対応するカウンタの値を1増加させる。
ステップ130(S130)において、単一値出力部570は、注目ブロックに含まれる単一の画素値を、そのまま縮小画素の画素値として出力する。
In step 120 (S120), the solid area counting unit 530 (FIG. 2) increments the value of the counter corresponding to the pixel value included in the block of interest by one.
In step 130 (S130), the single value output unit 570 outputs the single pixel value included in the target block as the pixel value of the reduced pixel as it is.

ステップ140(S140)において、平均値算出部545は、注目ブロックに含まれる4画素の平均画素値Vを算出する。   In step 140 (S140), the average value calculation unit 545 calculates the average pixel value V of the four pixels included in the block of interest.

ステップ150(S150)において、色数判定部520(図2)は、画像ブロックに含まれる色の数(すなわち、画素値の種類数)をカウントし、画像ブロックに含まれる色数(画素値の種類数)が基準値C以下であるか否かを判定する。なお、色数判定部520は、4×4ブロックを参照してゆく過程で、全ての画素値を参照し終えなくても、途中でC色よりも多い色数を検出した時点で判定してよい。
画像処理プログラム5は、画像ブロックに含まれる色数(画素値の種類数)が基準値C以下である場合に、S20の処理に移行し、画像ブロックに含まれる色数が基準値Cよりも大きい場合に、S160の処理に移行する。
In step 150 (S150), the color number determination unit 520 (FIG. 2) counts the number of colors (that is, the number of types of pixel values) included in the image block, and the number of colors (pixel value of the pixel value) included in the image block. It is determined whether the number of types is equal to or less than a reference value C. The number-of-colors determination unit 520 determines when a number of colors larger than the C color is detected in the middle without referring to all pixel values in the process of referring to the 4 × 4 block. Good.
When the number of colors (number of types of pixel values) included in the image block is equal to or less than the reference value C, the image processing program 5 proceeds to the process of S20, and the number of colors included in the image block is greater than the reference value C. If larger, the process proceeds to S160.

ステップ20(S20)において、画素値選択部550は、注目ブロックに含まれる4画素の画素値の中から、1つの画素値を選択し、選択された画素値を縮小画素の画素値として出力する。
すなわち、本例の画像処理プログラム5は、画像ブロックに含まれる色の数が基準値C以下である場合に、この画像ブロックに含まれる注目ブロックが、限定色画像に近い特性を有すると判定して、画素値選択法を適用して、文字画像又は線画像のぼけを防止する。
In step 20 (S20), the pixel value selection unit 550 selects one pixel value from the pixel values of the four pixels included in the block of interest, and outputs the selected pixel value as the pixel value of the reduced pixel. .
That is, when the number of colors included in the image block is equal to or less than the reference value C, the image processing program 5 of this example determines that the target block included in the image block has characteristics close to those of the limited color image. Then, the pixel value selection method is applied to prevent blurring of the character image or line image.

ステップ160(S160)において、平均値算出部545は、注目ブロックについて算出された平均画素値を縮小画素の画素値として出力する。
すなわち、本例の画像処理プログラム5は、画像ブロックに含まれる色の数が基準値Cより大きい場合に、この画像ブロックに含まれる注目ブロックが、自然画像に近い特性を有すると判定して、平均値縮小法を適用する。
In step 160 (S160), the average value calculation unit 545 outputs the average pixel value calculated for the block of interest as the pixel value of the reduced pixel.
That is, when the number of colors included in the image block is larger than the reference value C, the image processing program 5 of this example determines that the target block included in the image block has characteristics close to a natural image, Apply the average reduction method.

ステップ170(S170)において、画像処理プログラム5は、全ての注目ブロックについて処理を行ったか否かを判定し、全ての注目ブロックについて処理が終了した場合に、画像出力部590に縮小画素の画素値をまとめて縮小画像の画像データとして外部に出力させ、未処理の注目ブロックが存在する場合に、ブロック抽出部510に次の注目ブロック及び画像ブロックを設定させて、S110の処理に戻る。   In step 170 (S170), the image processing program 5 determines whether or not processing has been performed for all blocks of interest, and when the processing has been completed for all blocks of interest, the image output unit 590 receives pixel values of reduced pixels. Are output to the outside as image data of a reduced image, and if there is an unprocessed block of interest, the block extraction unit 510 sets the next block of interest and image block, and the process returns to S110.

図9は、図8に示された画素値選択処理(S20)のフローチャートである。
図9に示すように、ステップ200(S200)において、画素値選択部550の最大最小選択部552(図3)は、注目ブロックに含まれる画素の画素値から、最大画素値CMAX及び最小画素値CMINを選択する。なお、この処理が行われる段階では、注目ブロックが単一色の場合(ベタ領域の場合)を既に上位(図8のS110、S120及びS130)で処理しているため、必ず最大画素値CMAXが最小画素値CMINと一致することはない。また、説明の便宜上、このような順序にしているが、例えば、処理の高速化のために、注目ブロックの最大画素値CMAX及び最小画素値CMINを計算しつつ、画像ブロックの色数を計数するよう構成にしてもよい。
なお、最大画素値CMAX及び最小画素値CMINは、いずれも入力画像の注目ブロックに実在する色であり、以下の処理において、いずれかが縮小画素の画素値として選択される。そのため、縮小画素の画素値は、入力画像の色を忠実に再現し、ぼけの発生が抑制される。
FIG. 9 is a flowchart of the pixel value selection process (S20) shown in FIG.
As shown in FIG. 9, in step 200 (S200), the maximum / minimum selection unit 552 (FIG. 3) of the pixel value selection unit 550 determines the maximum pixel value CMAX and the minimum pixel value from the pixel values of the pixels included in the block of interest. Select CMIN. At the stage where this processing is performed, the case where the block of interest is a single color (in the case of a solid region) has already been processed at the upper level (S110, S120 and S130 in FIG. 8), so the maximum pixel value CMAX is always the minimum. It does not coincide with the pixel value CMIN. For convenience of explanation, the order is as described above. For example, the number of colors of the image block is counted while calculating the maximum pixel value CMAX and the minimum pixel value CMIN of the block of interest in order to increase the processing speed. You may make it the structure.
Note that the maximum pixel value CMAX and the minimum pixel value CMIN are both colors that actually exist in the target block of the input image, and either is selected as the pixel value of the reduced pixel in the following processing. Therefore, the pixel value of the reduced pixel faithfully reproduces the color of the input image, and blurring is suppressed.

ステップ202(S202)において、色属性決定部554は、注目ブロックの最大画素値CMAX及び最小画素値CMINがそれぞれ背景色CBであるか前景色CFであるかを判定する。すなわち、色属性決定部554は、ベタ領域計数部530(図2)のカウンタを参照して、最大画素値CMAXに対応するカウント値(すなわち、この最大画素値と同一の画素値を有するベタ領域の出現回数)と、最小画素値CMINに対応するカウント値(すなわち、この最小画素値と同一の画素値を有するベタ領域の出現回数)とを比較して、より少ないカウント値を持っている方(最大画素値CMAX又は最小画素値CMIN)を前景色CFと置き、より大きなカウント値を持っている方(最大画素値CMAX又は最小画素値CMIN)を背景色CBと置く。   In step 202 (S202), the color attribute determination unit 554 determines whether the maximum pixel value CMAX and the minimum pixel value CMIN of the block of interest are the background color CB or the foreground color CF, respectively. That is, the color attribute determining unit 554 refers to the counter of the solid region counting unit 530 (FIG. 2), and the count value corresponding to the maximum pixel value CMAX (that is, the solid region having the same pixel value as the maximum pixel value). And the count value corresponding to the minimum pixel value CMIN (that is, the appearance count of a solid area having the same pixel value as this minimum pixel value) and having a smaller count value The (maximum pixel value CMAX or the minimum pixel value CMIN) is set as the foreground color CF, and the one having the larger count value (the maximum pixel value CMAX or the minimum pixel value CMIN) is set as the background color CB.

ステップ204(S204)において、特定パターン判定部556は、注目ブロックが細線又は端点であるかどうかを判定する。具体的には、特定パターン判定部556は、画像ブロックが図6(B)に例示したいずれかの細線端点パターンと一致するかどうか判定し、一致する場合に、注目ブロックが細線又は端点であると判定し、いずれも一致しない場合に、注目ブロックが細線及び端点のいずれでもないと判定する。
画像処理プログラム5は、注目ブロックが細線又は端点であると判定された場合に、S206の処理に移行し、注目ブロックが細線及び端点のいずれでもないと判定された場合に、S208の処理に移行する。
In step 204 (S204), the specific pattern determination unit 556 determines whether the target block is a thin line or an end point. Specifically, the specific pattern determination unit 556 determines whether the image block matches any of the fine line end point patterns illustrated in FIG. 6B, and when they match, the target block is a thin line or end point. If neither matches, it is determined that the block of interest is neither a fine line nor an end point.
When it is determined that the target block is a thin line or an end point, the image processing program 5 proceeds to the process of S206, and when it is determined that the target block is neither a thin line nor an end point, the process proceeds to S208. To do.

ステップ206(S206)において、閾値設定部558(図3)は、色属性決定部554により背景色CBであると判定された画素値(最大画素値又は最小画素値の一方)と、前景色CFであると判定された画素値(最大画素値又は最小画素値の他方)とを用いて、第1の閾値TH(TH=(CB×4+CF)/5)を算出する。   In step 206 (S206), the threshold setting unit 558 (FIG. 3) determines the pixel value (one of the maximum pixel value or the minimum pixel value) determined by the color attribute determination unit 554 as the background color CB, and the foreground color CF. The first threshold value TH (TH = (CB × 4 + CF) / 5) is calculated using the pixel value determined to be (the other of the maximum pixel value or the minimum pixel value).

ステップ208(S208)において、閾値設定部558は、色属性決定部554により背景色CBであると判定された画素値と前景色CFであると判定された画素値とを用いて、第2の閾値TH(TH=(CB×2+CF)/3)を算出する。   In step 208 (S208), the threshold value setting unit 558 uses the pixel value determined by the color attribute determination unit 554 to be the background color CB and the pixel value determined to be the foreground color CF to perform the second operation. The threshold value TH (TH = (CB × 2 + CF) / 3) is calculated.

ステップ210(S210)において、画素値選択部550(起点パターン登録部562及び終点パターン判定部566)は、注目ブロックが水平線(主走査方向に長軸を有する細線の端部)又は垂直線(副走査方向に長軸を有する細線の端部)の一部であるか否かを判定する。
画像処理プログラム5は、注目ブロックが水平線の一部である場合に、S212の処理に移行し、注目ブロックが垂直線の一部である場合に、S222の処理に移行し、注目ブロックが水平線の一部でも垂直線の一部でもない場合に、S232の処理に移行する。
In step 210 (S210), the pixel value selection unit 550 (starting pattern registration unit 562 and end point pattern determination unit 566) determines that the block of interest is a horizontal line (end of a thin line having a long axis in the main scanning direction) or a vertical line (secondary line). It is determined whether it is a part of a thin line having a long axis in the scanning direction.
The image processing program 5 proceeds to the process of S212 when the target block is a part of the horizontal line, and proceeds to the process of S222 when the target block is a part of the vertical line, and the target block is the horizontal line. If it is neither part nor part of the vertical line, the process proceeds to S232.

ステップ212(S212)において、起点パターン登録部562は、注目ブロックに線上端パターン(図7(A))が含まれているか否かを判定し、含まれている場合に、S214の処理に移行し、含まれていない場合に、S216の処理に移行する。   In step 212 (S212), the starting point pattern registration unit 562 determines whether or not the line end pattern (FIG. 7A) is included in the block of interest, and if included, the process proceeds to S214. If it is not included, the process proceeds to S216.

ステップ214(S214)において、起点パターン登録部562は、線上端が検出された旨を起点情報登録部564に登録する。   In step 214 (S214), the starting point pattern registration unit 562 registers in the starting point information registration unit 564 that the upper end of the line has been detected.

ステップ216(S216)において、終点パターン判定部566は、起点情報登録部564に線上端が検出された旨が登録されているか否かを判定し、登録されている場合に、S218の処理に移行し、登録されていない場合に、S234の処理に移行する。   In step 216 (S216), the end point pattern determination unit 566 determines whether or not the fact that the line upper end has been detected is registered in the start point information registration unit 564, and if it is registered, the process proceeds to S218. If it is not registered, the process proceeds to S234.

ステップ218(S218)において、終点パターン判定部566は、線上端が検出された旨を起点情報記憶部564から削除する。
ステップ220(S220)において、終点パターン判定部566は、第2の閾値THを再計算するよう閾値設定部558に指示する。閾値設定部558は、終点パターン判定部566からの指示に応じて、第2の閾値THを再計算する。
すなわち、終点パターン判定部566は、注目ブロックが線下端パターン(図7(B))に相当し、かつ、線上端が検出された旨が起点情報登録部564に登録されている場合に限り、第2の閾値TH(TH=(CB×2+CF)/3)を再計算させて、第2の閾値THを適用させる。
In step 218 (S218), the end point pattern determination unit 566 deletes from the start point information storage unit 564 that the upper end of the line has been detected.
In step 220 (S220), the end point pattern determination unit 566 instructs the threshold setting unit 558 to recalculate the second threshold TH. The threshold setting unit 558 recalculates the second threshold TH in response to an instruction from the end point pattern determination unit 566.
That is, the end point pattern determination unit 566 only corresponds to the case where the target block corresponds to the line bottom pattern (FIG. 7B) and the fact that the line top is detected is registered in the start point information registration unit 564. The second threshold value TH (TH = (CB × 2 + CF) / 3) is recalculated to apply the second threshold value TH.

ステップ222(S222)において、起点パターン登録部562は、注目ブロックに線左端パターン(図7(A))が含まれているか否かを判定し、含まれている場合に、S224の処理に移行し、含まれていない場合に、S226の処理に移行する。   In step 222 (S222), the starting point pattern registration unit 562 determines whether or not the line left end pattern (FIG. 7A) is included in the block of interest. If included, the process proceeds to S224. If it is not included, the process proceeds to S226.

ステップ224(S224)において、起点パターン登録部562は、線左端が検出された旨を起点情報登録部564に登録する。   In step 224 (S224), the start point pattern registration unit 562 registers in the start point information registration unit 564 that the line left end has been detected.

ステップ226(S226)において、終点パターン判定部566は、起点情報登録部564に線左端が検出された旨が登録されているか否かを判定し、登録されている場合に、S228の処理に移行し、登録されていない場合に、S234の処理に移行する。   In step 226 (S226), the end point pattern determination unit 566 determines whether or not the fact that the left end of the line is detected is registered in the start point information registration unit 564, and if it is registered, the process proceeds to S228. If it is not registered, the process proceeds to S234.

ステップ228(S228)において、終点パターン判定部566は、線左端が検出された旨を起点情報記憶部564から削除する。
ステップ230(S230)において、終点パターン判定部566は、第2の閾値THを再計算するよう閾値設定部558に指示する。閾値設定部558は、終点パターン判定部566からの指示に応じて、第2の閾値THを再計算する。
すなわち、終点パターン判定部566は、注目ブロックが線右端パターン(図7(B))に相当し、かつ、線上端が検出された旨が起点情報登録部564に登録されている場合に限り、第2の閾値TH(TH=(CB×2+CF)/3)を再計算させて、第2の閾値THを適用させる。
In step 228 (S228), the end point pattern determination unit 566 deletes from the start point information storage unit 564 that the left end of the line has been detected.
In step 230 (S230), the end point pattern determination unit 566 instructs the threshold setting unit 558 to recalculate the second threshold TH. The threshold setting unit 558 recalculates the second threshold TH in response to an instruction from the end point pattern determination unit 566.
That is, the end point pattern determination unit 566 only corresponds to the case where the target block corresponds to the line right end pattern (FIG. 7B) and the fact that the line upper end is detected is registered in the start point information registration unit 564. The second threshold value TH (TH = (CB × 2 + CF) / 3) is recalculated to apply the second threshold value TH.

ステップ232(S232)において、画素値選択部550(起点パターン登録部562又は終点パターン判定部566)は、注目ブロックが水平線の一部でも垂直線の一部でもない場合には、起点情報記憶部564に記憶されている情報を初期化する。   In step 232 (S232), the pixel value selecting unit 550 (starting point pattern registering unit 562 or end point pattern determining unit 566) causes the starting point information storage unit if the target block is not part of the horizontal line or part of the vertical line. The information stored in 564 is initialized.

ステップ234(S234)において、閾値比較部560は、閾値設定部558により設定された閾値(第1の閾値TH又は第2の閾値TH)と、平均値算出部545(図2)により算出された平均画素値Vとを比較して、最大画素値CMAX又は最小画素値CMINを縮小画素の画素値として選択する。
具体的には、閾値比較部560は、平均画素値Vが閾値THよりも小さい場合に、最小画素値CMINを、この注目ブロックに対応する縮小画素の画素値として出力し、平均画素値Vが閾値THよりも大きい場合に、最大画素値CMAXを、この注目ブロックに対応する縮小画素の画素値として出力する。なお、ここで、平均画素値Vが閾値THと一致することはない。これは、背景色CBと前景色CFに重みをつけて閾値THを設定しているためである。
In step 234 (S234), the threshold value comparison unit 560 is calculated by the threshold value (first threshold value TH or second threshold value TH) set by the threshold value setting unit 558 and the average value calculation unit 545 (FIG. 2). The average pixel value V is compared, and the maximum pixel value CMAX or the minimum pixel value CMIN is selected as the pixel value of the reduced pixel.
Specifically, when the average pixel value V is smaller than the threshold TH, the threshold value comparison unit 560 outputs the minimum pixel value CMIN as the pixel value of the reduced pixel corresponding to the target block, and the average pixel value V is When it is larger than the threshold value TH, the maximum pixel value CMAX is output as the pixel value of the reduced pixel corresponding to this block of interest. Here, the average pixel value V does not coincide with the threshold value TH. This is because the threshold value TH is set by weighting the background color CB and the foreground color CF.

なお、上記画素値選択処理(S20)における線幅保存処理(S210〜S232)の考え方は、縮小後の線幅を揃えるために導入されたものであり、簡単に言えば、水平方向や垂直方向の線で、線の一方の端部を処理したときにそのことを記憶しておき、線のもう一方の端部が処理対象となったときに、その記憶状態に応じて出力値をコントロールするためのものである。この概念によって、各線の線幅を知らなくても、縮小後の線幅を揃えることができる。   Note that the idea of the line width storage process (S210 to S232) in the pixel value selection process (S20) is introduced to align the line widths after reduction, and simply put in the horizontal direction or the vertical direction. When one end of the line is processed with this line, that fact is stored, and when the other end of the line is processed, the output value is controlled according to the storage state. Is for. With this concept, the line width after reduction can be made uniform without knowing the line width of each line.

以上説明したように、本実施形態における画像処理装置2は、ベタ領域の出現頻度に応じて、前景色で構成された細線部分を抽出し、縮小後にもこの細線部分を構成する画素(色)を保存するようにしている。例えば、放射状の細線が集まって来るような部分では、2×2ブロック(注目ブロック)だけでは細線色を判定するのが難しく、誤判定の結果、線消失につながる場合があった。本実施形態で説明した方法を適用すると、このような部位に対しても、より適切に細線色判定を行うことができ、線消失を防ぐことができる。なお、一般には線の消えを防止するためには、線全体が太くなるようにすればよいが、文字が全体に太くなると入力画像(元の画像)の情報を忠実に再現することができない。そこで、特に消えが目立つ細線についてのみ例外的に線が太め(消えない程度)になるように縮小する。
また、本画像処理装置2は、入力画像の既定領域(本例では画像ブロック)に含まれる色数に応じて、自然画像部分であるか限定色画像部分であるかを判定し、限定色画像部分に対して、ぼけの防止のために、縮小画素値に平均値縮小のような中間色が現れないように、画素値選択法を適用している。つまり、限定色画像部分の縮小画像は、局所的な注目ブロックに存在する画素値のみを使用して構成される。これによって、原画像(入力画像)と縮小画像で使用される色(濃度)が一致するため、ぼけの問題が解消される。
また、本画像処理装置2は、水平方向及び垂直方向の細線に対して線幅保存処理を施すことにより、縮小画像における線幅の不均一を解消している。
As described above, the image processing apparatus 2 according to the present embodiment extracts the fine line portion composed of the foreground color according to the appearance frequency of the solid area, and the pixels (colors) constituting the fine line portion even after the reduction. To save. For example, in a portion where radial thin lines are gathered, it is difficult to determine the color of the thin line with only 2 × 2 blocks (blocks of interest), and as a result of erroneous determination, the lines may be lost. When the method described in the present embodiment is applied, it is possible to perform the fine line color determination more appropriately for such a part, and to prevent the disappearance of the line. In general, in order to prevent the disappearance of the line, it is only necessary to make the entire line thicker. However, if the character becomes thicker overall, the information of the input image (original image) cannot be faithfully reproduced. Therefore, the reduction is performed so that the line is exceptionally thick (not disappearing) only for a thin line that is particularly noticeable.
In addition, the image processing apparatus 2 determines whether the image is a natural image portion or a limited color image portion according to the number of colors included in a predetermined area (an image block in this example) of the input image, and the limited color image In order to prevent blur, the pixel value selection method is applied to the portion so that an intermediate color like an average value reduction does not appear in the reduced pixel value. That is, the reduced image of the limited color image portion is configured using only pixel values existing in the local block of interest. As a result, the color (density) used in the original image (input image) and the reduced image match, so the problem of blur is solved.
In addition, the image processing apparatus 2 eliminates the non-uniformity of the line width in the reduced image by performing the line width storing process on the horizontal and vertical thin lines.

線幅不均一の解消について説明する。
線幅不均一とは、例えば入力画像において線幅2であった線が、縮小画像において線幅が1になる場合と2になる場合があることを意味している。例えば、「書」の文字には、横方向に平行な線が8本あるが、文字のバランスとして、どの線の幅も等しいのが普通である。ところが、線幅不均一性を持つ縮小方式で縮小すると、8本全ての線幅を揃えることができず、文字としてのバランスが悪くなり、視認性低下につながる。
このような線幅不均一の問題は、単純間引き法などを適用した場合に顕著である。
そこで、本画像処理装置2は、線幅不均一の解消のために、入力画像において線幅Lであった線を、1/2縮小後に線幅(切り上げ)(L/2)となるようにしている。例えば、線幅1及び2の線は、1/2に縮小されると、線幅1の線となり、線幅3及び4の線は、1/2に縮小されると、線幅2の線となり、線幅5及び6の線は、1/2に縮小されると、線幅3の線となる。
一方、単純間引き法を適用した場合に、処理対象のブロックと、線との位相によって、線幅1の線が、線幅1になったり、線幅0になったりし、線幅3の線が、線幅1になったり、線幅2になったりする。
The elimination of the non-uniform line width will be described.
The non-uniform line width means that, for example, a line having a line width of 2 in the input image may have a line width of 1 or 2 in the reduced image. For example, the letter “book” has eight lines parallel to the horizontal direction, but as a character balance, the widths of all the lines are usually equal. However, if reduction is performed using a reduction method having non-uniform line widths, it is not possible to align all eight line widths, resulting in poor character balance and reduced visibility.
Such a problem of non-uniform line width is remarkable when a simple thinning method or the like is applied.
In view of this, the image processing apparatus 2 reduces the line width L in the input image to a line width (rounded up) (L / 2) after 1/2 reduction in order to eliminate the line width non-uniformity. ing. For example, lines with line widths 1 and 2 become lines with line width 1 when reduced to 1/2, and lines with line widths 3 and 4 become lines with line width 2 when reduced to 1/2. Thus, the lines with the line widths 5 and 6 become lines with the line width 3 when reduced to 1/2.
On the other hand, when the simple thinning method is applied, the line with the line width 1 becomes the line width 1 or the line width 0 depending on the phase of the block to be processed and the line. However, the line width becomes 1 or the line width becomes 2.

本画像処理装置2は、水平な線を対象とする場合に、線上端部分の注目ブロック(2×2サイズ)が全て背景色であって、線下端部分の注目ブロック(2×2サイズ)の上2画素が前景色で下2画素が背景色ならば、縮小画素値として前景色を出力し、線上端部分の注目ブロックの上2画素が背景色で下2画素が前景色であって、線下端部分の注目ブロックの上2画素が前景色で下2画素が背景色ならば、縮小画素値として背景色を出力することにより、線幅保存処理を実現している。また、画像処理装置2は、垂直な線を対象とする場合も、線左端部分の状態(図7(A)の線左端パターンと一致するか否か)と、線右端部分の状態(図7(B)の線右端パターンと一致するか否か)とに基づいて、前景色又は背景色を縮小画素値として選択することにより、線幅保存を実現する。
なお、本例では、線幅保存処理(線幅不均一の解消)は、水平線及び垂直線のみ(主走査方向の線及び副走査方向の線のみ)に対して行い、斜め方向の線を対象としていないが、これは、斜め方向の線幅の変動が視覚的に目立ちにくいという点と、機械的に処理しても大きな線幅の変動が発生しないことによる。
In the image processing apparatus 2, when a horizontal line is targeted, the target block (2 × 2 size) at the upper end of the line is all the background color, and the target block (2 × 2 size) at the lower end of the line If the top 2 pixels are the foreground color and the bottom 2 pixels are the background color, the foreground color is output as a reduced pixel value, the top 2 pixels of the target block at the top of the line are the background color, and the bottom 2 pixels are the foreground color, If the upper two pixels of the target block at the lower end of the line are the foreground color and the lower two pixels are the background color, the background color is output as the reduced pixel value, thereby realizing the line width saving process. Further, the image processing apparatus 2 also applies the state of the left end portion of the line (whether it matches the line left end pattern in FIG. 7A) and the state of the right end portion of the line (FIG. 7) even when targeting a vertical line. The line width is preserved by selecting the foreground color or the background color as the reduced pixel value based on whether or not the line right end pattern matches with (B).
In this example, the line width saving process (resolving the unevenness of the line width) is performed only on the horizontal line and the vertical line (only the line in the main scanning direction and the line in the sub scanning direction), and the line in the oblique direction is targeted. However, this is due to the fact that the fluctuation in the line width in the oblique direction is not visually noticeable and the fact that no large fluctuation in the line width occurs even when mechanically processed.

また、本実施形態において、初めにベタ領域であるかどうかを判定し、その後で自然画部であるか文字線画部であるかを判定する処理順序、及び、文字線画部において線幅の抽出を行わずに線幅を揃える処理方法、これらのいずれもが処理を高速化することにも効果を出しており、本画像処理装置2は、従来の平均値縮小法と比べても、大きな速度低下を起こさずに画像縮小処理を行うことができる。   Further, in the present embodiment, first, it is determined whether the area is a solid area, and then the processing order for determining whether the area is a natural image area or a character line image area, and the line width is extracted in the character line image area. A processing method for aligning line widths without performing any of these methods is effective for speeding up the processing, and the image processing apparatus 2 has a large speed reduction compared to the conventional average value reduction method. The image reduction process can be performed without causing the image.

このように、文字や線の消え、ぼけ、線幅不均一の3つの問題点を解決するために、本画像処理装置2は、いくつかの特別処理を置いているが、その他の部位については、機械的な処理で処理を行うことができる。ここで機械的というのは、決定論的に定まるという意味であり、例えばパターンマッチによる方法でもよい。本実施形態では、パターンマッチではなく、閾値との比較によって、背景値もしくは前景値に振る、という処理を採用している。この方法を使用すると、パターンマッチ処理が不要になり、さらに、上述した3つの問題点を解決する際の特別処理時に特別に閾値を変化させるようにしておき、それ以外の部分はデフォルトの閾値を使用することができ、縮小画像の画素値を決定する部分を共有できる。   As described above, in order to solve the three problems of disappearance of characters and lines, blur, and uneven line width, the image processing apparatus 2 places some special processing. Processing can be performed by mechanical processing. Here, mechanical means that it is determined deterministically, and for example, a pattern matching method may be used. In the present embodiment, a process of assigning to a background value or a foreground value not by pattern matching but by comparison with a threshold value is employed. If this method is used, the pattern matching process becomes unnecessary, and the threshold value is changed specially during the special process for solving the above three problems, and the default threshold value is set for other parts. It can be used, and the part that determines the pixel value of the reduced image can be shared.

[変形例]
次に、第1の実施形態の変形例を説明する。
図10は、第2の画像処理プログラム52の機能構成を例示する図である。なお、本図に示された各構成のうち、図2に示された構成と実質的に同一のものには同一の符号が付されている。
図10に例示するように、第2の画像処理プログラム52は、図2に示された画像処理プログラム5に、例外処理部580を追加した構成をとる。
[Modification]
Next, a modification of the first embodiment will be described.
FIG. 10 is a diagram illustrating a functional configuration of the second image processing program 52. It should be noted that among the components shown in this figure, the same reference numerals are given to the components substantially the same as those shown in FIG.
As illustrated in FIG. 10, the second image processing program 52 has a configuration in which an exception processing unit 580 is added to the image processing program 5 illustrated in FIG. 2.

例外処理部580は、入力画像において線幅の異なる複数の線が一端の辺で共通する場合に、例外的に既に処理された方の線幅に合わせるように補正する。
図11は、例外処理部580による補正処理を説明する図である。
第1の実施形態をそのまま適用して、図11(A)に例示する入力画像を1/2に縮小すると、図11(B)に例示するように、線の下端が揃わなくなる場合がある。
これは、図11(A)に例示する入力画像には、線幅5の水平線と、線幅30の水平線とが互いに結合されており、これらの水平線の下端が共通している。
このような入力画像は、第1の実施形態をそのまま適用すると、それぞれの線幅を(切り上げ)(5/2)=3、(切り上げ)(30/2)=15に揃えられた結果、縮小画像において、図11(B)に例示するように、線の下端部分がずれてしまう。
漢字などでこのような部分が生じると、見た目の画質劣化につながる。
そこで、例外処理部580は、このような異なる線幅だが、線の片側が共通であるような場合には、例外的に既に処理された方の線幅に合わせるように補正する。つまり、例外処理部580は、本来線幅15であるべきところを、既に処理された部分にあわせ、図11(C)に例示するように、線幅16に補正してしまう。この補正処理によって、線幅保存処理が行われても、線の片側のずれを起こさないようにすることができる。
なお、この例外処理も、実際には線幅を知る必要がなく、該当ブロックの処理を行っているときに、それ以前に線幅保存処理を行った部分があったかどうかによって判別することができる。つまり、図11に示したような不具合が起こるのは、線幅保存処理を適用して線幅を調整した部分だけであり、例外処理部580は、そのときに合わせて例外処理を行えばよい。
When a plurality of lines having different line widths are common at one end in the input image, the exception processing unit 580 corrects the exception processing unit 580 to match the line width that has been exceptionally processed.
FIG. 11 is a diagram for explaining the correction processing by the exception processing unit 580.
When the first embodiment is applied as it is and the input image illustrated in FIG. 11A is reduced to ½, the lower ends of the lines may not be aligned as illustrated in FIG. 11B.
In the input image illustrated in FIG. 11A, a horizontal line having a line width of 5 and a horizontal line having a line width of 30 are coupled to each other, and the lower ends of these horizontal lines are common.
When the first embodiment is applied as it is to such an input image, the respective line widths are reduced as a result of being adjusted to (rounded up) (5/2) = 3 and (rounded up) (30/2) = 15. In the image, as illustrated in FIG. 11B, the lower end portion of the line is shifted.
When such a part occurs in Chinese characters, it will lead to degradation of the visual quality.
Therefore, the exception processing unit 580 corrects the line width so that it is exceptionally matched to the already processed line width when such a different line width is used but one side of the line is common. That is, the exception processing unit 580 corrects the portion that should originally be the line width 15 to the line width 16 as illustrated in FIG. 11C in accordance with the already processed portion. By this correction processing, even if the line width storage processing is performed, it is possible to prevent the line from being displaced on one side.
It should be noted that this exception processing does not actually need to know the line width, and can be determined based on whether or not there has been a line width storage process before that block processing. That is, the trouble as shown in FIG. 11 occurs only in the part where the line width is adjusted by applying the line width saving process, and the exception processing unit 580 may perform the exception process in accordance with that time. .

また、上記実施形態では、入力画像を1/2に縮小する形態を具体例として説明したが、本画像処理装置2は、この実施形態で説明した画像処理(S10)を、縮小された画像を入力画像として再帰的にn回繰り返せば、1/2^n縮小を行うことができる。
更に、画像処理装置2は、任意q倍(q<1)縮小に関しても、q倍に最も近い1/2^n倍縮小画像から縮小や拡大を行ってq倍画像を得ることができ、入力画像から直接q倍縮小画像を得る場合よりも細線消えのない縮小画像を得ることができる。
Further, in the above-described embodiment, the form in which the input image is reduced to ½ has been described as a specific example. However, the image processing apparatus 2 performs the image processing (S10) described in this embodiment on the reduced image. If the input image is recursively repeated n times, 1/2 ^ n reduction can be performed.
Furthermore, the image processing apparatus 2 can obtain a q-fold image by performing reduction or enlargement from a 1/2 ^ n-fold reduced image closest to q-times for arbitrary q-fold (q <1) reduction. It is possible to obtain a reduced image in which fine lines are not lost as compared with the case of obtaining a q-fold reduced image directly from the image.

[第2実施形態]
次に、第2の実施形態を説明する。
第1の実施形態では、細線消えの防止、ぼけの抑制、及び線幅の保存を実現する形態を説明したが、第2の実施形態では、細線消えの防止に特化した形態を説明する。
図12は、第2の画素値選択部650の機能構成を例示する図である。
図12に例示するように、第2の画素値選択部650は、特定パターン判定部652、色属性決定部654、パターン色数判定部656、出力画素選択部658及び平均画素値算出部670を有する。
なお、第2の実施形態における画像処理プログラムは、図2に示された画像処理プログラム5において、第1の画素値選択部550を、第2の画素値選択部650(図12)で置換した構成をとる。
[Second Embodiment]
Next, a second embodiment will be described.
In the first embodiment, a form that realizes prevention of thin line disappearance, suppression of blurring, and preservation of line width has been described, but in the second embodiment, a form specialized for prevention of thin line disappearance will be described.
FIG. 12 is a diagram illustrating a functional configuration of the second pixel value selection unit 650.
As illustrated in FIG. 12, the second pixel value selection unit 650 includes a specific pattern determination unit 652, a color attribute determination unit 654, a pattern color number determination unit 656, an output pixel selection unit 658, and an average pixel value calculation unit 670. Have.
In the image processing program in the second embodiment, the first pixel value selection unit 550 is replaced with the second pixel value selection unit 650 (FIG. 12) in the image processing program 5 shown in FIG. Take the configuration.

画素値選択部650において、特定パターン判定部652は、画像ブロックにおける階調変化のパターンと、既定の特定パターンとを比較して、この画像ブロックに含まれる注目ブロックにおいて、細線の候補画素を検出し、候補画素の画素値を色属性決定部654及びパターン色数判定部656に出力する。本例において、特定パターンとは、細線を検出するための階調変化パターンであり、予め複数用意されている。
本例の特定パターン判定部652は、いずれかの特定パターンに対応する階調変化パターンが画像ブロックに含まれている場合に、この特定パターンに対応する画素値B、画素値C、及び画素値A(いずれも図13で後述)を、それぞれ候補画素の画素値、第1の非候補画素の画素値、及び第2の非候補画素の画素値として、色属性決定部654及びパターン色数判定部656に出力する。なお、後述するように、各画素値Aは画素値Bと異なる値であり、画素値Bは画素値Cと異なる値である。
In the pixel value selection unit 650, the specific pattern determination unit 652 compares the gradation change pattern in the image block with a predetermined specific pattern, and detects a thin line candidate pixel in the target block included in the image block. Then, the pixel value of the candidate pixel is output to the color attribute determination unit 654 and the pattern color number determination unit 656. In this example, the specific pattern is a gradation change pattern for detecting a thin line, and a plurality of specific patterns are prepared in advance.
The specific pattern determination unit 652 of this example includes a pixel value B, a pixel value C, and a pixel value corresponding to the specific pattern when a gradation change pattern corresponding to any specific pattern is included in the image block. Let A (both described later in FIG. 13) be the pixel value of the candidate pixel, the pixel value of the first non-candidate pixel, and the pixel value of the second non-candidate pixel, respectively, and determine the number of pattern colors To the unit 656. As will be described later, each pixel value A is different from the pixel value B, and the pixel value B is different from the pixel value C.

色属性決定部654は、注目ブロックに含まれる候補画素が前景色CFであるか否かを判定し、判定結果を出力画素選択部658に出力する。
より具体的には、色属性決定部654は、ベタ領域計数部530(図2)により色毎にカウントされたベタ領域の出現回数に基づいて、特定パターン判定部652により検出された候補画素の画素値が背景色CBであるか前景色CFであるかを決定する。
本例の色属性決定部654は、候補画素の画素値Bに対応する出現回数と、第1の非候補画素の画素値Cに対応する出現回数とを比較して、画素値Bに対応する出現回数が画素値Cに対応する出現回数よりも少ない場合に、この候補画素の画素値Bを前景色CFであると判定する。
The color attribute determination unit 654 determines whether the candidate pixel included in the block of interest is the foreground color CF, and outputs the determination result to the output pixel selection unit 658.
More specifically, the color attribute determination unit 654 determines the candidate pixel detected by the specific pattern determination unit 652 based on the number of appearances of the solid region counted for each color by the solid region counting unit 530 (FIG. 2). It is determined whether the pixel value is the background color CB or the foreground color CF.
The color attribute determination unit 654 of this example compares the number of appearances corresponding to the pixel value B of the candidate pixel with the number of appearances corresponding to the pixel value C of the first non-candidate pixel, and corresponds to the pixel value B. When the number of appearances is smaller than the number of appearances corresponding to the pixel value C, the pixel value B of the candidate pixel is determined to be the foreground color CF.

パターン色数判定部656は、注目ブロックに含まれる候補画素が三色文字の一部であるか否かを判定し、判定結果を出力画素選択部658に出力する。
より具体的には、パターン色数判定部656は、特定パターン判定部652により画像ブロックで検出された特定パターンに含まれる色数を判定し、判定結果を出力画素選択部658に出力する。
本例のパターン色数判定部656は、第1の非候補画素の画素値Cと、第2の非候補画素の画素値Aとを比較して、画素値Cと画素値Aとが一致しない場合に、その旨(すなわち、3色存在する旨)を出力画素選択部658に出力し、画素値Cと画素値Aとが一致する場合に、その旨(すなわち、2色存在する旨)を出力画素選択部658に出力する。
The pattern color number determination unit 656 determines whether the candidate pixel included in the block of interest is a part of a three-color character, and outputs the determination result to the output pixel selection unit 658.
More specifically, the pattern color number determination unit 656 determines the number of colors included in the specific pattern detected by the specific pattern determination unit 652 in the image block, and outputs the determination result to the output pixel selection unit 658.
The pattern color number determination unit 656 of this example compares the pixel value C of the first non-candidate pixel with the pixel value A of the second non-candidate pixel, and the pixel value C does not match the pixel value A. In this case, the fact (that is, the fact that there are three colors) is output to the output pixel selection unit 658, and if the pixel value C and the pixel value A match, that fact (that is, there are two colors) is indicated. The data is output to the output pixel selection unit 658.

出力画素選択部658は、特定パターン判定部652による判定結果、色属性決定部654により判定結果、及び、パターン色数判定部656の判定結果に基づいて、縮小画素の画素値として出力すべき画素を注目ブロックから選択する。
本例の出力画素選択部658は、特定パターン判定部652により特定パターンが存在すると判定され、かつ、色属性決定部654により候補画素の画素値Bが前景色CFであると判定された場合に、この画素値Bを縮小画素の画素値として選択する。
また、出力画素選択部658は、特定パターン判定部652により特定パターンが存在すると判定され、かつ、パターン色数判定部656により画素値Cと画素値Aとが一致しない(すなわち、3色存在する)と判定された場合に、候補画素の画素値Bを縮小画素の画素値として選択する。
また、出力画素選択部658は、特定パターン判定部652により特定パターンが存在しないと判定された場合、又は、色属性決定部654により候補画素の画素値Bが背景色CBであると判定され、かつ、パターン色数判定部656により画素値Cと画素値Aとが一致する(すなわち、2色存在する)と判定された場合に、平均画素値算出部670に平均画素値を縮小画素の画素値として出力するよう指示する。
Based on the determination result by the specific pattern determination unit 652, the determination result by the color attribute determination unit 654, and the determination result by the pattern color number determination unit 656, the output pixel selection unit 658 is a pixel to be output as the pixel value of the reduced pixel Is selected from the target block.
The output pixel selection unit 658 of this example is when the specific pattern determination unit 652 determines that a specific pattern exists and the color attribute determination unit 654 determines that the pixel value B of the candidate pixel is the foreground color CF. The pixel value B is selected as the pixel value of the reduced pixel.
Further, the output pixel selection unit 658 determines that the specific pattern exists by the specific pattern determination unit 652 and the pixel value C does not match the pixel value A by the pattern color number determination unit 656 (that is, there are three colors). ), The pixel value B of the candidate pixel is selected as the pixel value of the reduced pixel.
The output pixel selection unit 658 determines that the specific pattern does not exist by the specific pattern determination unit 652 or determines that the pixel value B of the candidate pixel is the background color CB by the color attribute determination unit 654. If the pattern color number determination unit 656 determines that the pixel value C and the pixel value A match (that is, there are two colors), the average pixel value is calculated by the average pixel value calculation unit 670. Instructs to output as a value.

平均画素値算出部670は、出力画素選択部658からの指示に応じて、注目ブロックに含まれる画素の平均画素値を算出し、算出された平均画素値を縮小画素の画素値として出力する。   The average pixel value calculation unit 670 calculates the average pixel value of the pixels included in the block of interest in response to an instruction from the output pixel selection unit 658, and outputs the calculated average pixel value as the pixel value of the reduced pixel.

図13は、特定パターン判定部652(図12)により判定される特定パターンを例示する図である。
特定パターン判定部652は、画像ブロックに含まれる画素の画素値と、図13に例示されている複数の細線パターンA’〜H’とを比較して、いずれかの細線パターンが画像ブロックに含まれているか否かを判断し、いずれかの細線パターンが画像ブロックに含まれている場合に、画像ブロックに含まれる画素の画素値から、候補画素の画素値B、第1の非候補画素の画素値C、及び第2の非候補画素の画素値Aを決定する。
なお、図13において、「A」及び「B」は、互いに異なる色又は画素値であることを示し、「B」及び「C」も、互いに異なる色又は画素値であることを示す。
すなわち、細線パターンA'〜D'は、副走査方向(図の上下方向)の階調変化に関するパターンであり、候補画素の画素値Bが、副走査方向に隣接する第1の非候補画素、及び、第2の非候補画素Aと異なる画素値を有し、かつ、第1の非候補画素が副走査方向に2画素連続しており、横方向の細線(細線色B)が存在していることを示す。
同様に、細線パターンE'〜H'は、主走査方向(図の左右方向)の階調変化に関するパターンであり、候補画素の画素値Bが、主走査方向に隣接する第1の非候補画素、及び、第2の非候補画素Aと異なる画素値を有し、かつ、第1の非候補画素が副走査方向に2画素連続しており、縦方向の細線(細線色B)が存在していることを示す。
FIG. 13 is a diagram illustrating a specific pattern determined by the specific pattern determination unit 652 (FIG. 12).
The specific pattern determination unit 652 compares the pixel value of the pixel included in the image block with the plurality of thin line patterns A ′ to H ′ illustrated in FIG. 13, and any one of the thin line patterns is included in the image block. If any of the thin line patterns is included in the image block, the pixel value B of the candidate pixel, the pixel value B of the first non-candidate pixel are determined from the pixel values of the pixels included in the image block. The pixel value C and the pixel value A of the second non-candidate pixel are determined.
In FIG. 13, “A” and “B” indicate different colors or pixel values, and “B” and “C” also indicate different colors or pixel values.
That is, the thin line patterns A ′ to D ′ are patterns related to the gradation change in the sub-scanning direction (vertical direction in the figure), and the pixel value B of the candidate pixel is the first non-candidate pixel adjacent in the sub-scanning direction, In addition, the first non-candidate pixel has a pixel value different from that of the second non-candidate pixel A, and the first non-candidate pixel is continuous in the sub-scanning direction, and a horizontal thin line (thin line color B) exists. Indicates that
Similarly, the thin line patterns E ′ to H ′ are patterns related to gradation changes in the main scanning direction (the horizontal direction in the figure), and the pixel value B of the candidate pixel is the first non-candidate pixel adjacent in the main scanning direction. And a pixel value different from that of the second non-candidate pixel A, the first non-candidate pixel is continuous in the sub-scanning direction, and a vertical thin line (thin line color B) exists. Indicates that

図14は、第2の実施形態における画素値選択処理(S24)のフローチャートである。
図14に示すように、ステップ242(S242)において、画素値選択部650の特定パターン判定部652(図12)は、注目ブロックに細線の候補画素が存在するか否かを判定する。具体的には、特定パターン判定部652は、画像ブロックが図13に例示した細線パターンA’〜H’のいずれかと一致するかどうか判定する。
FIG. 14 is a flowchart of the pixel value selection process (S24) in the second embodiment.
As shown in FIG. 14, in step 242 (S242), the specific pattern determination unit 652 (FIG. 12) of the pixel value selection unit 650 determines whether or not a thin line candidate pixel exists in the block of interest. Specifically, the specific pattern determination unit 652 determines whether the image block matches any of the thin line patterns A ′ to H ′ illustrated in FIG.

ステップ244(S244)において、特定パターン判定部652は、画像ブロックに細線パターン(図13)が存在すると判定した場合に、候補画素の画素値B、第1の非候補画素の画素値C及び第2の非候補画素の画素値Aを色属性決定部654及びパターン色数判定部656に出力して、画像処理プログラムは、S246の処理に移行する。
また、特定パターン判定部652は、画像ブロックに細線パターンが存在しないと判定した場合に、その旨を出力画素選択部658に出力し、画像処理プログラムは、S256の処理に移行する。すなわち、画素値選択部650は、画像ブロックに細線パターンが存在しないと判定した場合に、平均画素値を縮小画素の画素値として出力する。
In step 244 (S244), when the specific pattern determination unit 652 determines that the thin line pattern (FIG. 13) exists in the image block, the pixel value B of the candidate pixel, the pixel value C of the first non-candidate pixel, and the first The pixel value A of the second non-candidate pixel is output to the color attribute determination unit 654 and the pattern color number determination unit 656, and the image processing program proceeds to the process of S246.
If the specific pattern determination unit 652 determines that no thin line pattern exists in the image block, the specific pattern determination unit 652 outputs the fact to the output pixel selection unit 658, and the image processing program proceeds to the process of S256. That is, the pixel value selection unit 650 outputs the average pixel value as the pixel value of the reduced pixel when it is determined that the thin line pattern does not exist in the image block.

ステップ246(S246)において、パターン色数判定部656は、細線の背景候補色が2色で構成されているか否かを判定する。
具体的には、パターン色数判定部656は、第1の非候補画素の画素値Cと、第2の非候補画素の画素値Aとを比較して、画素値Cと画素値Aとが一致していない場合に、背景候補色が2色であると判定し、画素値Cと画素値Aとが一致している場合に、背景候補色が単色であると判定する。
In step 246 (S246), the pattern color number determination unit 656 determines whether the background candidate color of the thin line is composed of two colors.
Specifically, the pattern color number determination unit 656 compares the pixel value C of the first non-candidate pixel with the pixel value A of the second non-candidate pixel, and the pixel value C and the pixel value A are If they do not match, it is determined that there are two background candidate colors, and if the pixel value C and the pixel value A match, it is determined that the background candidate color is a single color.

ステップ248(S248)において、画像処理プログラムは、画素値Cと画素値Aとが異なる値を有する場合に、S254の処理に移行し、画素値Cと画素値Aとが同一の値を有する場合に、S250の処理に移行する。
すなわち、画素値選択部650は、画素値Cと画素値Aとが不一致の場合に、細線(画素値B)の背景色が2色であるとみなし、縮小画素値として画素値B、つまり細線色を出力する。
In step 248 (S248), when the pixel value C and the pixel value A have different values, the image processing program proceeds to the process of S254, and the pixel value C and the pixel value A have the same value. Then, the process proceeds to S250.
In other words, when the pixel value C and the pixel value A do not match, the pixel value selection unit 650 considers that the background color of the fine line (pixel value B) is two colors, and the pixel value B, that is, the fine line as the reduced pixel value. Output color.

ステップ250(S250)において、色属性決定部654は、細線の候補画素の画素値Bが前景色CFであるか否かを判定する。
具体的には、色属性決定部654(図12)は、ベタ領域計数部530(図2)により色(画素値)毎にカウントされているカウント値(出現回数)を参照して、画素値Bに対応するカウント値と、画素値Cに対応するカウント値とを比較する。
In step 250 (S250), the color attribute determination unit 654 determines whether the pixel value B of the thin line candidate pixel is the foreground color CF.
Specifically, the color attribute determination unit 654 (FIG. 12) refers to the count value (number of appearances) counted for each color (pixel value) by the solid region counting unit 530 (FIG. 2), and sets the pixel value The count value corresponding to B is compared with the count value corresponding to the pixel value C.

ステップ252(S252)において、色属性決定部654は、画素値Bに対応するカウント値が画素値Cに対応するカウント値よりも小さい場合に、画素値Bを前景色CFであると判定し、画像処理プログラムは、S254の処理に移行し、画素値Bに対応するカウント値が画素値Cに対応するカウント値以上である場合に、画素値Bを前景色CFでないと判定し、画像処理プログラムは、S256の処理に移行する。
すなわち、画素値選択部650は、画素値Bが前景色CFである場合に、縮小画素値として画素値B、つまり細線色を出力する。
In step 252 (S252), the color attribute determining unit 654 determines that the pixel value B is the foreground color CF when the count value corresponding to the pixel value B is smaller than the count value corresponding to the pixel value C, The image processing program proceeds to the processing of S254, and when the count value corresponding to the pixel value B is equal to or larger than the count value corresponding to the pixel value C, the image processing program determines that the pixel value B is not the foreground color CF. Shifts to the process of S256.
That is, when the pixel value B is the foreground color CF, the pixel value selection unit 650 outputs the pixel value B, that is, the fine line color, as the reduced pixel value.

ステップ254(S254)において、出力画素選択部658は、候補画素の画素値Bを縮小画素の画素値として出力する。   In step 254 (S254), the output pixel selection unit 658 outputs the pixel value B of the candidate pixel as the pixel value of the reduced pixel.

ステップ256(S256)において、出力画素選択部658は、平均画素値を出力するよう平均画素値算出部670に指示する。
平均画素値算出部670は、出力画素選択部658からの指示に応じて、注目ブロックに含まれる4画素の平均画素値を算出し、算出された平均画素値を縮小画素の画素値として出力する。
In step 256 (S256), the output pixel selection unit 658 instructs the average pixel value calculation unit 670 to output the average pixel value.
The average pixel value calculation unit 670 calculates the average pixel value of the four pixels included in the block of interest in response to an instruction from the output pixel selection unit 658, and outputs the calculated average pixel value as the pixel value of the reduced pixel. .

このように、第2の実施形態における画素値選択部650は、注目ブロック(2×2ブロック)を中央位置に含む画像ブロック(4×4ブロック)の色数が所定色C色以下の場合には、注目ブロックが前景色細線であるかどうかを判定し、前景色細線である場合に、この前景色細線を縮小画素の画素値として選択する。   As described above, the pixel value selection unit 650 according to the second embodiment performs the processing when the number of colors of the image block (4 × 4 block) including the target block (2 × 2 block) at the center position is equal to or less than the predetermined color C. Determines whether the target block is a foreground thin line, and if it is a foreground thin line, selects this foreground thin line as the pixel value of the reduced pixel.

以上説明したように、第2の実施形態における画像処理装置2は、特定パターンを用いて、細線の候補を検出し、細線候補の画素値Bが前景色である場合、又は、細線候補が他の3色文字の一部である場合に、細線候補の画素値Bを縮小画素の画素値として選択する。これにより、前景色で構成された細線部分が抽出され、縮小後にもこの細線部分を構成する画素(色)が保存される。
特に、本実施形態における画像処理装置2は、細線消えの防止に特化しており、ぼけの抑制及び線幅保存を行わないため、より確実に細線を保存することができる。
As described above, the image processing apparatus 2 according to the second embodiment detects a thin line candidate using a specific pattern, and the pixel value B of the thin line candidate is the foreground color, or the thin line candidate is another Is selected as the pixel value of the reduced pixel. As a result, the fine line portion constituted by the foreground color is extracted, and the pixels (colors) constituting the fine line portion are preserved even after the reduction.
In particular, the image processing apparatus 2 according to the present embodiment specializes in preventing the disappearance of fine lines, and does not suppress blurring and preserve line width, so that fine lines can be preserved more reliably.

第2の実施形態における画像処理装置2は、局所的に2色のみから構成されている細線を、過去に処理済みのベタ部の統計結果に基づいて、2色のうちから前景色を選択して出力することができ、結果として縮小後も、ぼけや消えを生じさせずに限定色画像の細線を保存できる。
更に、第2の実施形態における画像処理装置2は、例えば、白地に空色のゴシック文字が描かれていて、更にゴシック文字の境界に青い縁取りがあるような飾り文字が含まれている場合にも好適に縮小処理を行うことができる。この場合、境界部分は3色から構成されているが、第2の実施形態で説明した方法は、このような部分にも効果を発揮する。従来の2値画像を処理する方法ではこのような画像を処理することができず、また、単純に平均値縮小を使用した場合には、境界の青い部分がぼけて消えてしまう場合がある。一方、本実施形態の方法は、境界の青部分を細線と認識し、この色を保存したまま縮小することができるので、より原画像(入力画像)に忠実な縮小画像を得ることができる。
The image processing apparatus 2 according to the second embodiment selects a foreground color from two colors based on a statistical result of a solid portion that has been processed in the past for a thin line that is locally composed of only two colors. As a result, even after the reduction, the fine line of the limited color image can be saved without causing blur or disappearance.
Furthermore, the image processing apparatus 2 according to the second embodiment also includes, for example, a case where a sky blue gothic character is drawn on a white background and a decorative character having a blue border at the boundary of the gothic character is included. The reduction process can be suitably performed. In this case, the boundary portion is composed of three colors, but the method described in the second embodiment is also effective for such a portion. In the conventional method of processing a binary image, such an image cannot be processed, and when the average value reduction is simply used, the blue portion of the boundary may be blurred and disappear. On the other hand, the method of this embodiment recognizes the blue part of the boundary as a thin line and can reduce the color while preserving the color, so that a reduced image more faithful to the original image (input image) can be obtained.

[変形例]
次に、第2の実施形態の変形例を説明する。
図15は、第3の画素値選択部651の機能構成を例示する図である。なお、本図に示された各構成のうち、図12に示された構成と実質的に同一のものには同一の符号が付されている。
図15に例示するように、第3の画素値選択部651は、図12に示された第2の画素値選択部650に、透過型パターン判定部672を追加した構成をとる。
透過型パターン判定部672は、画像ブロックに透過型パターンが存在するか否かを判定し、透過型パターンが存在する場合に、注目ブロックの平均画素値を縮小画素の画素値として出力するよう平均画素値算出部670に指示する。透過型パターンとは、背景画像をマスクする規則パターンであり、既定の規則に従って背景画像を透過する透過領域を有しており、文字、グラフィック画像又は自然画像などをマスクして、半透明の効果を生じさせる。
透過型パターンは、限定色画像であるため、透過型パターンでマスクされた背景画像がそのまま上記第2の実施形態を適用すると、画素値選択法が適用される場合がある。
しかしながら、透過型パターンでマスクされた背景画像が自然画像である場合には、その部分には平均値縮小法を適用することが望ましい。
そこで、本変形例の透過型パターン判定部672は、画像部録に透過型パターンが存在するか否かを判定し、透過型パターンが存在する場合に、平均値縮小法を適用するよう画素値選択部650を制御する。
[Modification]
Next, a modification of the second embodiment will be described.
FIG. 15 is a diagram illustrating a functional configuration of the third pixel value selection unit 651. Of the components shown in the figure, those substantially the same as those shown in FIG. 12 are denoted by the same reference numerals.
As illustrated in FIG. 15, the third pixel value selection unit 651 has a configuration in which a transmissive pattern determination unit 672 is added to the second pixel value selection unit 650 illustrated in FIG. 12.
The transmissive pattern determination unit 672 determines whether or not a transmissive pattern exists in the image block. If the transmissive pattern exists, the transmissive pattern determination unit 672 performs an average so as to output the average pixel value of the target block as the pixel value of the reduced pixel. Instructs the pixel value calculation unit 670. The transmissive pattern is a regular pattern that masks the background image, has a transmissive area that transmits the background image according to a predetermined rule, and masks characters, graphic images, natural images, etc., and has a translucent effect Give rise to
Since the transmissive pattern is a limited color image, if the background image masked with the transmissive pattern is applied as it is, the pixel value selection method may be applied.
However, when the background image masked with the transmissive pattern is a natural image, it is desirable to apply the average value reduction method to that portion.
Therefore, the transmissive pattern determination unit 672 of the present modification determines whether or not a transmissive pattern exists in the image record, and if the transmissive pattern exists, the pixel value is applied to apply the average value reduction method. The selection unit 650 is controlled.

図16(A)は、透過型パターンを例示し、図16(B)は、三色文字のパターンを例示し、図16(C)は、太線部のパターンを例示する図である。なお、図中の「A」、「B」及び「C」は、互いに異なる画素値を示す。
図16(A)に例示するように、本例の透過型パターンは、2×2サイズの市松パターンを非透過領域として有し、2×2サイズの透過領域を有する。市松パターンは、同一の画素値Aを有する。また、透過領域は、背景画像が表示される領域であるため、任意の画素値となる。
したがって、本例の透過型パターン判定部672は、画像ブロックに含まれる画素のうち、8つの画素が同じ画素値を有することを条件として、画像ブロックに透過型パターンが存在すると判定する。
なお、本例では、画像ブロック16画素のうち、透過領域が8画素、非透過領域が8画素の場合(すなわち、透過率50%の「半透明透過」の場合)を具体例として説明しているが、他の透過率の場合にも、透過型パターン判定部672は、透過率に応じた画素が同じ画素値を有することを条件として、透過パターンの存在を判定することができる。
16A illustrates a transmissive pattern, FIG. 16B illustrates a three-color character pattern, and FIG. 16C illustrates a bold line pattern. In the figure, “A”, “B”, and “C” indicate different pixel values.
As illustrated in FIG. 16A, the transmissive pattern of this example has a 2 × 2 size checkered pattern as a non-transmissive region, and has a 2 × 2 size transmissive region. The checkered pattern has the same pixel value A. Further, since the transmissive area is an area in which the background image is displayed, the transmissive area has an arbitrary pixel value.
Therefore, the transmissive pattern determination unit 672 of this example determines that a transmissive pattern exists in the image block on condition that eight pixels among the pixels included in the image block have the same pixel value.
In this example, of the 16 pixels in the image block, a case where the transmissive area is 8 pixels and the non-transmissive area is 8 pixels (that is, “translucent transmission” with a transmittance of 50%) will be described as a specific example. However, in the case of other transmittances, the transmissive pattern determination unit 672 can determine the presence of the transmission pattern on the condition that the pixels corresponding to the transmittance have the same pixel value.

一方、図16(B)に例示するように、画像ブロックに三色文字の一部が含まれる場合にも、8画素が同じ画素値を有することになるため、本例の透過型パターン判定部672は、他の4画素が同じ画素値を有しないことをさらなる条件として、透過型パターンの存在を判定する。
すなわち、本例の透過型パターン判定部672は、画像ブロックに含まれる画素群のうち、8画素が同じ画素値を有し、かつ、他の4画素が同じ画素値を有しない場合に、透過型パターンが画像ブロック内に存在すると判定する。
なお、図16(C)に例示するように、画像ブロックが太線の一部である場合にも、透過型パターンが存在するように判定されるが、本実施例においては、このような太線には、もともと平均値縮小法を適用するという前提であるので問題ない。
On the other hand, as illustrated in FIG. 16B, even when a part of the three-color character is included in the image block, the eight pixels have the same pixel value. In step 672, the presence of the transmissive pattern is determined on the condition that the other four pixels do not have the same pixel value.
In other words, the transmissive pattern determination unit 672 of this example transmits the transmissive pattern when 8 pixels of the pixel group included in the image block have the same pixel value and the other 4 pixels do not have the same pixel value. It is determined that the mold pattern exists in the image block.
As illustrated in FIG. 16C, it is determined that a transmissive pattern exists even when an image block is a part of a thick line. In this embodiment, such a thick line is used. Since there is no premise that the average value reduction method is originally applied, there is no problem.

このように、本変形例の画素値選択部651は、透過型パターンの検出を行う透過型パターン判定部672を追加して、透過型パターンが画像ブロックに含まれている場合に、平均値縮小法を適用することにより、半透明化処理がなされた入力画像を高画質に縮小することができる。さらに、本変形例における透過パターンの検出は、透過部分に存在するであろう多くのパターンを考慮せずに、マスク部分に設定された固定色の色数だけを利用して直接判定を行うことができる。   As described above, the pixel value selection unit 651 of this modification example adds the transmission pattern determination unit 672 that detects the transmission pattern, and reduces the average value when the transmission pattern is included in the image block. By applying the method, it is possible to reduce the input image that has been subjected to the translucent processing to high image quality. Furthermore, the detection of the transmissive pattern in this modification is performed directly using only the number of fixed colors set in the mask part without considering many patterns that may exist in the transmissive part. Can do.

次に、第1の実施形態及び第2の実施形態に共通する変形例を説明する。
図17は、背景色と前景色とは画像領域で切り替わっている入力画像を例示する図である。
上記第1の実施形態及び第2の実施形態では、ベタ領域の出現頻度が多い方の色を背景色と置いているので、例えば図17に例示するように画像全体において出現頻度の高い方の色が前景色になっている画像領域(図中の白抜き文字部分)では誤判定が起こる。
このような部分では、背景側性質を保存するように処理されてしまうため、結果として細線が消えてしまうという場合がある。このような場合に対処するため、例外的に、背景色が細線であるような場合には、前景色と背景色を入れ替えてから処理を行えばよい。
また、ベタ領域計数部530がベタ領域の出現回数をカウントする画像領域を制限してもよい。すなわち、ベタ領域計数部530は、既定の画像領域毎に、ベタ領域の出現回数を初期化して画像領域毎にベタ領域をカウントしてもよい。
なお、第2の実施形態では、画像全体において出現頻度の高い方の色が前景色である場合には、平均値縮小で処理する構成となっている。従って、このような変形処理を行わなくても、得られる画質は平均値縮小の画質になり、、背景色と前景色を取り違えて大きな画質劣化が起こるということはない。
Next, a modification common to the first embodiment and the second embodiment will be described.
FIG. 17 is a diagram illustrating an input image in which the background color and the foreground color are switched in the image area.
In the first embodiment and the second embodiment, the color with the higher appearance frequency of the solid area is set as the background color. Therefore, for example, as shown in FIG. An erroneous determination occurs in an image area in which the color is the foreground color (the white character portion in the figure).
In such a portion, processing is performed so as to preserve the background side property, and as a result, the thin line may disappear. In order to deal with such a case, exceptionally, when the background color is a thin line, the foreground color and the background color may be exchanged.
Further, the solid area counting unit 530 may limit an image area in which the number of appearances of the solid area is counted. That is, the solid area counting unit 530 may initialize the number of appearances of the solid area for each predetermined image area and count the solid area for each image area.
In the second embodiment, when the color having the higher appearance frequency in the entire image is the foreground color, the average value is reduced. Therefore, even if such deformation processing is not performed, the obtained image quality is an average-value-reduced image quality, and there is no case where the background color and the foreground color are mistaken to cause a large image quality deterioration.

本発明にかかる画像処理方法が適応される画像処理装置2のハードウェア構成を、制御装置20を中心に例示する図である。It is a figure which illustrates the hardware constitutions of the image processing apparatus 2 with which the image processing method concerning this invention is applied centering on the control apparatus 20. FIG. 制御装置20(図1)により実行され、本発明にかかる画像処理方法を実現する画像処理プログラム5の機能構成を例示する図である。It is a figure which illustrates the functional structure of the image processing program 5 which is performed by the control apparatus 20 (FIG. 1) and implement | achieves the image processing method concerning this invention. 図2に示された画素値選択部550の機能をより詳細に説明する図である。It is a figure explaining the function of the pixel value selection part 550 shown by FIG. 2 in detail. ブロック抽出部510(図2)により設定される注目ブロック及び画像ブロックを例示する図である。It is a figure which illustrates the attention block and image block which are set by the block extraction part 510 (FIG. 2). (A)は、算出方法決定部525(図2)により選択される縮小法(縮小画素値の決定方法)を例示し、(B)は、ベタ領域計数部530(図2)により計数される計数値を例示する図である。(A) illustrates a reduction method (reduction pixel value determination method) selected by the calculation method determination unit 525 (FIG. 2), and (B) is counted by the solid region counting unit 530 (FIG. 2). It is a figure which illustrates a count value. 特定パターン判定部556(図3)により判定される特定パターンを例示する図である。It is a figure which illustrates the specific pattern determined by the specific pattern determination part 556 (FIG. 3). (A)は、起点パターン登録部562により検出される起点を例示し、(B)は、終点パターン判定部566により検出される終点を例示し、(C)は、終点パターン判定部566による判定結果を例示する図である。(A) illustrates the start point detected by the start point pattern registration unit 562, (B) illustrates the end point detected by the end point pattern determination unit 566, and (C) illustrates determination by the end point pattern determination unit 566. It is a figure which illustrates a result. 画像処理プログラム5による画像処理(S10)の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the image processing (S10) by the image processing program 5. FIG. 図8に示された画素値選択処理(S20)のフローチャートである。It is a flowchart of the pixel value selection process (S20) shown in FIG. 第2の画像処理プログラム52の機能構成を例示する図である。3 is a diagram illustrating a functional configuration of a second image processing program 52. FIG. 例外処理部580による補正処理を説明する図である。It is a figure explaining the correction process by the exception process part 580. FIG. 第2の画素値選択部650の機能構成を例示する図である。FIG. 10 is a diagram illustrating a functional configuration of a second pixel value selection unit 650. 特定パターン判定部652(図12)により判定される特定パターンを例示する図である。It is a figure which illustrates the specific pattern determined by the specific pattern determination part 652 (FIG. 12). 第2の実施形態における画素値選択処理(S24)のフローチャートである。It is a flowchart of the pixel value selection process (S24) in 2nd Embodiment. 第3の画素値選択部651の機能構成を例示する図である。It is a figure which illustrates the function structure of the 3rd pixel value selection part 651. (A)は、透過型パターンを例示し、(B)は、三色文字のパターンを例示し、(C)は、太線部のパターンを例示する図である。(A) illustrates a transmissive pattern, (B) illustrates a three-color character pattern, and (C) illustrates a bold line pattern. 背景色と前景色とは画像領域で切り替わっている入力画像を例示する図である。It is a figure which illustrates the input image which the background color and the foreground color have switched in the image area.

符号の説明Explanation of symbols

2・・・画像処理装置
5・・・画像処理プログラム
500・・・画像入力部
505・・・記憶部
510・・・ブロック抽出部
515・・・ベタ領域判定部
520・・・色数判定部
525・・・算出方法決定部
530・・・ベタ領域計数部
540・・・画素値決定部
545・・・平均値算出部
550、650・・・画素値選択部
570・・・単一値出力部
590・・・画像出力部
DESCRIPTION OF SYMBOLS 2 ... Image processing apparatus 5 ... Image processing program 500 ... Image input part 505 ... Memory | storage part 510 ... Block extraction part 515 ... Solid area determination part 520 ... Color number determination part 525: Calculation method determining unit 530: Solid region counting unit 540: Pixel value determining unit 545 ... Average value calculating unit 550, 650: Pixel value selecting unit 570: Single value output 590 ... Image output unit

Claims (13)

入力画像に対して、縮小処理の対象となる注目領域と、この注目領域の周囲にある周囲領域とからなる既定サイズの画像領域を複数設定する領域設定手段と、
前記領域設定手段により設定された画像領域に含まれる色の数と、既定の基準値C(Cは2以上の値)との大小関係を判定する色数判定手段と、
前記領域選択手段により設定された画像領域毎に、注目領域が縮小された縮小領域からなる縮小画像を構成する階調値の決定方法として、色の数が前記基準値Cよりも大きい場合には、階調値の平均化処理を用いる方法を選択し、色の数が前記基準値C以下である場合には、含まれている階調値のうちの1つを縮小画像の階調値とする方法を選択する選択手段と、
画像領域に含まれる色の数が前記基準値Cよりも大きい場合に、注目領域の平均階調値を、この注目領域に対応する縮小領域の階調値とし、画像領域に含まれる色の数が前記基準値C以下である場合に、注目領域に含まれている階調値のうちの1つを、この注目領域に対応する縮小領域の階調値とする階調値決定手段と
を有する画像処理装置。
An area setting means for setting a plurality of image areas of a predetermined size including an attention area to be subjected to reduction processing and surrounding areas around the attention area for the input image;
A number-of-colors determining unit that determines a magnitude relationship between the number of colors included in the image region set by the region setting unit and a predetermined reference value C (C is a value of 2 or more);
For each image area set by the area selection means, as a method for determining a gradation value constituting a reduced image composed of a reduced area in which the attention area is reduced , when the number of colors is larger than the reference value C, When the method using the gradation value averaging process is selected and the number of colors is equal to or less than the reference value C, one of the included gradation values is set as the gradation value of the reduced image. A selection means for selecting a method to be performed;
When the number of colors included in the image area is larger than the reference value C, the average gradation value of the attention area is set as the gradation value of the reduction area corresponding to the attention area, and the number of colors included in the image area Gradation value determining means that uses one of the gradation values included in the attention area as the gradation value of the reduced area corresponding to the attention area when the reference value C is equal to or less than the reference value C. Image processing device.
それぞれの画像領域には、縮小処理の対象となる注目領域が含まれており、
前記階調値決定手段は、前記注目領域に含まれる色の数が1である場合に、この画像領域に含まれる階調値を、この注目領域に対応する縮小画像の階調値とし、
1色のみからなる注目領域の数を、それぞれの色毎に計数するベタ領域計数手段
をさらに有する請求項1に記載の画像処理装置。
Each image area contains a region of interest to be reduced,
When the number of colors included in the attention area is 1, the gradation value determining means sets the gradation value included in the image area as the gradation value of the reduced image corresponding to the attention area,
The image processing apparatus according to claim 1, further comprising a solid area counting unit that counts the number of attention areas including only one color for each color.
前記色数判定手段は、前記画像領域それぞれに含まれる色の数と基準値Cとの大小関係を判定し、
前記選択手段は、色の数が基準値C以下となる画像領域について、前記ベタ領域計数手段により計数された計数値を用いた階調値の決定方法を選択する
請求項2に記載の画像処理装置。
The number-of-colors determining unit determines a magnitude relationship between the number of colors included in each of the image regions and a reference value C;
3. The image processing according to claim 2, wherein the selection unit selects a gradation value determination method using the count value counted by the solid region counting unit for an image region in which the number of colors is equal to or less than a reference value C. 4. apparatus.
色の数が基準値C以下となる画像領域において、他の画像を透過させる透過領域が規則的に設けられた透過型パターンの有無を判定する透過型パターン判定手段
をさらに有し、
前記選択手段は、前記透過型パターン判定手段により透過型パターンが存在すると判定された画像領域について、階調値の平均化処理を用いる方法を選択する
請求項1又は3に記載の画像処理装置。
In the image area where the number of colors is equal to or less than the reference value C, the image processing apparatus further includes a transmission pattern determination unit that determines the presence or absence of a transmission pattern in which transmission areas for transmitting other images are regularly provided
The image processing apparatus according to claim 1, wherein the selection unit selects a method that uses gradation value averaging processing for an image region that is determined to have a transmission pattern by the transmission pattern determination unit.
入力画像で出現する複数の色それぞれの出現頻度を評価し、それぞれの色に対する評価値を生成する頻度評価手段
をさらに有し、
前記階調値決定手段は、前記領域設定手段により設定された注目領域に複数の色が含まれている場合に、この注目領域に含まれている複数の色の中から、前記頻度評価手段により生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を縮小画像の階調値とする
請求項1に記載の画像処理装置。
A frequency evaluation means for evaluating the appearance frequency of each of a plurality of colors appearing in the input image and generating an evaluation value for each color;
When the attention area set by the area setting means includes a plurality of colors, the gradation value determination means uses the frequency evaluation means from the plurality of colors included in the attention area. The image processing apparatus according to claim 1, wherein one color is selected based on the generated evaluation value, and a gradation value corresponding to the selected color is set as a gradation value of the reduced image.
前記評価値は、入力画像における、単一の色のみからなる注目領域の出現回数であり、
前記頻度評価手段は、前記領域設定手段により設定された複数の注目領域において、単一の色のみからなる注目領域の出現回数を、それぞれの色毎に計数し、
前記階調値決定手段は、前記頻度評価手段により色毎に計数された出現回数に基づいて、縮小画像の階調値を決定する
請求項5に記載の画像処理装置。
The evaluation value is the number of appearances of a region of interest consisting of only a single color in the input image,
The frequency evaluation means counts the number of appearances of an attention area consisting of only a single color in each of the plurality of attention areas set by the area setting means,
The image processing apparatus according to claim 5, wherein the gradation value determining unit determines a gradation value of the reduced image based on the number of appearances counted for each color by the frequency evaluation unit.
前記注目領域を含む画像領域において、既定の階調変化パターンが存在するか否かを判定するパターン判定手段
をさらに有し、
前記階調値決定手段は、前記パターン判定手段により画像領域に階調変化パターンが存在すると判定された場合に、この画像領域に含まれる注目領域の色の中から、前記頻度評価手段により生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を、この注目領域に対応する縮小画像の階調値とする
請求項5に記載の画像処理装置。
Pattern determining means for determining whether or not a predetermined gradation change pattern exists in the image region including the region of interest;
The gradation value determination means is generated by the frequency evaluation means from the colors of the attention area included in the image area when the pattern determination means determines that a gradation change pattern exists in the image area. The image processing apparatus according to claim 5, wherein one color is selected based on the evaluated value, and a gradation value corresponding to the selected color is set as a gradation value of a reduced image corresponding to the region of interest.
前記階調値決定手段は、前記パターン判定手段により画像領域において階調変化パターンが存在すると判定された場合に、この画像領域に含まれる注目領域の色それぞれに対応する前記評価値を互いに比較し、出現頻度が最も低いと評価される色を選択する
請求項7に記載の画像処理装置。
The gradation value determination means compares the evaluation values corresponding to the colors of the attention area included in the image area when the pattern determination means determines that a gradation change pattern exists in the image area. The image processing apparatus according to claim 7, wherein a color that is evaluated to have the lowest appearance frequency is selected.
入力画像に含まれる画像要素の一端と、この一端が含まれる前記注目領域との関係、及び、前記画像要素の他端と、この他端が含まれる注目領域との関係に基づいて、注目領域に含まれる階調値の中から、縮小画像に適用すべき階調値を選択する階調値選択手段
をさらに有する請求項1に記載の画像処理装置。
The attention area based on the relationship between one end of the image element included in the input image and the attention area including the one end, and the relationship between the other end of the image element and the attention area including the other end. The image processing apparatus according to claim 1, further comprising: a gradation value selecting unit that selects a gradation value to be applied to the reduced image from the gradation values included in the image.
入力画像に対して、縮小処理の対象となる注目領域と、この注目領域の周囲にある周囲領域とからなる既定サイズの画像領域を複数設定し、
設定された画像領域に含まれる色の数と、既定の基準値C(Cは2以上の値)との大小関係を判定し、
設定された画像領域毎に、注目領域が縮小された縮小領域からなる縮小画像を構成する階調値の決定方法として、色の数が前記基準値Cよりも大きい場合には、階調値の平均化処理を用いる方法を選択し、色の数が前記基準値C以下である場合には、含まれている階調値のうちの1つを縮小画像の階調値とする方法を選択し、
画像領域に含まれる色の数が前記基準値Cよりも大きい場合に、注目領域の平均階調値を、この注目領域に対応する縮小領域の階調値とし、画像領域に含まれる色の数が前記基準値C以下である場合に、注目領域に含まれている階調値のうちの1つを、この注目領域に対応する縮小領域の階調値とする
画像処理方法。
For the input image, set multiple image areas of a default size consisting of an attention area to be reduced and surrounding areas around the attention area.
Determining the magnitude relationship between the number of colors included in the set image area and a predetermined reference value C (C is a value of 2 or more);
For each set image area, as a method for determining a gradation value constituting a reduced image composed of a reduced area in which the attention area is reduced , when the number of colors is larger than the reference value C, the gradation value When a method using averaging processing is selected and the number of colors is equal to or less than the reference value C, a method is selected in which one of the included gradation values is used as the gradation value of the reduced image. ,
When the number of colors included in the image area is larger than the reference value C, the average gradation value of the attention area is set as the gradation value of the reduction area corresponding to the attention area, and the number of colors included in the image area Is a reference value C or less, an image processing method in which one of the gradation values included in the attention area is set as the gradation value of the reduced area corresponding to the attention area.
入力画像で出現する複数の色それぞれの出現頻度を評価し、それぞれの色に対する評価値を生成し、
設定された注目領域に複数の色が含まれている場合に、この注目領域に含まれている複数の色の中から、生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を縮小画像の階調値とする
請求項10に記載の画像処理方法。
Evaluate the appearance frequency of each of multiple colors that appear in the input image, generate an evaluation value for each color,
When a plurality of colors are included in the set attention area, one color is selected from the plurality of colors included in the attention area based on the generated evaluation value. The image processing method according to claim 10, wherein a gradation value corresponding to a selected color is used as a gradation value of a reduced image.
入力画像に対して、縮小処理の対象となる注目領域と、この注目領域の周囲にある周囲領域とからなる既定サイズの画像領域を複数設定するステップと、
設定された画像領域に含まれる色の数と、既定の基準値C(Cは2以上の値)との大小関係を判定するステップと、
設定された画像領域毎に、注目領域が縮小された縮小領域からなる縮小画像を構成する階調値の決定方法として、色の数が前記基準値Cよりも大きい場合には、階調値の平均化処理を用いる方法を選択し、色の数が前記基準値C以下である場合には、含まれている階調値のうちの1つを縮小画像の階調値とする方法を選択するステップと、
画像領域に含まれる色の数が前記基準値Cよりも大きい場合に、注目領域の平均階調値を、この注目領域に対応する縮小領域の階調値とし、画像領域に含まれる色の数が前記基準値C以下である場合に、注目領域に含まれている階調値のうちの1つを、この注目領域に対応する縮小領域の階調値とするステップと
をコンピュータに実行させるプログラム。
A step of setting a plurality of image areas of a predetermined size including an attention area to be subjected to a reduction process and surrounding areas around the attention area for the input image;
Determining a magnitude relationship between the number of colors included in the set image area and a predetermined reference value C (C is a value of 2 or more);
For each set image area, as a method for determining a gradation value constituting a reduced image composed of a reduced area in which the attention area is reduced , when the number of colors is larger than the reference value C, the gradation value A method using averaging processing is selected, and when the number of colors is equal to or less than the reference value C, a method is selected in which one of the included gradation values is used as the gradation value of the reduced image. Steps,
When the number of colors included in the image area is larger than the reference value C, the average gradation value of the attention area is set as the gradation value of the reduction area corresponding to the attention area, and the number of colors included in the image area When the value is equal to or smaller than the reference value C, the program causes the computer to execute one of the gradation values included in the attention area as the gradation value of the reduced area corresponding to the attention area. .
入力画像で出現する複数の色それぞれの出現頻度を評価し、それぞれの色に対する評価値を生成するステップと、
設定された注目領域に複数の色が含まれている場合に、この注目領域に含まれている複数の色の中から、生成された評価値に基づいて、1つの色を選択し、選択された色に対応する階調値を縮小画像の階調値とするステップと
をさらにコンピュータに実行させる請求項12に記載のプログラム。
Evaluating the appearance frequency of each of a plurality of colors appearing in the input image, and generating an evaluation value for each color;
When a plurality of colors are included in the set attention area, one color is selected from the plurality of colors included in the attention area based on the generated evaluation value. The program according to claim 12, further causing the computer to execute a step of setting the gradation value corresponding to the selected color to the gradation value of the reduced image.
JP2005215743A 2005-07-26 2005-07-26 Image processing apparatus, image processing method, and program thereof Expired - Fee Related JP4507279B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005215743A JP4507279B2 (en) 2005-07-26 2005-07-26 Image processing apparatus, image processing method, and program thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005215743A JP4507279B2 (en) 2005-07-26 2005-07-26 Image processing apparatus, image processing method, and program thereof

Publications (2)

Publication Number Publication Date
JP2007036560A JP2007036560A (en) 2007-02-08
JP4507279B2 true JP4507279B2 (en) 2010-07-21

Family

ID=37795283

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005215743A Expired - Fee Related JP4507279B2 (en) 2005-07-26 2005-07-26 Image processing apparatus, image processing method, and program thereof

Country Status (1)

Country Link
JP (1) JP4507279B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008252680A (en) * 2007-03-30 2008-10-16 Omron Corp Program for portable terminal device, and the portable terminal device
JP2010093725A (en) * 2008-10-10 2010-04-22 Brother Ind Ltd Image processing apparatus and image size reduction method
JP5307661B2 (en) * 2009-08-06 2013-10-02 キヤノン電子株式会社 Color misregistration determination apparatus, color misregistration correction apparatus, and image reading apparatus
US8154617B2 (en) 2009-09-30 2012-04-10 Sony Corporation Method of detecting the existence of visually sensitive thin lines in a digital image
JP5383459B2 (en) * 2009-12-02 2014-01-08 キヤノン株式会社 Image processing apparatus and computer program
JP5679284B2 (en) * 2010-10-27 2015-03-04 Necエンジニアリング株式会社 Pixel number conversion method, program for executing the same, and pixel number conversion device
JP7439661B2 (en) 2020-07-03 2024-02-28 セイコーエプソン株式会社 Image processing method, image processing device, and recording system
WO2022153476A1 (en) * 2021-01-15 2022-07-21 日本電信電話株式会社 Video processing device, video processing method, and video processing program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10178539A (en) * 1996-12-17 1998-06-30 Fuji Xerox Co Ltd Image processing unit and image processing method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10178539A (en) * 1996-12-17 1998-06-30 Fuji Xerox Co Ltd Image processing unit and image processing method

Also Published As

Publication number Publication date
JP2007036560A (en) 2007-02-08

Similar Documents

Publication Publication Date Title
JP4507279B2 (en) Image processing apparatus, image processing method, and program thereof
JP4568460B2 (en) Image processing apparatus and recording medium
JP5874721B2 (en) Image processing apparatus, image correction method, and program
JPH0750752A (en) Method and device for converting picture density
JP2002142128A (en) Image processing device and recording medium
KR100524072B1 (en) Method for improving image quality
JP4501791B2 (en) Image processing method and image processing program
JPH1185978A (en) Image processor and its method
JP3689607B2 (en) Image processing method, apparatus, and storage medium
JP5151708B2 (en) Image processing apparatus and image processing program
JP4264051B2 (en) Image processing device
JP4716255B2 (en) Image processing apparatus, image processing method, and program thereof
JP4089862B2 (en) Image forming apparatus, image forming method, and recording medium
JP2013102300A (en) Image processor and image processing method
JP3888090B2 (en) Image processing apparatus and image processing method
JP4265363B2 (en) Image processing device
JP5878167B2 (en) How to restore raster image edges
JP3669081B2 (en) Image processing device
JP2005235238A (en) Method and apparatus of image processing and storage medium
JP4730525B2 (en) Image processing apparatus and program thereof
JP2015106318A (en) Image processor and image processing method
JP2006050481A (en) Image processing apparatus, image processing method and program thereof
JP4311292B2 (en) Image processing apparatus, image processing method, and program thereof
JP2005039483A (en) Apparatus and method for image processing, and program for making computer execute the method
JP2006252108A (en) Image processing device, image processing method, and its program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080423

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091019

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091111

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100104

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100127

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100326

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100425

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

Free format text: PAYMENT UNTIL: 20130514

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4507279

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140514

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees