JP6866107B2 - Image processing equipment, image processing methods, and programs - Google Patents

Image processing equipment, image processing methods, and programs Download PDF

Info

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
Application number
JP2016208561A
Other languages
Japanese (ja)
Other versions
JP2018074237A (en
Inventor
陽子 井戸
陽子 井戸
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2016208561A priority Critical patent/JP6866107B2/en
Publication of JP2018074237A publication Critical patent/JP2018074237A/en
Application granted granted Critical
Publication of JP6866107B2 publication Critical patent/JP6866107B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 Patent Document 1, the line of interest is compared with the line immediately preceding it (previous line), and when the data match, the line of interest is thinned out, so that characters and lines are missing due to the reduction process. Is being prevented.

特開2006−49998号公報Japanese Unexamined Patent Publication No. 2006-49998

特許文献1に記載の方法では、所定ライン数の周期で(例えば10ラインごとに)間引き処理が繰り返されるが、各周期において早い段階で注目ラインと前ラインとのデータが一致しない場合、ラインの比較回数が多くなり処理コストを増大させる可能性がある。また、特許文献1に記載の方法では、注目ラインと前ラインとを比較する際、1画素ごとに一致するかを判定しているため、処理コストをさらに増大させる可能性がある。 In the method described in Patent Document 1, the thinning process is repeated in a cycle of a predetermined number of lines (for example, every 10 lines), but if the data of the line of interest and the previous line do not match at an early stage in each cycle, the line The number of comparisons increases, which may increase the processing cost. Further, in the method described in Patent Document 1, when comparing the line of interest and the front line, it is determined whether or not they match each pixel, so that the processing cost may be further increased.

そこで、本発明は、単純間引きによる画像縮小処理において生じる文字や線の欠落を、より少ない処理コストで防ぐことができる画像処理装置、画像処理方法、およびプログラムを提供することを目的とする。 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の実施例に係る印刷システムの構成の一例を示すブロック図である。It is a block diagram which shows an example of the structure of the printing system which concerns on 1st Example. 図1に示すパーソナルコンピュータのハードウェア構成の一例を示すブロック図である。It is a block diagram which shows an example of the hardware composition of the personal computer shown in FIG. 図1に示すパーソナルコンピュータの機能構成の一例を示すブロック図である。It is a block diagram which shows an example of the functional structure of the personal computer shown in FIG. 第1の実施形態における描画イメージの縮小処理を示すフローチャートである。It is a flowchart which shows the reduction process of the drawing image in 1st Embodiment. 描画イメージと、当該描画イメージから生成されるヒストグラムとの一例を示す説明図である。It is explanatory drawing which shows an example of the drawing image and the histogram generated from the drawing image. 第1の実施例における特別間引き処理を示すフローチャートである。It is a flowchart which shows the special thinning-out process in 1st Example. 特別間引き処理を説明するための図である。It is a figure for demonstrating the special thinning-out process. 第2の実施例における特別間引き処理を示すフローチャートである。It is a flowchart which shows the special thinning-out process in 2nd Example. 第3の実施例における特別間引き処理を示すフローチャートである。It is a flowchart which shows the special thinning-out process in 3rd Example. 白抜き文字の描画イメージと、当該描画イメージから生成されるヒストグラムとの一例を示す説明図である。It is explanatory drawing which shows an example of the drawing image of outline character and the histogram generated from the drawing image.

以下、本発明を実施するための第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 printer 20 are connected via LAN1. LAN1 is compatible with the Ethernet communication method. The LAN 1 may be in either a wired or wireless connection form. Further, the PC 10 and the printer 20 may be connected by Bluetooth (registered trademark), USB, or the like instead of LAN1.

図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 PC 10 shown in FIG. As shown in FIG. 2, the PC 10 includes a CPU 101, a RAM 102, a ROM 103, a network I / F 105, a keyboard I / F 106, a display I / F 107, and an external memory I / F 108. Each device is connected by the system bus 104. The PC 10 also includes a keyboard 109, a display 110, and a memory 111. The keyboard 109, the display 110, and the memory 111 may be arranged outside the PC 10.

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 CPU 101 comprehensively controls each device connected to the system bus 104 according to the program stored in the RAM 102. The RAM 102 functions as a main memory, a work area, and the like of the CPU 101. The ROM 103 stores various programs and data. The ROM 103 includes a font ROM 103a for storing various fonts, a program ROM 103b for storing a boot program, a BIOS, and the like, and a data ROM 103c for storing various data. In this embodiment, the network I / F 105 is connected to LAN1 and performs communication processing with each device connected to LAN1 such as a printer 20. The keyboard controller I / F 106 controls key input from a keyboard 109 or a pointing device (for example, a mouse) (not shown). The display I / F 107 controls the display processing for the display 110. The external memory I / F 108 controls access to a memory 111 such as a hard disk (HD). The memory 111 stores data 114 including an operating system (OS) 112, software 113 responsible for a printing system, user files, edit files, and the like. In this embodiment, it is assumed that Microsoft Windows (registered trademark) is used as OS112.

図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 PC 10 shown in FIG. Application 11 creates a document based on a user's instruction. When the application 11 receives a print instruction for the created document from the user, the application 11 uses the GDI 12 to generate drawing data according to the content of the document. Specifically, when a print instruction is given to the application 11, the application 11 calls a service function group of GDI (Graphics Device Interface). As a result, the GDI 12 issues a GDI drawing command. The printer driver 13 can interpret the drawing data (hereinafter, referred to as "drawing data in GDI format") composed by the GDI drawing command issued by the GDI 12 as print data (so-called PDL (Printer Description Language)) that can be interpreted by the printer 20. Data) and output to the printer 20. In the printer driver 13, a single or a plurality of filters are executed in order. A filter is a unit of printing processing. That is, the output of a certain filter becomes the input of the next connected filter, and each filter is executed in sequence. As a result, PDL data for transmission to the printer 20 is generated. In this embodiment, the printer driver 13 has a layout filter 14 that performs layout processing and a rendering filter 15 that performs rendering processing. The layout filter 14 performs layout processing such as Nup processing on the input GDI function. The Nup process is a process of reducing the logical page of N pages to a physical page of one page and printing it. The rendering filter 15 applies image processing such as enlargement / reduction and rotation to the input drawing data that has undergone layout processing to generate a drawing object and convert it into PDL data. The drawing data reduction process may be executed in advance by the application 11 or may be performed by the printer driver 13. The reduction process in this embodiment is executed by the reduction processing unit 17 included in the rendering filter 15 of the printer driver 13. The port monitor 16 transmits PDL data to the printer 20 via LAN1. Although GDI has been described as an example of the graphics engine here, another graphics engine may be used instead of GDI 12.

次に、プリンタドライバ13における縮小処理を説明する。図4は、第1の実施形態における描画イメージの縮小処理を示すフローチャートである。図5は、描画イメージと、当該描画イメージから生成されるヒストグラムとの一例を示す説明図である。ここでは、縮小処理の対象として、図5(a)に示す「電」という描画イメージ501を例にする。 Next, the reduction process in the printer driver 13 will be described. FIG. 4 is a flowchart showing a drawing image reduction process according to the first embodiment. FIG. 5 is an explanatory diagram showing an example of a drawing image and a histogram generated from the drawing image. Here, as an example of the reduction process, a drawing image 501 called "Den" shown in FIG. 5A is taken as an example.

ステップS401において、プリンタドライバ13のレンダリングフィルタ15の縮小処理部17は、アプリケーション11を介して印刷指示がなされたドキュメント内に存在する、描画イメージを1つずつ取得する。具体的には、縮小処理部17は、GDI12が発行するGDI描画命令の中から、イメージ描画命令を1つずつ取得する。それにより、印刷指示がなされたドキュメントに含まれるイメージ属性の領域(描画イメージ)が取得される。以下、描画イメージをイメージ領域ともいう。 In step S401, the reduction processing unit 17 of the rendering filter 15 of the printer driver 13 acquires the drawing images existing in the document for which the print instruction is given via the application 11 one by one. Specifically, the reduction processing unit 17 acquires an image drawing command one by one from the GDI drawing commands issued by the GDI 12. As a result, the area of the image attribute (drawing image) included in the document for which the print instruction is given is acquired. Hereinafter, the drawn image is also referred to as an image area.

ステップS402において、縮小処理部17は、上記描画イメージに対して縮小命令がなされているか確認する。具体的には、縮小処理部17は、イメージ描画命令に、縮小命令が付随しているかを確認する。縮小命令がなされている場合は、処理はステップS403に進む。一方、縮小命令がなされていない場合は、処理はステップS408に進む。 In step S402, the reduction processing unit 17 confirms whether or not a reduction command has been given to the drawn image. Specifically, the reduction processing unit 17 confirms whether the reduction command is attached to the image drawing command. If a reduction instruction has been issued, the process proceeds to step S403. On the other hand, if the reduction instruction is not given, the process proceeds to step S408.

ステップS403において、縮小処理部17は、描画イメージ501を白黒2値画像に変換する。二値化の方法としては、描画イメージが8bitのグレースケール画像であって、白画素の画素値が0、黒画素の画素値が255である場合、画素値が255未満である画素の画素値を0とする方法がある。なお、縮小処理の対象を、純黒の文字や細線ではなく、ある程度の濃さを有する文字や細線とする場合には、所望の濃さに相当する閾値を設定した二値化や、大津の二値化アルゴリズムに従った二値化などを適用すればよい。 In step S403, the reduction processing unit 17 converts the drawing image 501 into a black-and-white binary image. As a binarization method, when the drawing image is an 8-bit grayscale image, the pixel value of the white pixel is 0, and the pixel value of the black pixel is 255, the pixel value of the pixel whose pixel value is less than 255 is There is a method of setting to 0. If the target of the reduction process is not pure black characters or thin lines but characters or thin lines with a certain degree of darkness, binarization with a threshold value corresponding to the desired darkness or Otsu's Binarization according to the binarization algorithm may be applied.

ステップS404において、縮小処理部17は、描画イメージ501のヒストグラムを生成する。図5(a)に、「電」という文字の描画イメージ501と、そのY方向について生成したヒストグラム503を示す。ヒストグラム503は、描画イメージ501のY方について、各ラインにおける黒画素数を表している。なお、縮小処理部17は、描画イメージ501のX方向についても同様にヒストグラム(図示せず)を生成する。ここで、Y方向は、ドキュメント印刷時の副走査方向に対応する方向である。X方向は、ドキュメント印刷時の主走査方向に対応する方向である。 In step S404, the reduction processing unit 17 generates a histogram of the drawing image 501. FIG. 5A shows a drawing image 501 of the character “Den” and a histogram 503 generated in the Y direction thereof. Histogram 503 represents the number of black pixels in each line in the Y direction of the drawing image 501. The reduction processing unit 17 also generates a histogram (not shown) in the X direction of the drawing image 501. Here, the Y direction is a direction corresponding to the sub-scanning direction at the time of document printing. The X direction is a direction corresponding to the main scanning direction at the time of document printing.

ステップS405において、縮小処理部17は、生成したヒストグラムに基づいて、間引き最適化対象領域があるか、つまりライン単位の間引き処理を適用した場合に欠落する可能性がある文字や細線を含む領域があるかを判定する。以下、間引き最適化対象領域を文字領域ともいう。例えばヒストグラム503を見ると、破線505より小さいY座標と、破線506より大きいY座標のヒストグラムの値(度数)は0が続いていて、破線505と破線506とに挟まれたY座標の度数は0以上となっている。このように、ヒストグラムの度数が0であるラインが予め設定したライン数(以下、境界判定ライン数と呼ぶ。)以上続く場合には、文字や細線の境界と判断できる。それにより、破線505と破線506に挟まれた領域に文字や細線があると推定される。同様の処理がX方向においても行われるが、ここでは説明を省略する。領域507は、文字や細線があると推定された、間引き最適化対象領域である。 In step S405, the reduction processing unit 17 has a thinning optimization target area based on the generated histogram, that is, an area including characters and thin lines that may be missing when the thinning process for each line is applied. Determine if there is. Hereinafter, the thinning optimization target area is also referred to as a character area. For example, looking at the histogram 503, the value (frequency) of the histogram of the Y coordinate smaller than the dashed line 505 and the Y coordinate larger than the dashed line 506 continues to be 0, and the frequency of the Y coordinate sandwiched between the dashed line 505 and the dashed line 506 is. It is 0 or more. As described above, when the line having the frequency of 0 in the histogram continues for more than the preset number of lines (hereinafter referred to as the number of boundary determination lines), it can be determined as the boundary of characters and thin lines. As a result, it is estimated that there are characters and thin lines in the area between the broken line 505 and the broken line 506. The same processing is performed in the X direction, but the description thereof will be omitted here. The area 507 is a thinning optimization target area estimated to have characters and thin lines.

間引き最適化対象領域があると判定された場合は(ステップ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 reduction processing unit 17 proceeds to the process of step S406. If it is determined that there is no thinning optimization target area (NO in step S405), the reduction processing unit 17 proceeds to the processing of step S407, performs the reduction processing by normal simple thinning, and proceeds to the processing of step S408. .. Here, the normal reduction process by simple thinning is a process of thinning regular lines based on the reduction rate specified by the reduction instruction. The number of characters and thin lines included in the character area differs depending on how many boundary determination lines are set.

ステップS406において、縮小処理部17は、文字領域507に対して特別間引き処理を行い、文字領域以外に対しては通常の間引き処理を行う。ステップS406の特別間引き処理の詳細については、図6を用いて後述する。そして、処理はステップS408に進む。 In step S406, the reduction processing unit 17 performs a special thinning process on the character area 507, and performs a normal thinning process on the areas other than the character area. Details of the special thinning process in step S406 will be described later with reference to FIG. Then, the process proceeds to step S408.

ステップS408において、縮小処理部17は、ドキュメント内に他に描画イメージが存在するか判定する。描画イメージが存在すれば(ステップS408のYES)、縮小処理部17は、ステップS401の処理に戻り、次の描画イメージに対してステップS401〜S407の処理を繰り返す。描画イメージがなければ(ステップS408のNO)、縮小処理部17は処理を終了する。 In step S408, the reduction processing unit 17 determines whether there is another drawing image in the document. If the drawn image exists (YES in step S408), the reduction processing unit 17 returns to the process of step S401 and repeats the processes of steps S401 to S407 for the next drawn image. If there is no drawing image (NO in step S408), the reduction processing unit 17 ends the processing.

なお、ここでは、縮小処理の対象となる描画イメージに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 reduction processing unit 17 determines a line to be thinned out (hereinafter, referred to as a thinning target line or a candidate line) in the drawing image 501 based on the reduction ratio specified by the reduction instruction. Actually, the coordinates of the thinning target line are calculated. FIG. 7A shows an enlarged view of the character area 507. For example, when the character area 507 is reduced to 2/3, one line is thinned out every three lines. That is, the thinning target line at this time is the line indicated by the diagonal arrow in FIG. 7A. As described above, the normal thinning process is applied to an area other than the character area, that is, an area in the histogram in which lines having a frequency of 0 continue for a predetermined number of lines or more. Therefore, in the following, the description of the processing performed on the area other than the character area 507 in the drawing image 501 will be omitted.

ステップS602において、縮小処理部17は、間引き対象ラインを間引くべきか否かを判定する間引き対象ライン判定(後述する、ステップS603〜S605の判定処理)において処理単位とするブロックのサイズを算出する。図7(a)に示す例では、3ラインごとに間引き対象ラインが1ライン選択される。しかし、ブロックのサイズを3ラインとすると、ブロックの1ライン目の判定時には、その直前のラインの情報が必要になる、また、ブロックの3ライン目の判定時には、その次のラインの情報が必要になる。したがって、間引き対象ライン判定に用いるブロックは、3ライン+2ラインの5ラインとする。ただし、ブロック内において実際に間引かれるラインは、間引き対象ラインとその前後ラインの3ラインのうちのいずれかである。なお、本実施例では、縮小処理部17は、Y座標が小さいブロックから順に以降の処理を適用する。また、間引き対象ラインが描画イメージの端に位置する場合は、白画素で構成されたラインを補って判定を行えばよい。 In step S602, the reduction processing unit 17 calculates the size of the block to be processed in the thinning target line determination (determination processing of steps S603 to S605 described later) for determining whether or not the thinning target line should be thinned. In the example shown in FIG. 7A, one line to be thinned out is selected every three lines. However, if the size of the block is 3 lines, the information of the immediately preceding line is required when determining the first line of the block, and the information of the next line is required when determining the third line of the block. become. Therefore, the block used for determining the thinning target line is 5 lines of 3 lines + 2 lines. However, the line actually thinned out in the block is one of the three lines of the thinning target line and the line before and after the thinning target line. In this embodiment, the reduction processing unit 17 applies the subsequent processing in order from the block having the smallest Y coordinate. Further, when the thinning target line is located at the edge of the drawing image, the determination may be made by supplementing the line composed of white pixels.

ここから先の説明では、文字領域507内のブロック502を注目ブロックとする。注目ブロックの中のライン701は間引き対象ラインである。ヒストグラム504は、注目ブロック502に対応する注目ヒストグラムである。 In the following description, the block 502 in the character area 507 will be the block of interest. The line 701 in the attention block is a thinning target line. Histogram 504 is a histogram of interest corresponding to block 502 of interest.

ステップ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 reduction processing unit 17 determines whether or not the portion corresponding to the line 701 is the peak in the histogram. As a determination method, for example, if the frequency of the thinning target line is the largest in the histogram of interest and the frequency difference between the lines before and after the thinning target line is equal to or greater than a predetermined threshold value, it is regarded as a peak. In this embodiment, when the threshold value of the frequency difference is 10, the attention histogram 504 shows that
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 reduction processing unit 17 can determine that there is a peak at Y = 18. If it is determined that there is a peak (YES in step S603), the reduction processing unit 17 proceeds to the process of step S604. In the drawing image 501 including the Chinese character "Den" shown in FIG. 5A, there are many horizontal lines and vertical lines, and peaks are likely to appear in the corresponding histograms. However, in the drawing image 508 including the hiragana “nu” shown in FIG. 5 (b), a large peak is not seen in the corresponding histogram 509. Therefore, when the determination in step S603 is made for a part (block) of such a drawing image, it is determined that there is no peak (NO in step S603), and the process proceeds to step S610. In step S610, the reduction processing unit 17 thins out the thinning target line (the line indicated by the diagonal arrow in FIG. 7A) calculated in step S601, and ends the processing.

ステップ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 line 701 is scanned to search for a black pixel group in which 8 or more black pixels are continuous. Then, the black pixel groups 705 and 706 in which 9 black pixels are continuous are detected. Therefore, the reduction processing unit 17 proceeds to the processing of step S605. The detected information about the black pixel group is stored in the reduction processing unit 17 as black pixel continuous information together with the start coordinates of the black pixel group and the number of consecutive black pixels in the black pixel group. If there is no black pixel group in which black pixels are continuous above the threshold Th_b (NO in step S604), the process proceeds to step S610.

続いてステップ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 reduction processing unit 17 determines whether or not a white pixel group adjacent to the black pixel group exists in the front and rear lines (lines 703 and 704) of the line 701. Specifically, the reduction processing unit 17 determines whether or not a white pixel group satisfying a preset condition exists in the same X coordinate region as the black pixel group in the front and rear lines of the line 701. FIG. 7B shows an enlarged view of the black pixel group 705 shown in FIG. 7A. Here, in the same X coordinate region as the black pixel group 706, it is determined whether or not there is a white pixel group in which white pixels are continuous at a threshold value Th_w or more. In this embodiment, the threshold Th_w is determined by the following formula.
Threshold Th_w = (number of consecutive black pixels in black pixel group 706 / 2)
In the example shown in FIG. 7B, the white pixel group 707 exists in the same X coordinate region as the black pixel group 706 of the line 703 immediately before the line 701. In the white pixel group 707, 6 white pixels are continuous. Further, the white pixel group 708 exists in the same X coordinate region as the black pixel group 706 of the line 704 immediately after the line 701. In the white pixel group 708, 9 white pixels are continuous. In each of the white pixel groups 707 and 708, since the white pixels are continuous at the threshold value Th_w (= 9/2) or more (YES in step S605), the process proceeds to step S606. If there is no white pixel group in which white pixels are continuous at the threshold Th_w or more in the same X coordinate region as the black pixel group in the lines before and after the line 701 (NO in step S605), the process proceeds to step S610.

ステップ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 reduction processing unit 17 determines from the determination results of steps S603 to S605 that when the thinning target line 701 is thinned out, a part of the characters may be missing. Then, the reduction processing unit 17 determines the thinning target line 701 as the thinning prohibition line, and also determines a new candidate line to be thinned out (hereinafter, also referred to as a next candidate line). The next candidate line is one of the lines before and after the thinning prohibition line (here, lines 703 and 704). As a method of determining which of the lines 703 and 704 is to be thinned out, for example, there is a method of thinning out the line that appears first among the lines 703 and 704 (that is, the line having the smaller Y coordinate). According to this method, line 703 is the target. Further, for example, the histogram frequency difference between the line 703 and the line 711 immediately before the line 703 is compared with the frequency difference between the line 704 and the line 712 immediately after the line 704, and the line having the smaller frequency difference is selected as the next candidate. There is a method of selecting as a line and thinning out. In this method, lines having a similar tendency can be thinned out, so that it becomes easy to leave the shape of characters evenly. Further, for example, when the line 711 immediately before the line 703 appearing earlier in the lines 703 and 704 is thinned out in the block immediately before the block 502, the method of thinning out the line 704 appearing later. There is. As a result, two lines are not thinned out in succession, so that it is possible to prevent the character proportions from collapsing.

ステップ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 reduction processing unit 17 proceeds to step S609. In step S609, the reduction processing unit 17 determines the next block of interest. Then, the reduction processing unit 17 repeats the processing of steps S603 to S606 for the next attention block. In this embodiment, the next line to be thinned out is the line 709 shown in FIG. 7A, and the next block of interest is the block 710. On the other hand, if the processing is completed for all the blocks (YES in step S607), the reduction processing unit 17 proceeds to the processing in step S608 and determines whether the processing is completed in both the X direction and the Y direction. If it is not completed (NO in step S608), the reduction processing unit 17 returns to the processing of step S601 and performs the processing of steps S601 to S607 in the X direction. If the processing is completed in both the X direction and the Y direction (YES in step S608), the reduction processing unit 17 ends the processing.

以上のように、本実施例では、ステップ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 Patent Document 1, it is not necessary to perform a process of determining whether or not each pixel matches, so that the processing cost can be further reduced.

なお、本実施例では、図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 reduction processing unit 17 divides the block into smaller regions (parts). As a dividing method, for example, there is a method of generating a histogram in the X direction of the block (the direction of the line to be thinned out) and dividing the block according to the boundary of characters or thin lines specified from the histogram. According to such a method, the blocks can be divided so that the above three Chinese characters belong to different parts. As a result, even when a plurality of characters are lined up as in the above example, it is possible to prevent missing characters.

ステップS811にて、縮小処理部17は、分割して得られた複数のパーツのそれぞれに対して、ステップS404と同様の処理を行って、各パーツに対応するヒストグラムを算出する。そして、ステップS812にて、縮小処理部17は、複数のパーツのうちの1つのパーツについて、ステップS811で生成したヒストグラムに基づいて、当該パーツ内の間引き対象ラインにピークがあるかを判定する。ステップS812の処理はステップS803と同様である。パーツ内の間引き対象ラインにピークがない場合は(ステップS812のNO)、縮小処理部17は、ステップS816の処理に進んで、当該間引き対象ラインを間引いて、処理を終了する。パーツ内の間引き対象ラインにピークがあった場合は(ステップS812のYES)、縮小処理部17は、ステップS813の処理に進む。ステップS813では、ステップS804〜S806と同様の処理が行われる。 In step S811, the reduction processing unit 17 performs the same processing as in step S404 for each of the plurality of parts obtained by dividing the parts, and calculates a histogram corresponding to each part. Then, in step S812, the reduction processing unit 17 determines whether or not there is a peak in the thinning target line in the part based on the histogram generated in step S811 for one of the plurality of parts. The process of step S812 is the same as that of step S803. If there is no peak in the thinning target line in the part (NO in step S812), the reduction processing unit 17 proceeds to the process of step S816, thins out the thinning target line, and ends the process. If there is a peak in the thinning target line in the part (YES in step S812), the reduction processing unit 17 proceeds to the process of step S813. In step S813, the same processing as in steps S804 to S806 is performed.

ステップS814において、縮小処理部17は、全パーツに対して処理を終了したかを判定する。全パーツに対して処理が終了していなければ(ステップS814のNO)、縮小処理部17は、ステップS815に進む。ステップS815において、次のパーツが決定される。そして、縮小処理部17は、次のパーツについてステップS810〜S813の処理を繰り返す。全パーツに対して処理が終了していれば(ステップS814のYES)、縮小処理部17は、ステップS807の処理に進む。 In step S814, the reduction processing unit 17 determines whether or not the processing has been completed for all the parts. If the processing has not been completed for all the parts (NO in step S814), the reduction processing unit 17 proceeds to step S815. In step S815, the next part is determined. Then, the reduction processing unit 17 repeats the processing of steps S810 to S813 for the next part. If the processing for all the parts is completed (YES in step S814), the reduction processing unit 17 proceeds to the processing in step S807.

以上のような処理により、描画イメージ内に複数の文字が含まれる場合でも、それぞれの文字について、文字の一部を欠落させることなく間引き処理を適用することができる。したがって、本実施例によれば、文字や細線の間引き処理におけるさらなる画質向上が見込める。なお、ステップ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 reduction processing unit 17 determines whether or not there is a next candidate line to be thinned out after the processing in step S905 (step S906). Then, if there is a next candidate line to be thinned out (YES in step S906), the reduction processing unit 17 proceeds to the process of step S907. The process of step S907 is the same as the process of step S606. On the other hand, if there is no next candidate line to be thinned out (NO in step S906), the reduction processing unit 17 proceeds to the process of step S908. In step S908, reduction processing is performed using an interpolation algorithm such as bilinear or bicubic instead of simple thinning. After step S908, the process proceeds to step S909.

以上の処理により、例えば、上述した例のように、注目ブロック内に白ラインと黒ラインとが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 drawing image 1001 shown in FIG. 10 is a black-and-white inverted version of the character area 507 of the drawing image 501 shown in FIG. Therefore, the direction of each peak of the histogram 1003 in the Y direction shown in FIG. 10 is opposite to that of the histogram 503 shown in FIG. 5 (a). In step S603, when the peak is determined for such a drawing image (character area), it may be determined whether the frequency corresponding to the thinning target line is the smallest in the histogram of interest. Further, it may be determined whether or not the frequency difference between the thinning target line and the line before and after the thinning target line is equal to or more than a predetermined threshold value. If YES is determined in both determinations, it can be considered that the thinning target line corresponds to the peak of the histogram. For example, in the attention histogram 1004 of the attention block 1002, it is assumed that Y = 12 is the thinning target line. Then
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から請求項のうちのいずれか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から請求項のうちのいずれか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.
コンピュータを請求項1から請求項のうちのいずれか1項に記載の画像処理装置として機能させるためのプログラム。 A program for operating a computer as an image processing device according to any one of claims 1 to 6.
JP2016208561A 2016-10-25 2016-10-25 Image processing equipment, image processing methods, and programs Active JP6866107B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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