JP6866107B2 - Image processing equipment, image processing methods, and programs - Google Patents
Image processing equipment, image processing methods, and programs Download PDFInfo
- Publication number
- JP6866107B2 JP6866107B2 JP2016208561A JP2016208561A JP6866107B2 JP 6866107 B2 JP6866107 B2 JP 6866107B2 JP 2016208561 A JP2016208561 A JP 2016208561A JP 2016208561 A JP2016208561 A JP 2016208561A JP 6866107 B2 JP6866107 B2 JP 6866107B2
- Authority
- JP
- Japan
- Prior art keywords
- line
- candidate line
- determined
- pixels
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims description 10
- 230000009467 reduction Effects 0.000 claims description 116
- 238000000034 method Methods 0.000 claims description 87
- 230000008569 process Effects 0.000 claims description 64
- 238000005457 optimization Methods 0.000 claims description 41
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 9
- 238000011946 reduction process Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 5
- 238000009877 rendering Methods 0.000 description 5
- 239000003086 colorant Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001502 supplementing effect Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
Description
本発明は、ユーザからの印刷指示に応じてグラフィックスエンジンから送信される描画データに基づき、印刷装置が解釈可能な印刷データを生成する技術に関する。 The present invention relates to a technique for generating print data that can be interpreted by a printing apparatus based on drawing data transmitted from a graphics engine in response to a print instruction from a user.
文字や細線を含むドキュメントを印刷する際、アプリケーションからプリンタドライバに対して、テキスト描画命令やライン描画命令ではなくイメージ描画命令として、描画命令が送られるケースがある。例えば、ドキュメントをスキャンして生成したイメージや、細線の組み合わせで表現したパターン描画イメージがドキュメントに含まれる場合である。また、文字や細線に対して透過やグラデーションのような装飾をアプリケーションで施した場合も、イメージ描画命令がプリンタドライバに送られる。 When printing a document containing characters and thin lines, there are cases where the application sends a drawing command to the printer driver as an image drawing command instead of a text drawing command or a line drawing command. For example, the document may include an image generated by scanning the document or a pattern drawing image represented by a combination of thin lines. Also, when the application applies decoration such as transparency or gradation to characters and thin lines, an image drawing command is sent to the printer driver.
プリンタドライバにおいてイメージ属性の文字や細線を縮小する場合、バイリニア、バイキュービック、単純間引き(ニアレストネイバ)といった縮小方法が用いられる。バイリニアやバイキュービックといった補間アルゴリズムは、縮小しても細線が消えるようなことはないが、文字や細線のエッジ部分の鮮鋭性が失われる。一方、単純間引きでは鮮鋭性を保つことができるが、文字フォントや細線幅や描画位置によっては、文字や細線の一部が欠落してしまう場合がある。 When reducing the characters and thin lines of image attributes in the printer driver, reduction methods such as bilinear, bicubic, and simple thinning (nearest neighbor) are used. Interpolation algorithms such as bilinear and bicubic do not eliminate thin lines when reduced, but lose the sharpness of the edges of characters and thin lines. On the other hand, although sharpness can be maintained by simple thinning, some characters and thin lines may be missing depending on the character font, fine line width, and drawing position.
そこで、単純間引きであっても文字や線が消えないように縮小する方法が提案されている(特許文献1)。特許文献1に記載の方法では、注目ラインとその1つ前のライン(前ライン)とを比較して、データが一致する場合に注目ラインを間引くことで、縮小処理に伴う文字や線の欠落を防止している。
Therefore, a method has been proposed in which characters and lines are reduced so as not to disappear even with simple thinning (Patent Document 1). In the method described in
特許文献1に記載の方法では、所定ライン数の周期で(例えば10ラインごとに)間引き処理が繰り返されるが、各周期において早い段階で注目ラインと前ラインとのデータが一致しない場合、ラインの比較回数が多くなり処理コストを増大させる可能性がある。また、特許文献1に記載の方法では、注目ラインと前ラインとを比較する際、1画素ごとに一致するかを判定しているため、処理コストをさらに増大させる可能性がある。
In the method described in
そこで、本発明は、単純間引きによる画像縮小処理において生じる文字や線の欠落を、より少ない処理コストで防ぐことができる画像処理装置、画像処理方法、およびプログラムを提供することを目的とする。 Therefore, an object of the present invention is to provide an image processing apparatus, an image processing method, and a program capable of preventing the loss of characters and lines that occur in the image reduction processing by simple thinning at a lower processing cost.
本発明に係る画像処理装置は、アプリケーションにより生成される描画データに対してライン単位の間引き処理を行う画像処理装置であって、前記描画データによって示される画像からイメージ領域を取得する取得手段と、前記取得手段が取得したイメージ領域に対して縮小命令がなされているか否かを判定する判定手段と、前記判定手段によって前記縮小命令がなされていると判定された場合に、前記取得手段が取得したイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成手段と、前記縮小命令で指定される縮小率と前記生成手段が生成したヒストグラムとに基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引き手段と、を備え、前記間引き手段は、前記縮小率に基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定する決定手段と、前記決定手段が決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化手段と、を含み、前記最適化手段は、前記決定手段が決定した候補ラインの前後のラインのいずれかを、新たな候補ラインとして決定し直す場合において、前記決定手段が決定した候補ラインの直前のラインが、すでに決定された他の候補ラインと連続すると判断した場合には、前記決定手段が決定した候補ラインの直後のラインを新たな候補ラインとして決定し直すことを特徴とする。
The image processing device according to the present invention is an image processing device that performs line-by-line thinning processing on drawing data generated by an application, and is an acquisition means for acquiring an image area from an image indicated by the drawing data. A determination means for determining whether or not a reduction command has been issued for the image area acquired by the acquisition means, and an acquisition means for determining whether or not the reduction command has been issued by the determination means. A generation means for generating a histogram showing the number of black pixels in each line of an image obtained by binarizing the pixels constituting the image region, a reduction ratio specified by the reduction command, and a histogram generated by the generation means. A candidate line to be thinned out from the image area acquired by the acquisition means is determined based on the above, and the candidate line is thinned out from the image area. The thinning means is provided with the thinning means based on the reduction ratio. The determination means for determining the candidate lines to be thinned out from the image area acquired by the determination means, and the candidate lines determined by the determination means are the lines corresponding to the peaks of the histogram, and the candidate lines have predetermined pixels. A black pixel group in which a number or more of black pixels are continuous is included, and further, white pixels having a predetermined number of pixels or more are continuous in the lines before and after the candidate line so as to be adjacent to the black pixel group. When a pixel group is included, the optimization means includes an optimization means for executing an optimization process of redetermining any of the lines before and after the candidate line as a new candidate line, and the optimization means is the determination means. When any of the lines before and after the candidate line determined by is redetermined as a new candidate line, the line immediately before the candidate line determined by the determination means is continuous with the other candidate lines already determined. When it is determined, the line immediately after the candidate line determined by the determination means is redetermined as a new candidate line .
本発明によれば、単純間引きによる画像縮小処理において生じる文字や線の欠落を、より少ない処理コストで防ぐことができる。 According to the present invention, it is possible to prevent the loss of characters and lines that occur in the image reduction processing by simple thinning at a lower processing cost.
以下、本発明を実施するための第1の形態について図面を用いて説明する。なお、以下の実施例において示す構成は一例に過ぎず、本発明は図示された構成に限定されるものではない。 Hereinafter, the first embodiment for carrying out the present invention will be described with reference to the drawings. The configuration shown in the following examples is only an example, and the present invention is not limited to the illustrated configuration.
[実施例1]
図1は、第1の実施例に係る印刷システムの構成の一例を示すブロック図である。本実施例に係る印刷システムは、パーソナルコンピュータ(PC)(以下、画像処理装置ともいう。)10と、プリンタ(以下、印刷装置ともいう。)20と、を備える。PC10とプリンタ20とは、LAN1を介して接続される。LAN1はイーサーネットの通信方式に対応している。LAN1は、有線と無線のいずれの接続形態であっても良い。またPC10とプリンタ20は、LAN1の代わりに、Bluetooth(登録商標)やUSBなどで接続されていても良い。
[Example 1]
FIG. 1 is a block diagram showing an example of the configuration of the printing system according to the first embodiment. The printing system according to this embodiment includes a personal computer (PC) (hereinafter, also referred to as an image processing device) 10 and a printer (hereinafter, also referred to as a printing device) 20. The PC 10 and the
図2は、図1に示すPC10のハードウェア構成の一例を示すブロック図である。PC10は、図2に示すように、CPU101と、RAM102と、ROM103、ネットワークI/F105と、キーボードI/F106と、ディスプレイI/F107と、外部メモリI/F108と、を含む。各デバイスは、システムバス104で接続される。また、PC10は、キーボード109と、ディスプレイ110と、メモリ111とを含む。なお、キーボード109、ディスプレイ110、及び、メモリ111は、PC10の外部に配置されていてもよい。
FIG. 2 is a block diagram showing an example of the hardware configuration of the
CPU101は、RAM102に記憶されているプログラムに従って、システムバス104に接続される各デバイスを総括的に制御する。RAM102は、CPU101の主メモリ、ワークエリア等として機能する。ROM103は、各種プログラム及びデータを格納する。ROM103は、各種フォントを記憶するフォントROM103a、ブートプログラムやBIOS等を記憶するプログラムROM103b、及び、各種データを記憶するデータROM103cを有する。ネットワークI/F105は、本実施例ではLAN1に接続され、プリンタ20などLAN1に接続された各装置との通信処理を行なう。キーボードコントローラI/F106は、キーボード109や不図示のポインティングデバイス(例えばマウス)からのキー入力を制御する。ディスプレイI/F107は、ディスプレイ110に対する表示処理を制御する。外部メモリI/F108は、ハードディスク(HD)等のメモリ111とのアクセスを制御する。メモリ111は、オペレーティングシステム(OS)112や、印刷システムを担うソフトウェア113や、ユーザファイル、編集ファイル等を含むデータ114を記憶する。なお、本実施例では、OS112としてMicrosoft Windows(登録商標)が使用されるものとする。
The
図3は、図1に示すPC10の機能構成の一例を示すブロック図である。アプリケーション11は、ユーザの指示に基づきドキュメントを作成する。またアプリケーション11は、作成したドキュメントに対する印刷指示をユーザから受け付けると、GDI12を用いて、ドキュメントの内容に応じた描画データを生成する。具体的には、アプリケーション11に対して印刷指示がユーザによって与えられると、アプリケーション11は、GDI(Graphics Device Interface)のサービス関数群を呼び出す。それにより、GDI12から、GDI描画命令が発行される。プリンタドライバ13は、GDI12が発行するGDI描画命令により構成される描画データ(以下、「GDI形式の描画データ」と呼ぶ。)を、プリンタ20が解釈可能は印刷データ(いわゆるPDL(Printer Description Language)データ)に変換し、プリンタ20に出力する。プリンタドライバ13では、単一または複数のフィルタが順に実行される。フィルタは、印刷処理の単位である。すなわち、あるフィルタの出力がその次に連結されたフィルタの入力となり、各フィルタが順次実行される。それにより、プリンタ20に送信するためのPDLデータが生成される。本実施例では、プリンタドライバ13は、レイアウト処理を行うレイアウトフィルタ14と、レンダリング処理を行うレンダリングフィルタ15とを有する。レイアウトフィルタ14は、入力されたGDI関数に対してNup処理などのレイアウト処理を行う。Nup処理とは、Nページの論理ページを1ページの物理ページに縮小配置して印刷する処理である。レンダリングフィルタ15は、入力されたレイアウト処理済みの描画データに対し、拡大縮小、回転などの画像処理を適用して描画オブジェクトを生成し、PDLデータに変換する。描画データの縮小処理については、アプリケーション11で予め実行される場合と、プリンタドライバ13で縮小処理を行う場合とがある。本実施例における縮小処理は、プリンタドライバ13のレンダリングフィルタ15が有する縮小処理部17にて実行される。ポートモニタ16は、PDLデータをプリンタ20にLAN1を通じて送信する。なお、ここでは、グラフィックスエンジンとしてGDIを例にして説明したが、GDI12の代わりに、その他のグラフィックスエンジンが用いられてもよい。
FIG. 3 is a block diagram showing an example of the functional configuration of the
次に、プリンタドライバ13における縮小処理を説明する。図4は、第1の実施形態における描画イメージの縮小処理を示すフローチャートである。図5は、描画イメージと、当該描画イメージから生成されるヒストグラムとの一例を示す説明図である。ここでは、縮小処理の対象として、図5(a)に示す「電」という描画イメージ501を例にする。
Next, the reduction process in the
ステップS401において、プリンタドライバ13のレンダリングフィルタ15の縮小処理部17は、アプリケーション11を介して印刷指示がなされたドキュメント内に存在する、描画イメージを1つずつ取得する。具体的には、縮小処理部17は、GDI12が発行するGDI描画命令の中から、イメージ描画命令を1つずつ取得する。それにより、印刷指示がなされたドキュメントに含まれるイメージ属性の領域(描画イメージ)が取得される。以下、描画イメージをイメージ領域ともいう。
In step S401, the
ステップS402において、縮小処理部17は、上記描画イメージに対して縮小命令がなされているか確認する。具体的には、縮小処理部17は、イメージ描画命令に、縮小命令が付随しているかを確認する。縮小命令がなされている場合は、処理はステップS403に進む。一方、縮小命令がなされていない場合は、処理はステップS408に進む。
In step S402, the
ステップS403において、縮小処理部17は、描画イメージ501を白黒2値画像に変換する。二値化の方法としては、描画イメージが8bitのグレースケール画像であって、白画素の画素値が0、黒画素の画素値が255である場合、画素値が255未満である画素の画素値を0とする方法がある。なお、縮小処理の対象を、純黒の文字や細線ではなく、ある程度の濃さを有する文字や細線とする場合には、所望の濃さに相当する閾値を設定した二値化や、大津の二値化アルゴリズムに従った二値化などを適用すればよい。
In step S403, the
ステップS404において、縮小処理部17は、描画イメージ501のヒストグラムを生成する。図5(a)に、「電」という文字の描画イメージ501と、そのY方向について生成したヒストグラム503を示す。ヒストグラム503は、描画イメージ501のY方について、各ラインにおける黒画素数を表している。なお、縮小処理部17は、描画イメージ501のX方向についても同様にヒストグラム(図示せず)を生成する。ここで、Y方向は、ドキュメント印刷時の副走査方向に対応する方向である。X方向は、ドキュメント印刷時の主走査方向に対応する方向である。
In step S404, the
ステップS405において、縮小処理部17は、生成したヒストグラムに基づいて、間引き最適化対象領域があるか、つまりライン単位の間引き処理を適用した場合に欠落する可能性がある文字や細線を含む領域があるかを判定する。以下、間引き最適化対象領域を文字領域ともいう。例えばヒストグラム503を見ると、破線505より小さいY座標と、破線506より大きいY座標のヒストグラムの値(度数)は0が続いていて、破線505と破線506とに挟まれたY座標の度数は0以上となっている。このように、ヒストグラムの度数が0であるラインが予め設定したライン数(以下、境界判定ライン数と呼ぶ。)以上続く場合には、文字や細線の境界と判断できる。それにより、破線505と破線506に挟まれた領域に文字や細線があると推定される。同様の処理がX方向においても行われるが、ここでは説明を省略する。領域507は、文字や細線があると推定された、間引き最適化対象領域である。
In step S405, the
間引き最適化対象領域があると判定された場合は(ステップS405のYES)、縮小処理部17は、ステップS406の処理に進む。間引き最適化対象領域がないと判定された場合は(ステップS405のNO)、縮小処理部17は、ステップS407の処理に進んで、通常の単純間引きによる縮小処理を行い、ステップS408の処理に進む。ここで、通常の単純間引きによる縮小処理とは、上記縮小命令により指定される縮小率に基づき、規則的ラインを間引く処理である。なお、境界判定ライン数をいくつに設定するかにより、文字領域内に含まれる文字や細線の数は異なる。
If it is determined that there is a thinning optimization target area (YES in step S405), the
ステップS406において、縮小処理部17は、文字領域507に対して特別間引き処理を行い、文字領域以外に対しては通常の間引き処理を行う。ステップS406の特別間引き処理の詳細については、図6を用いて後述する。そして、処理はステップS408に進む。
In step S406, the
ステップS408において、縮小処理部17は、ドキュメント内に他に描画イメージが存在するか判定する。描画イメージが存在すれば(ステップS408のYES)、縮小処理部17は、ステップS401の処理に戻り、次の描画イメージに対してステップS401〜S407の処理を繰り返す。描画イメージがなければ(ステップS408のNO)、縮小処理部17は処理を終了する。
In step S408, the
なお、ここでは、縮小処理の対象となる描画イメージに1つの文字が含まれる場合を例にしたが、描画イメージには複数の文字が含まれていてもよい。また、上記の処理は、文字以外の細線などにも適用可能である。 Here, the case where one character is included in the drawing image to be reduced is taken as an example, but the drawing image may include a plurality of characters. Further, the above processing can be applied to thin lines other than characters.
続いて、ステップS406の特別間引き処理について、図6を用いて説明する。図6は、第1の実施例における特別間引き処理を示すフローチャートである。図7は、特別間引き処理を説明するための図である。 Subsequently, the special thinning process in step S406 will be described with reference to FIG. FIG. 6 is a flowchart showing the special thinning process in the first embodiment. FIG. 7 is a diagram for explaining the special thinning process.
ステップS601において、縮小処理部17は、上記縮小命令により指定される縮小率に基づき、描画イメージ501において、間引き対象となるライン(以下、間引き対象ラインまたは候補ラインと呼ぶ。)を決定する。実際には、間引き対象ラインの座標が算出される。図7(a)には、文字領域507の拡大図が示されている。例えば文字領域507が2/3に縮小される場合、3ラインごとに1ライン間引かれる。つまり、このときの間引き対象ラインは、図7(a)において斜線の矢印で示すラインとなる。なお、上述したように、文字領域以外の領域、すなわち、ヒストグラムにおける度数が0であるラインが所定のライン数以上続く領域については、通常の間引き処理が適用される。したがって、以下では、描画イメージ501内の文字領域507以外の領域に対して行われる処理については説明を省略する。
In step S601, the
ステップS602において、縮小処理部17は、間引き対象ラインを間引くべきか否かを判定する間引き対象ライン判定(後述する、ステップS603〜S605の判定処理)において処理単位とするブロックのサイズを算出する。図7(a)に示す例では、3ラインごとに間引き対象ラインが1ライン選択される。しかし、ブロックのサイズを3ラインとすると、ブロックの1ライン目の判定時には、その直前のラインの情報が必要になる、また、ブロックの3ライン目の判定時には、その次のラインの情報が必要になる。したがって、間引き対象ライン判定に用いるブロックは、3ライン+2ラインの5ラインとする。ただし、ブロック内において実際に間引かれるラインは、間引き対象ラインとその前後ラインの3ラインのうちのいずれかである。なお、本実施例では、縮小処理部17は、Y座標が小さいブロックから順に以降の処理を適用する。また、間引き対象ラインが描画イメージの端に位置する場合は、白画素で構成されたラインを補って判定を行えばよい。
In step S602, the
ここから先の説明では、文字領域507内のブロック502を注目ブロックとする。注目ブロックの中のライン701は間引き対象ラインである。ヒストグラム504は、注目ブロック502に対応する注目ヒストグラムである。
In the following description, the
ステップS603において、縮小処理部17は、ヒストグラムにおいて、ライン701に対応する箇所がピークになっているかを判定する。判定方法としては、例えば、間引き対象ラインの度数が注目ヒストグラム内で一番大きく、その前後ラインとの度数差が、それぞれ所定の閾値以上であればピークとみなす方法がある。本実施例では度数差の閾値=10としたときに、注目ヒストグラム504では、
Y=18の度数が最大
|(Y=18の度数)−(Y=17の度数)|>10
|(Y=18の度数)−(Y=19の度数)|>10
となる。したがって、縮小処理部17は、Y=18にピークがあると判断できる。ピークありと判定した場合は(ステップS603のYES)、縮小処理部17は、ステップS604の処理に進む。なお、図5(a)に示す漢字「電」を含む描画イメージ501では、水平ライン及び垂直ラインが多く、対応するヒストグラムにもピークが現れやすい。しかし、図5(b)に示すひらがな「ぬ」を含む描画イメージ508では、対応するヒストグラム509において大きなピークが見られない。したがって、このような描画イメージの一部(ブロック)についてステップS603の判定がなされた場合には、ピークなしと判定され(ステップS603のNO)、処理はステップS610に進む。ステップS610では、縮小処理部17は、ステップS601で算出された間引き対象ライン(図7(a)において斜線の矢印で示されるライン)を間引いて、処理を終了する。
In step S603, the
Maximum frequency of Y = 18 | (frequency of Y = 18)-(frequency of Y = 17) |> 10
| (Frequency of Y = 18)-(Frequency of Y = 19) |> 10
Will be. Therefore, the
ステップS604において、ピークがあると判定されたライン(ここでは、ライン701)に、予め設定した画素数以上連続する黒画素があるかを判定する。ここで、連続する画素数の閾値Th_bを8とし、ライン701をスキャンして、黒画素が8画素以上連続する黒画素群を探索する。すると、黒画素が9画素連続している黒画素群705,706が検出される。従って、縮小処理部17は、ステップS605の処理に進む。検出された黒画素群についての情報は黒画素連続情報として、黒画素群の開始座標と、黒画素群における黒画素の連続数とともに、縮小処理部17に記憶される。閾値Th_b以上黒画素が連続する黒画素群が存在しない場合は(ステップS604のNO)、処理はステップS610に進む。
In step S604, it is determined whether or not there are continuous black pixels in the line (here, line 701) determined to have a peak, which is equal to or greater than the preset number of pixels. Here, the threshold value Th_b of the number of continuous pixels is set to 8, and the
続いてステップS605において、縮小処理部17は、ライン701の前後ライン(ライン703,704)に黒画素群に隣接する白画素群が存在するか判定する。具体的には、縮小処理部17は、ライン701の前後ラインにおける、黒画素群と同じX座標領域に、予め設定した条件を満たす白画素群が存在するかを判定する。図7(b)には、図7(a)に示す黒画素群705の拡大図が示されている。ここでは、黒画素群706と同じX座標領域において、閾値Th_w以上白画素が連続する白画素群が存在するかが判定される。本実施例では、閾値Th_wは、以下の式により決定される。
閾値Th_w=(黒画素群706の黒画素連続数/2)
図7(b)に示す例では、ライン701の直前のライン703の、黒画素群706と同じX座標領域内に、白画素群707が存在する。白画素群707では、白画素が6画素連続している。また、ライン701の直後のライン704の、黒画素群706と同じX座標領域には、白画素群708が存在する。白画素群708では、白画素が9画素連続している。白画素群707,708はいずれも、閾値Th_w(=9/2)以上白画素が連続しているため(ステップS605のYES)、処理はステップS606に進む。ライン701の前後ラインにおける、黒画素群と同じX座標領域に、閾値Th_w以上白画素が連続する白画素群が存在しない場合は(ステップS605のNO)、処理はステップS610に進む。
Subsequently, in step S605, the
Threshold Th_w = (number of consecutive black pixels in
In the example shown in FIG. 7B, the
ステップS606において、縮小処理部17は、ステップS603〜S605の判定結果より、間引き対象ライン701を間引きした場合に、文字の一部が欠落する可能性があると判定する。そして、縮小処理部17は、間引き対象ライン701を間引き禁止ラインに決定するとともに、間引き対象となる新たな候補ライン(以下、次候補ラインともいう。)を決定する。次候補ラインは、間引き禁止ラインの前後のライン(ここでは、ライン703,704)のいずれかである。ライン703,704のどちらを間引くかを決定する方法としては、例えば、ライン703,704のうち先に出現するライン(すなわち、Y座標が小さいライン)を間引く方法がある。当該方法によれば、ライン703が対象となる。また例えば、ライン703とその1つ前のライン711とのヒストグラム度数差と、ライン704とその1つ後のライン712との度数差とを比較して、度数差が少ない方のラインを次候補ラインとして選んで間引く方法がある。当該方法では、似たような傾向にあるラインを間引くことができるので、文字の形状をムラなく残しやすくなる。また例えば、ライン703,704のうち先に出現するライン703の1つ前のライン711が、ブロック502の1つ前のブロックにおいて間引かれている場合には、後に出現するライン704を間引く方法がある。これにより、2ライン連続して間引かれることがないので、文字プロポーションの崩れを防ぐことができる。
In step S606, the
ステップS607において、全ブロックに対して処理が終了していなければ(ステップS607のNO)、縮小処理部17は、ステップS609に進む。ステップS609において、縮小処理部17は、次の注目ブロックを決定する。そして、縮小処理部17は、次の注目ブロックについてステップS603〜S606の処理を繰り返す。本実施例では、次の間引き対象ラインは図7(a)に示すライン709となり、次の注目ブロックはブロック710となる。一方、全ブロックに対して処理が終了していれば(ステップS607のYES)、縮小処理部17は、ステップS608の処理に進み、X方向Y方向の両方について処理を終了したかを判定する。終了していなければ(ステップS608のNO)、縮小処理部17は、ステップS601の処理に戻って、X方向についてステップS601〜S607の処理を行う。X方向Y方向の両方について処理が終了していれば(ステップS608のYES)、縮小処理部17は処理を終了する。
If the processing is not completed for all the blocks in step S607 (NO in step S607), the
以上のように、本実施例では、ステップS601において、縮小率に基づき候補ラインを決定した後に、最適化処理(ステップS602〜S606の処理)を行って、候補ラインをより適切なラインに切り替える。それにより、単純間引きによる文字や細線の消失をより確実に防ぐことができる。また本実施例では、ヒストグラムを用いて候補ラインを間引くべきか否かを判定しているので、すべてのラインについて、間引くべきか否かの判定を行う必要がなく、処理コストを低減させることができる。また。特許文献1に記載された方法のように、1画素ごとに一致するか否かを判定するような処理を行う必要がないので、処理コストをさらに低減させることができる。
As described above, in the present embodiment, in step S601, after the candidate line is determined based on the reduction ratio, the optimization process (the process of steps S602 to S606) is performed to switch the candidate line to a more appropriate line. As a result, it is possible to more reliably prevent the disappearance of characters and thin lines due to simple thinning. Further, in this embodiment, since it is determined whether or not the candidate lines should be thinned out using the histogram, it is not necessary to determine whether or not the candidate lines should be thinned out, and the processing cost can be reduced. it can. Also. Unlike the method described in
なお、本実施例では、図6に示すフローにて、グレースケール画像中の濃い濃度の文字や線に対して処理を行う場合を例にした。しかし、シアン(Cyan),マゼンタ(Magenta),イエロー(Yellow),ブラック(Black)などのカラーを用いて描かれる文字や線に対して処理を行うようにしてもよい。また、赤(Red),緑(Green),青(Blue)で描かれる文字や線に対して処理を行うようにしてもよい。このようにカラー画像に対して処理を行う場合には、カラー画像をグレースケール化してから、上記と同様の処理を行えばよい。その際、グレースケール画像への変換にはNTSC、sRGBなどのグレースケール変換式を用いるとよい。 In this embodiment, a case where processing is performed on dark-density characters and lines in a grayscale image in the flow shown in FIG. 6 is taken as an example. However, processing may be performed on characters and lines drawn using colors such as cyan, magenta, yellow, and black. In addition, processing may be performed on characters and lines drawn in red (Red), green (Green), and blue (Blue). When processing the color image in this way, the color image may be grayscaled and then the same processing as described above may be performed. At that time, it is preferable to use a grayscale conversion formula such as NTSC or sRGB for conversion to a grayscale image.
また、Cyan,Magenta,Yellow,Black,Red,Green,Blueといった純色で描かれたラインを間引き処理の対象とするようにしてもよい。 Further, lines drawn in pure colors such as Cyan, Magenta, Yellow, Black, Red, Green, and Blue may be targeted for thinning processing.
また、実線だけでなく、点線や破線を処理対象としてもよい。例えば、点線や破線を処理対象に含める場合には、ステップS603の判定に用いる閾値を、実線のみを処理対象とする場合に比べて低く設定すればよい。また、ステップS604の判定において、黒画素の連続数ではなく、一定画素数の連続画素内に含まれる黒画素数の割合(例えば、点線であるか否かを判定する場合には50%)が、所定の閾値以上であるか否かを判定すればよい。 Further, not only the solid line but also the dotted line and the broken line may be processed. For example, when the dotted line or the broken line is included in the processing target, the threshold value used for the determination in step S603 may be set lower than that in the case where only the solid line is the processing target. Further, in the determination in step S604, the ratio of the number of black pixels included in the continuous pixels of a fixed number of pixels (for example, 50% when determining whether or not it is a dotted line) is not the continuous number of black pixels. , It may be determined whether or not it is equal to or higher than a predetermined threshold value.
[実施例2]
第1の実施例では、ステップS603にて、ヒストグラムにおける、間引き対象ラインに対応する箇所にピークが存在しない場合は、ステップS610にて、当該間引き対象ラインを間引く例を説明した。本実施例では、ステップS603にてピークなしと判定された場合に、ブロックをさらに小さいパーツに分割して、各パーツに対して間引き対象ライン判定を再度実行する例を説明する。それにより、間引き対象ライン判定の精度をより高くすることができ、画質をさらに向上させることができる。
[Example 2]
In the first embodiment, when there is no peak at the portion corresponding to the thinning target line in the histogram in step S603, an example of thinning the thinning target line in step S610 has been described. In this embodiment, when it is determined in step S603 that there is no peak, the block is divided into smaller parts, and the thinning target line determination is executed again for each part. As a result, the accuracy of the thinning target line determination can be further improved, and the image quality can be further improved.
図8は、第2の実施例における特別間引き処理を示すフローチャートである。図8に示すステップS801〜S809の処理は、図6に示すステップS601〜S609の処理と同様であるため、説明を省略する。図8に示すように、本実施例では、ステップS803の処理において間引き対象ラインにピークがないと判定された場合に(ステップS803のNO)、ステップS810〜S815の処理が実行される。 FIG. 8 is a flowchart showing the special thinning process in the second embodiment. Since the processing of steps S801 to S809 shown in FIG. 8 is the same as the processing of steps S601 to S609 shown in FIG. 6, the description thereof will be omitted. As shown in FIG. 8, in this embodiment, when it is determined that there is no peak in the thinning target line in the process of step S803 (NO in step S803), the process of steps S810 to S815 is executed.
ここで、X方向に3つの漢字「電」「驚」「三」が並んで配置されている文字領域を例にする。「電」「驚」「三」の各漢字を構成する黒画素の数や配置は、それぞれ異なる。したがって、文字領域に上記3つの漢字が並んで配置されている場合と、いずれか1つの漢字が配置されている場合とでは、Y方向について生成したヒストグラムに現れるピークの位置が異なる可能性がある。そのため、ステップS803でNOと判定された場合に一律に間引き対象ラインを間引いてしまうと、いずれかの漢字の一部を欠落させる可能性がある。そこで、本実施例では、ステップS810にて、縮小処理部17は、ブロックをより小さい領域(パーツ)に分割する。分割方法としては、例えば、ブロックのX方向(間引き対象ラインの方向)についてヒストグラムを生成して、当該ヒストグラムから特定した文字や細線の境界に従って、ブロックを分割する方法がある。そのような方法によれば、上記3つの漢字が別々のパーツに属するように、ブロックを分割することができる。それにより、上記の例のように複数の文字が並んでいる場合でも、文字の欠落を防止することが可能となる。
Here, let us take as an example a character area in which three Chinese characters "Den", "Surprising", and "Three" are arranged side by side in the X direction. The number and arrangement of black pixels that make up each of the kanji characters "den," "surprise," and "three" are different. Therefore, there is a possibility that the position of the peak appearing in the histogram generated in the Y direction differs depending on whether the above three kanji are arranged side by side in the character area or when any one of the kanji is arranged. .. Therefore, if the thinning target line is uniformly thinned when NO is determined in step S803, a part of any of the kanji characters may be omitted. Therefore, in this embodiment, in step S810, the
ステップS811にて、縮小処理部17は、分割して得られた複数のパーツのそれぞれに対して、ステップS404と同様の処理を行って、各パーツに対応するヒストグラムを算出する。そして、ステップS812にて、縮小処理部17は、複数のパーツのうちの1つのパーツについて、ステップS811で生成したヒストグラムに基づいて、当該パーツ内の間引き対象ラインにピークがあるかを判定する。ステップS812の処理はステップS803と同様である。パーツ内の間引き対象ラインにピークがない場合は(ステップS812のNO)、縮小処理部17は、ステップS816の処理に進んで、当該間引き対象ラインを間引いて、処理を終了する。パーツ内の間引き対象ラインにピークがあった場合は(ステップS812のYES)、縮小処理部17は、ステップS813の処理に進む。ステップS813では、ステップS804〜S806と同様の処理が行われる。
In step S811, the
ステップS814において、縮小処理部17は、全パーツに対して処理を終了したかを判定する。全パーツに対して処理が終了していなければ(ステップS814のNO)、縮小処理部17は、ステップS815に進む。ステップS815において、次のパーツが決定される。そして、縮小処理部17は、次のパーツについてステップS810〜S813の処理を繰り返す。全パーツに対して処理が終了していれば(ステップS814のYES)、縮小処理部17は、ステップS807の処理に進む。
In step S814, the
以上のような処理により、描画イメージ内に複数の文字が含まれる場合でも、それぞれの文字について、文字の一部を欠落させることなく間引き処理を適用することができる。したがって、本実施例によれば、文字や細線の間引き処理におけるさらなる画質向上が見込める。なお、ステップS813においてブロックを分割する際の分割方法は、上記の方法に限られない。例えば、X方向(間引き対象ラインの方向)にブロックを等分するようにしてもよい。そのような方法によれば、ブロック分割に要する処理時間を短縮することができる。 By the above processing, even when a plurality of characters are included in the drawing image, the thinning process can be applied to each character without missing a part of the characters. Therefore, according to this embodiment, further improvement in image quality can be expected in the thinning process of characters and thin lines. The division method for dividing the block in step S813 is not limited to the above method. For example, the block may be equally divided in the X direction (the direction of the thinning target line). According to such a method, the processing time required for block division can be shortened.
[実施例3]
本実施例では、間引き対象の次候補ラインが見つからない場合に、単純間引きではなくバイリニアやバイキュービックといった補間アルゴリズムを利用して縮小する。それにより、文字や線の欠落をさらに防止する。なお、間引き対象の次候補ラインがない場合とは、例えば、注目ブロック内に、ピークと判定されたラインが1ラインおきに存在する場合である。具体的な例としては、注目ブロック内において白ラインと黒ラインとが1ラインごとに配置されている場合が考えられる。
[Example 3]
In this embodiment, when the next candidate line to be thinned out is not found, it is reduced by using an interpolation algorithm such as bilinear or bicubic instead of simple thinning. As a result, the loss of characters and lines is further prevented. The case where there is no next candidate line to be thinned out is, for example, a case where every other line determined to be a peak exists in the attention block. As a specific example, it is conceivable that a white line and a black line are arranged for each line in the block of interest.
図9を用いて、本実施例の処理を説明する。図9は、第3の実施例における特別間引き処理を示すフローチャートである。図9に示すステップS901〜S905,S909〜S912の処理は、図6に示すステップS601〜S605,S607〜S610の処理と同様であるため、説明を省略する。 The processing of this embodiment will be described with reference to FIG. FIG. 9 is a flowchart showing the special thinning process in the third embodiment. Since the processes of steps S901 to S905 and S909 to S912 shown in FIG. 9 are the same as the processes of steps S601 to S605 and S607 to S610 shown in FIG. 6, the description thereof will be omitted.
図9に示すように、本実施例では、縮小処理部17は、ステップS905の処理の後に、間引き対象の次候補ラインがあるか否かを判定する(ステップS906)。そして、間引き対象の次候補ラインがある場合は(ステップS906のYES)、縮小処理部17は、ステップS907の処理に進む。ステップS907の処理は、ステップS606の処理と同様である。一方、間引き対象の次候補ラインがない場合は(ステップS906のNO)、縮小処理部17は、ステップS908の処理に進む。ステップS908では、単純間引きでなく、バイリニアやバイキュービックといった補間アルゴリズムを用いて縮小処理が行われる。ステップS908の後、処理はステップS909に進む。
As shown in FIG. 9, in the present embodiment, the
以上の処理により、例えば、上述した例のように、注目ブロック内に白ラインと黒ラインとが1ラインごとに配置されている場合でも、注目ブロック内の画質(濃度や色合い)を落とすことなく、縮小することができる。また例えば、文字領域に画数の多い複雑な文字が含まれる場合でも、文字プロポーションを崩すことなく縮小することができる。 By the above processing, for example, even when the white line and the black line are arranged for each line in the attention block as in the above-mentioned example, the image quality (density and hue) in the attention block is not deteriorated. , Can be reduced. Further, for example, even when a complicated character having a large number of strokes is included in the character area, the character proportion can be reduced without breaking the character proportion.
[実施例4]
第1の実施例では、背景が白で文字が黒である描画イメージ、すなわち黒文字の描画イメージを例にした。本実施例では、背景が黒で文字が白である描画イメージ、すなわち白抜き文字の描画イメージを例にする。
[Example 4]
In the first embodiment, a drawing image in which the background is white and the characters are black, that is, a drawing image of black characters is taken as an example. In this embodiment, a drawing image in which the background is black and the characters are white, that is, a drawing image of outline characters is taken as an example.
図10は、白抜き文字の描画イメージと、当該描画イメージから生成されるヒストグラムとの一例を示す説明図である。図10に示す描画イメージ1001は、図5に示す描画イメージ501の文字領域507を白黒反転させたものである。そのため、図10に示すY方向のヒストグラム1003は、図5(a)に示すヒストグラム503とは各ピークの向きが逆になる。ステップS603において、このような描画イメージ(文字領域)に対してピークの判定を行う場合には、注目ヒストグラム内において、間引き対象ラインに対応する度数が一番小さいかを判定すればよい。さらに、間引き対象ラインとその前後ラインとの度数差がそれぞれ所定の閾値以上であるかを判定すればよい。そして、両判定においてYESと判定された場合には、当該間引き対象ラインがヒストグラムのピークに対応するとみなすことができる。例えば、注目ブロック1002の注目ヒストグラム1004において、Y=12が間引き対象ラインであるとする。すると、
Y=12の度数が最小
|(Y=12の度数)−(Y=11の度数)|>10
|(Y=12の度数)−(Y=13の度数)|>10
である場合に、Y=12においてピークがあると判定される。なお、度数差の閾値を10とする。
FIG. 10 is an explanatory diagram showing an example of a drawing image of outline characters and a histogram generated from the drawing image. The
The minimum frequency of Y = 12 | (Frequency of Y = 12)-(Frequency of Y = 11) |> 10
| (Frequency of Y = 12)-(Frequency of Y = 13) |> 10
If, it is determined that there is a peak at Y = 12. The threshold value of the frequency difference is 10.
このように、描画イメージに応じてピークの判定条件を変えることにより、白抜き文字の描画イメージなどに対しても、文字や線を欠落させることなく、縮小することができる。 In this way, by changing the peak determination condition according to the drawing image, it is possible to reduce the drawing image of outline characters without losing the characters and lines.
(その他の実施例)
本発明は、上述の実施形態の1以上の機能を実現するプログラムを、ネットワーク又は記憶媒体を介してシステム又は装置に供給し、そのシステム又は装置のコンピュータにおける1つ以上のプロセッサがプログラムを読出し実行する処理でも実現可能である。また、1以上の機能を実現する回路(例えば、ASIC)によっても実現可能である。
(Other Examples)
The present invention supplies a program that realizes one or more functions of the above-described embodiment to a system or device via a network or storage medium, and one or more processors in the computer of the system or device reads and executes the program. It can also be realized by the processing to be performed. It can also be realized by a circuit (for example, ASIC) that realizes one or more functions.
Claims (11)
前記描画データによって示される画像からイメージ領域を取得する取得手段と、
前記取得手段が取得したイメージ領域に対して縮小命令がなされているか否かを判定する判定手段と、
前記判定手段によって前記縮小命令がなされていると判定された場合に、前記取得手段が取得したイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成手段と、
前記縮小命令で指定される縮小率と前記生成手段が生成したヒストグラムとに基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引き手段と、
を備え、
前記間引き手段は、
前記縮小率に基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定する決定手段と、
前記決定手段が決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化手段と、を含み、
前記最適化手段は、前記決定手段が決定した候補ラインの前後のラインのいずれかを、新たな候補ラインとして決定し直す場合において、前記決定手段が決定した候補ラインの直前のラインが、すでに決定された他の候補ラインと連続すると判断した場合には、前記決定手段が決定した候補ラインの直後のラインを新たな候補ラインとして決定し直す
ことを特徴とする画像処理装置。 An image processing device that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition means for acquiring an image area from the image indicated by the drawing data, and
A determination means for determining whether or not a reduction command has been given to the image area acquired by the acquisition means, and
A histogram showing the number of black pixels in each line of an image obtained by binarizing the pixels constituting the image region acquired by the acquisition means when it is determined by the determination means that the reduction command has been issued. The generation means to generate and
Based on the reduction ratio specified by the reduction instruction and the histogram generated by the generation means, a candidate line to be thinned out from the image area acquired by the acquisition means is determined, and the thinning means for thinning out the candidate line from the image area. ,
Equipped with a,
The thinning means
A determination means for determining a candidate line to be thinned out from the image area acquired by the acquisition means based on the reduction ratio, and a determination means.
The candidate line determined by the determination means is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels having a predetermined number of pixels or more are continuous, and further. When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, any of the lines before and after the candidate line. Includes an optimization means that executes an optimization process that redetermines the pixel as a new candidate line.
When the optimization means redetermines any of the lines before and after the candidate line determined by the determination means as a new candidate line, the line immediately before the candidate line determined by the determination means has already been determined. An image processing apparatus, characterized in that, when it is determined that the line is continuous with another candidate line, the line immediately after the candidate line determined by the determination means is redetermined as a new candidate line.
前記描画データによって示される画像からイメージ領域を取得する取得手段と、
前記取得手段が取得したイメージ領域に対して縮小命令がなされているか否かを判定する判定手段と、
前記判定手段によって前記縮小命令がなされていると判定された場合に、前記取得手段が取得したイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成手段と、
前記縮小命令で指定される縮小率と前記生成手段が生成したヒストグラムとに基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引き手段と、
を備え、
前記間引き手段は、
前記縮小率に基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定する決定手段と、
前記決定手段が決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化手段と、を含み、
前記最適化手段は、前記ヒストグラムにおける度数が0であるラインが所定のライン数以上続く領域が検出された場合には、検出された当該領域に対しては前記最適化処理を適用しない
ことを特徴とする画像処理装置。 An image processing device that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition means for acquiring an image area from the image indicated by the drawing data, and
A determination means for determining whether or not a reduction command has been given to the image area acquired by the acquisition means, and
A histogram showing the number of black pixels in each line of an image obtained by binarizing the pixels constituting the image region acquired by the acquisition means when it is determined by the determination means that the reduction command has been issued. The generation means to generate and
Based on the reduction ratio specified by the reduction instruction and the histogram generated by the generation means, a candidate line to be thinned out from the image area acquired by the acquisition means is determined, and the thinning means for thinning out the candidate line from the image area. ,
With
The thinning means
A determination means for determining a candidate line to be thinned out from the image area acquired by the acquisition means based on the reduction ratio, and a determination means.
The candidate line determined by the determination means is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels having a predetermined number of pixels or more are continuous, and further. When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, any of the lines before and after the candidate line. Includes an optimization means that executes an optimization process that redetermines the pixel as a new candidate line.
The optimization means is characterized in that when a region in which lines having a frequency of 0 in the histogram continue for a predetermined number or more is detected, the optimization process is not applied to the detected region. Image processing device.
前記描画データによって示される画像からイメージ領域を取得する取得手段と、
前記取得手段が取得したイメージ領域に対して縮小命令がなされているか否かを判定する判定手段と、
前記判定手段によって前記縮小命令がなされていると判定された場合に、前記取得手段が取得したイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成手段と、
前記縮小命令で指定される縮小率と前記生成手段が生成したヒストグラムとに基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引き手段と、
を備え、
前記間引き手段は、
前記縮小率に基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定する決定手段と、
前記決定手段が決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化手段と、を含み、
前記最適化手段は、
前記縮小命令で指定される縮小率に基づき決定したライン数のブロックごとに、前記最適化処理を実行し、
前記ブロックには、前記決定手段が決定した候補ラインが少なくとも1つ含まれ、
前記決定手段が決定した候補ラインが前記ヒストグラムのピークに対応するラインでない場合には、前記決定手段が決定した当該候補ラインを含むブロックを分割し、分割して得られる領域ごとに前記最適化処理を実行する
ことを特徴とする画像処理装置。 An image processing device that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition means for acquiring an image area from the image indicated by the drawing data, and
A determination means for determining whether or not a reduction command has been given to the image area acquired by the acquisition means, and
A histogram showing the number of black pixels in each line of an image obtained by binarizing the pixels constituting the image region acquired by the acquisition means when it is determined by the determination means that the reduction command has been issued. The generation means to generate and
Based on the reduction ratio specified by the reduction instruction and the histogram generated by the generation means, a candidate line to be thinned out from the image area acquired by the acquisition means is determined, and the thinning means for thinning out the candidate line from the image area. ,
With
The thinning means
A determination means for determining a candidate line to be thinned out from the image area acquired by the acquisition means based on the reduction ratio, and a determination means.
The candidate line determined by the determination means is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels having a predetermined number of pixels or more are continuous, and further. When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, any of the lines before and after the candidate line. Includes an optimization means that executes an optimization process that redetermines the pixel as a new candidate line.
The optimization means
The optimization process is executed for each block of the number of lines determined based on the reduction ratio specified by the reduction instruction.
The block contains at least one candidate line determined by the determination means.
When the candidate line determined by the determination means is not the line corresponding to the peak of the histogram, the block including the candidate line determined by the determination means is divided, and the optimization process is performed for each region obtained by the division. An image processing device characterized by performing.
前記描画データによって示される画像からイメージ領域を取得する取得手段と、
前記取得手段が取得したイメージ領域に対して縮小命令がなされているか否かを判定する判定手段と、
前記判定手段によって前記縮小命令がなされていると判定された場合に、前記取得手段が取得したイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成手段と、
前記縮小命令で指定される縮小率と前記生成手段が生成したヒストグラムとに基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引き手段と、
を備え、
前記間引き手段は、
前記縮小率に基づき、前記取得手段が取得したイメージ領域から間引くべき候補ラインを決定する決定手段と、
前記決定手段が決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化手段と、を含み、
前記最適化手段は、
前記縮小命令で指定される縮小率に基づき決定したライン数のブロックごとに、前記最適化処理を実行し、
前記ブロックには、前記決定手段が決定した候補ラインが少なくとも1つ含まれ、
前記決定手段が決定した候補ラインの前後のラインのいずれについても、新たな候補ラインとして決定できない場合には、前記決定手段が決定した当該候補ラインを含むブロックに対して、単純間引き以外の他の縮小処理を適用する
ことを特徴とする画像処理装置。 An image processing device that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition means for acquiring an image area from the image indicated by the drawing data, and
A determination means for determining whether or not a reduction command has been given to the image area acquired by the acquisition means, and
A histogram showing the number of black pixels in each line of an image obtained by binarizing the pixels constituting the image region acquired by the acquisition means when it is determined by the determination means that the reduction command has been issued. The generation means to generate and
Based on the reduction ratio specified by the reduction instruction and the histogram generated by the generation means, a candidate line to be thinned out from the image area acquired by the acquisition means is determined, and the thinning means for thinning out the candidate line from the image area. ,
With
The thinning means
A determination means for determining a candidate line to be thinned out from the image area acquired by the acquisition means based on the reduction ratio, and a determination means.
The candidate line determined by the determination means is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels having a predetermined number of pixels or more are continuous, and further. When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, any of the lines before and after the candidate line. Includes an optimization means that executes an optimization process that redetermines the pixel as a new candidate line.
The optimization means
The optimization process is executed for each block of the number of lines determined based on the reduction ratio specified by the reduction instruction.
The block contains at least one candidate line determined by the determination means.
If any of the lines before and after the candidate line determined by the determination means cannot be determined as a new candidate line, the block including the candidate line determined by the determination means is not thinned out. An image processing device characterized by applying reduction processing.
印刷時の副走査方向に対応するY方向と、印刷時の主走査方向に対応するX方向のそれぞれについて実行される
請求項1から請求項4のうちのいずれか1項に記載の画像処理装置。 The processing by the thinning means
The image processing apparatus according to any one of claims 1 to 4 , which is executed for each of the Y direction corresponding to the sub-scanning direction at the time of printing and the X direction corresponding to the main scanning direction at the time of printing. ..
前記イメージ領域がカラー画像である場合には、前記イメージ領域をグレースケール化し、グレースケール化された前記イメージ領域を構成する画素を二値化する
請求項1から請求項5のうちのいずれか1項に記載の画像処理装置。 The generation means
When the image area is a color image, the image area is grayscaled, and the pixels constituting the grayscaled image area are binarized. Any one of claims 1 to 5. The image processing apparatus according to the section.
前記描画データによって示される画像からイメージ領域を取得する取得ステップと、
前記取得されたイメージ領域に対して縮小命令がなされているか否かを判定する判定ステップと、
前記判定ステップにおいて前記縮小命令がなされていると判定された場合に、前記取得されたイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成ステップと、
前記縮小命令で指定される縮小率と前記生成ステップにおいて生成されたヒストグラムとに基づき、前記取得されたイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引きステップと、
を含み、
前記間引きステップは、
前記縮小率に基づき、前記取得ステップにて取得したイメージ領域から間引くべき候補ラインを決定する決定ステップと、
前記決定ステップにて決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化ステップと、を含み、
前記最適化ステップでは、前記決定ステップにて決定した候補ラインの前後のラインのいずれかを、新たな候補ラインとして決定し直す場合において、前記決定ステップにて決定した候補ラインの直前のラインが、すでに決定された他の候補ラインと連続すると判断した場合には、前記決定ステップにて決定した候補ラインの直後のラインを新たな候補ラインとして決定し直す
ことを特徴とする画像処理方法。 An image processing method that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition step of acquiring an image area from the image indicated by the drawing data, and
A determination step for determining whether or not a reduction command has been given to the acquired image area, and
When it is determined in the determination step that the reduction instruction has been made , a histogram showing the number of black pixels in each line of the image obtained by binarizing the pixels constituting the acquired image region is generated. Generation step and
Based on the reduction ratio specified by the reduction instruction and the histogram generated in the generation step, a candidate line to be thinned out from the acquired image area is determined, and the thinning step of thinning out the candidate line from the image area.
Only including,
The thinning step
Based on the reduction ratio, a determination step of determining a candidate line to be thinned out from the image area acquired in the acquisition step, and a determination step.
The candidate line determined in the determination step is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels of a predetermined number of pixels or more are continuous, and further. , When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, the lines before and after the candidate line Includes an optimization step that executes an optimization process that redetermines one as a new candidate line.
In the optimization step, when any of the lines before and after the candidate line determined in the determination step is redetermined as a new candidate line, the line immediately before the candidate line determined in the determination step is determined. An image processing method characterized in that, when it is determined that the line is continuous with another candidate line already determined, the line immediately after the candidate line determined in the determination step is redetermined as a new candidate line.
前記描画データによって示される画像からイメージ領域を取得する取得ステップと、
前記取得されたイメージ領域に対して縮小命令がなされているか否かを判定する判定ステップと、
前記判定ステップにおいて前記縮小命令がなされていると判定された場合に、前記取得されたイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成ステップと、
前記縮小命令で指定される縮小率と前記生成ステップにおいて生成されたヒストグラムとに基づき、前記取得されたイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引きステップと、
を含み、
前記間引きステップは、
前記縮小率に基づき、前記取得ステップにて取得したイメージ領域から間引くべき候補ラインを決定する決定ステップと、
前記決定ステップにて決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化ステップと、を含み、
前記最適化ステップでは、前記ヒストグラムにおける度数が0であるラインが所定のライン数以上続く領域が検出された場合には、検出された当該領域に対しては前記最適化処理を適用しない
ことを特徴とする画像処理方法。 An image processing method that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition step of acquiring an image area from the image indicated by the drawing data, and
A determination step for determining whether or not a reduction command has been given to the acquired image area, and
When it is determined in the determination step that the reduction instruction has been made , a histogram showing the number of black pixels in each line of the image obtained by binarizing the pixels constituting the acquired image region is generated. Generation step and
Based on the reduction ratio specified by the reduction instruction and the histogram generated in the generation step, a candidate line to be thinned out from the acquired image area is determined, and the thinning step of thinning out the candidate line from the image area.
Only including,
The thinning step
Based on the reduction ratio, a determination step of determining a candidate line to be thinned out from the image area acquired in the acquisition step, and a determination step.
The candidate line determined in the determination step is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels of a predetermined number of pixels or more are continuous, and further. , When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, the lines before and after the candidate line Includes an optimization step that executes an optimization process that redetermines one as a new candidate line.
In the optimization step, when a region in which the number of lines having a frequency of 0 in the histogram continues for a predetermined number or more is detected, the optimization process is not applied to the detected region. Image processing method.
前記描画データによって示される画像からイメージ領域を取得する取得ステップと、
前記取得されたイメージ領域に対して縮小命令がなされているか否かを判定する判定ステップと、
前記判定ステップにおいて前記縮小命令がなされていると判定された場合に、前記取得されたイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成ステップと、
前記縮小命令で指定される縮小率と前記生成ステップにおいて生成されたヒストグラムとに基づき、前記取得されたイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引きステップと、
を含み、
前記間引きステップは、
前記縮小率に基づき、前記取得ステップにて取得したイメージ領域から間引くべき候補ラインを決定する決定ステップと、
前記決定ステップにて決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化ステップと、を含み、
前記最適化ステップでは、
前記縮小命令で指定される縮小率に基づき決定したライン数のブロックごとに、前記最適化処理を実行し、
前記ブロックには、前記決定ステップにて決定した候補ラインが少なくとも1つ含まれ、
前記決定ステップにて決定した候補ラインが前記ヒストグラムのピークに対応するラインでない場合には、前記決定ステップにて決定した当該候補ラインを含むブロックを分割し、分割して得られる領域ごとに前記最適化処理を実行する
ことを特徴とする画像処理方法。 An image processing method that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition step of acquiring an image area from the image indicated by the drawing data, and
A determination step for determining whether or not a reduction command has been given to the acquired image area, and
When it is determined in the determination step that the reduction instruction has been made , a histogram showing the number of black pixels in each line of the image obtained by binarizing the pixels constituting the acquired image region is generated. Generation step and
Based on the reduction ratio specified by the reduction instruction and the histogram generated in the generation step, a candidate line to be thinned out from the acquired image area is determined, and the thinning step of thinning out the candidate line from the image area.
Only including,
The thinning step
Based on the reduction ratio, a determination step of determining a candidate line to be thinned out from the image area acquired in the acquisition step, and a determination step.
The candidate line determined in the determination step is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels of a predetermined number of pixels or more are continuous, and further. , When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, the lines before and after the candidate line Includes an optimization step that executes an optimization process that redetermines one as a new candidate line.
In the optimization step,
The optimization process is executed for each block of the number of lines determined based on the reduction ratio specified by the reduction instruction.
The block contains at least one candidate line determined in the determination step.
When the candidate line determined in the determination step is not the line corresponding to the peak of the histogram, the block including the candidate line determined in the determination step is divided, and the optimum region obtained by dividing is divided. An image processing method characterized by executing a conversion process.
前記描画データによって示される画像からイメージ領域を取得する取得ステップと、
前記取得されたイメージ領域に対して縮小命令がなされているか否かを判定する判定ステップと、
前記判定ステップにおいて前記縮小命令がなされていると判定された場合に、前記取得されたイメージ領域を構成する画素を二値化して得られる画像の、各ラインにおける黒画素数を示すヒストグラムを生成する生成ステップと、
前記縮小命令で指定される縮小率と前記生成ステップにおいて生成されたヒストグラムとに基づき、前記取得されたイメージ領域から間引くべき候補ラインを決定し、当該イメージ領域から前記候補ラインを間引く間引きステップと、
を含み、
前記間引きステップは、
前記縮小率に基づき、前記取得ステップにて取得したイメージ領域から間引くべき候補ラインを決定する決定ステップと、
前記決定ステップにて決定した候補ラインが前記ヒストグラムのピークに対応するラインであって、かつ、当該候補ラインに、予め定められた画素数以上の黒画素が連続する黒画素群が含まれ、さらに、当該候補ラインの前後のラインに、当該黒画素群と隣接するように、予め定められた画素数以上の白画素が連続する白画素群が含まれる場合に、当該候補ラインの前後のラインのいずれかを新たな候補ラインとして決定し直す最適化処理を実行する最適化ステップと、を含み、
前記最適化ステップでは、
前記縮小命令で指定される縮小率に基づき決定したライン数のブロックごとに、前記最適化処理を実行し、
前記ブロックには、前記決定ステップにて決定した候補ラインが少なくとも1つ含まれ、
前記決定ステップにて決定した候補ラインの前後のラインのいずれについても、新たな候補ラインとして決定できない場合には、前記決定ステップにて決定した当該候補ラインを含むブロックに対して、単純間引き以外の他の縮小処理を適用する
ことを特徴とする画像処理方法。 An image processing method that performs line-by-line thinning processing on drawing data generated by an application.
An acquisition step of acquiring an image area from the image indicated by the drawing data, and
A determination step for determining whether or not a reduction command has been given to the acquired image area, and
When it is determined in the determination step that the reduction instruction has been made , a histogram showing the number of black pixels in each line of the image obtained by binarizing the pixels constituting the acquired image region is generated. Generation step and
Based on the reduction ratio specified by the reduction instruction and the histogram generated in the generation step, a candidate line to be thinned out from the acquired image area is determined, and the thinning step of thinning out the candidate line from the image area.
Only including,
The thinning step
Based on the reduction ratio, a determination step of determining a candidate line to be thinned out from the image area acquired in the acquisition step, and a determination step.
The candidate line determined in the determination step is a line corresponding to the peak of the histogram, and the candidate line includes a black pixel group in which black pixels of a predetermined number of pixels or more are continuous, and further. , When the lines before and after the candidate line include a white pixel group in which white pixels having a predetermined number of pixels or more are continuous so as to be adjacent to the black pixel group, the lines before and after the candidate line Includes an optimization step that executes an optimization process that redetermines one as a new candidate line.
In the optimization step,
The optimization process is executed for each block of the number of lines determined based on the reduction ratio specified by the reduction instruction.
The block contains at least one candidate line determined in the determination step.
If any of the lines before and after the candidate line determined in the determination step cannot be determined as a new candidate line, the block including the candidate line determined in the determination step is not simply thinned out. An image processing method characterized by applying other reduction processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016208561A JP6866107B2 (en) | 2016-10-25 | 2016-10-25 | Image processing equipment, image processing methods, and programs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016208561A JP6866107B2 (en) | 2016-10-25 | 2016-10-25 | Image processing equipment, image processing methods, and programs |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018074237A JP2018074237A (en) | 2018-05-10 |
JP6866107B2 true JP6866107B2 (en) | 2021-04-28 |
Family
ID=62115898
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016208561A Active JP6866107B2 (en) | 2016-10-25 | 2016-10-25 | Image processing equipment, image processing methods, and programs |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6866107B2 (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3378108B2 (en) * | 1995-02-06 | 2003-02-17 | 富士通株式会社 | Binary image output device |
JPH0955851A (en) * | 1995-08-16 | 1997-02-25 | Nec Corp | Facsimile equipment |
JP2009232369A (en) * | 2008-03-25 | 2009-10-08 | Canon Inc | Image processing method |
JP6337680B2 (en) * | 2014-08-08 | 2018-06-06 | 富士ゼロックス株式会社 | Image processing system, image processing apparatus, program, and image processing method |
-
2016
- 2016-10-25 JP JP2016208561A patent/JP6866107B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2018074237A (en) | 2018-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9477914B2 (en) | Image processing apparatus, method, and medium for converting page image data | |
CN108347548B (en) | Image processing apparatus and control method thereof | |
EP2560363B1 (en) | Image processing device | |
JP6417851B2 (en) | Image processing apparatus and computer program | |
US10592766B2 (en) | Image processing apparatus and medium storing program executable by image processing apparatus | |
US9253368B2 (en) | Image processing device setting binary value without using dither matrix when prescribed condition is satisfied | |
US20190079707A1 (en) | Information processing apparatus for performing image conversion | |
JP6866107B2 (en) | Image processing equipment, image processing methods, and programs | |
JP6120824B2 (en) | Image processing apparatus, image processing method, and program | |
US20060061614A1 (en) | Image processing apparatus | |
JP7187300B2 (en) | Image processing device, image processing method and program | |
JP2004215163A (en) | Image interpolation system, image interpolation method, and image interpolation program | |
JP4455261B2 (en) | Image processing method, image processing apparatus, and image forming system | |
JP2018117216A (en) | Information processor, overprint attribute change method and program | |
JP7123737B2 (en) | Image processing device, image processing method and program | |
JP4217332B2 (en) | Image processing apparatus and method, and computer-readable memory | |
JP2002318680A (en) | Image processor and image processing method | |
JP6394247B2 (en) | Image processing apparatus and computer program | |
JP2007335983A (en) | Image processor | |
JP2006218772A (en) | Image processor, image forming apparatus, method for generating image plotting command information, program of generating image plotting command information, and recording medium containing the program recorded therein | |
JP5131144B2 (en) | Image processing apparatus, image processing program, and image forming apparatus | |
JP2005178178A (en) | Printing system and printing control method | |
JP3158101B2 (en) | Color image processing apparatus and color image processing method | |
JP2007079934A (en) | Image processor | |
JP2009141529A (en) | Device and method for processing image, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20191015 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200807 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20200901 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20201102 |
|
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: 20210309 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210407 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6866107 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |