JP2019161623A - Image processing device and computer program - Google Patents

Image processing device and computer program Download PDF

Info

Publication number
JP2019161623A
JP2019161623A JP2018050232A JP2018050232A JP2019161623A JP 2019161623 A JP2019161623 A JP 2019161623A JP 2018050232 A JP2018050232 A JP 2018050232A JP 2018050232 A JP2018050232 A JP 2018050232A JP 2019161623 A JP2019161623 A JP 2019161623A
Authority
JP
Japan
Prior art keywords
image
image data
pixel
character
pixels
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.)
Granted
Application number
JP2018050232A
Other languages
Japanese (ja)
Other versions
JP6867609B2 (en
Inventor
竜司 山田
Ryuji Yamada
竜司 山田
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.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2018050232A priority Critical patent/JP6867609B2/en
Priority to US16/136,422 priority patent/US10423854B2/en
Priority to US16/553,591 priority patent/US10565465B2/en
Publication of JP2019161623A publication Critical patent/JP2019161623A/en
Application granted granted Critical
Publication of JP6867609B2 publication Critical patent/JP6867609B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To specify character pixels with high accuracy even when an image includes dots.SOLUTION: An image processing device, using target image data, determines for each pixel whether each of a plurality of pixels in the target image is a character pixel candidate or not, thereby determining a plurality of candidate pixels, executing pre-processing including expansion processing on the target image data, generating pre-processed image data, and determining whether each of a plurality of target areas arranged on the image corresponding to the pre-processed image data satisfies a specific determination condition or not. Thereby, a non-character area in the target image is specified, and among the plurality of pixels in the target image, pixels that are determined as candidate pixels and in an area different from the non-character area are specified as the character pixels.SELECTED DRAWING: Figure 2

Description

本明細書は、画像データに対する画像処理に関し、特に、画像内の文字画素を特定するための画像処理に関する。   The present specification relates to image processing on image data, and more particularly to image processing for specifying character pixels in an image.

イメージセンサを用いて印刷物を読み取ることによって生成される画像データでは、該画像データによって示される画像内に、印刷物に含まれる網点が現れる。このような網点を構成する画素は、画像内の文字画素を特定する際に、文字画素として誤って特定されやすい。   In image data generated by reading a printed material using an image sensor, halftone dots included in the printed material appear in the image indicated by the image data. The pixels constituting such a halftone dot are easily specified by mistake as character pixels when specifying character pixels in the image.

特許文献1に開示された画像処理装置は、画素ごとにエッジであるか否かを判定するエッジ判定と、画素ごとに網点であるかを判定する網点判定と、を実行する。画像処理装置は、エッジであり、かつ、網点ではない画素を、文字を示す画素として特定する。   The image processing apparatus disclosed in Patent Literature 1 performs edge determination for determining whether each pixel is an edge and halftone dot determination for determining whether each pixel is a halftone dot. The image processing apparatus specifies a pixel that is an edge and not a halftone dot as a pixel indicating a character.

特開平6−164928号公報JP-A-6-164928 特開2003−189090号公報JP 2003-189090 A 特開2017−135609号公報JP 2017-135609 A

このように、網点を含む画像であっても、例えば、網点に起因して文字のない領域において文字画素が誤って特定されることを抑制して、文字画素を精度良く特定できる技術が求められていた。   In this way, even for an image including halftone dots, for example, there is a technology that can accurately specify character pixels by suppressing erroneously specifying character pixels in an area without characters due to the halftone dots. It was sought after.

本明細書は、網点を含む画像であっても、対象画像内の文字画素を精度良く特定できる技術を開示する。   The present specification discloses a technique that can accurately specify character pixels in a target image even in an image including halftone dots.

本明細書に開示された技術は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。   The technology disclosed in the present specification has been made to solve at least a part of the above-described problems, and can be realized as the following application examples.

[適用例1]画像処理装置であって、対象画像を示す対象画像データを取得する画像取得部と、前記対象画像データを用いて、前記対象画像内の複数個の画素のそれぞれが、文字画素の候補であるか否かを画素ごとに判断することによって、複数個の候補画素を決定する候補決定部と、前記対象画像データに対して膨張処理を含む前処理を実行して、前処理済画像データを生成する前処理部と、前記前処理済画像データに対応する画像上に配置される複数個の対象領域のそれぞれが特定の判断条件を満たすか否かを判断することによって、前記対象画像内の非文字領域を特定する非文字領域特定部と、前記対象画像内の複数個の画素のうち、前記候補画素であると決定され、かつ、前記非文字領域とは異なる領域にある画素を、前記文字画素として特定する文字特定部と、を備える、画像処理装置。 Application Example 1 In an image processing apparatus, an image acquisition unit that acquires target image data indicating a target image, and each of a plurality of pixels in the target image is a character pixel using the target image data. A candidate determining unit that determines a plurality of candidate pixels by performing a preprocessing including a dilation process on the target image data by determining whether or not each of the target image data is a preprocessed A pre-processing unit that generates image data; and determining whether each of a plurality of target regions arranged on an image corresponding to the pre-processed image data satisfies a specific determination condition. A non-character area specifying unit that specifies a non-character area in an image, and a pixel that is determined to be the candidate pixel among a plurality of pixels in the target image and is in a different area from the non-character area The character pixel And and a character identifying unit that identifies, the image processing apparatus.

上記構成によれば、膨張処理を含む前処理が実行された前処理済画像データを用いて、対象画像内の非文字領域が特定される。前処理済画像データでは、網点を構成する画素が、膨張処理によって一塊のオブジェクトとして現れやすい。この結果、対象画像内の網点を構成する画素を含む領域が、非文字領域として精度良く特定できる。そして、非文字領域とは異なる領域にある画素が、文字画素として特定される。この結果、例えば、画素ごとの判断によって、網点を構成する画素が候補画素であると誤って決定されたとしても、前処理済画像データを用いた判断によって、網点を構成する画素を含む領域が非文字領域であると決定されることで、網点を構成する画素が文字画素であると誤って特定されることを抑制できる。したがって、網点を含む画像であっても、対象画像内の文字画素を精度良く特定できる。   According to the above configuration, the non-character region in the target image is specified using the preprocessed image data that has been subjected to the preprocessing including the expansion process. In the preprocessed image data, the pixels constituting the halftone dot are likely to appear as a lump object by the expansion process. As a result, the area including the pixels constituting the halftone dots in the target image can be accurately identified as the non-character area. Then, a pixel in an area different from the non-character area is specified as a character pixel. As a result, for example, even if the pixel constituting the halftone dot is erroneously determined to be a candidate pixel by the judgment for each pixel, the pixel constituting the halftone dot is included by the judgment using the preprocessed image data. By determining that the region is a non-character region, it is possible to prevent the pixels constituting the halftone dots from being erroneously specified as character pixels. Therefore, even in an image including halftone dots, character pixels in the target image can be specified with high accuracy.

上記構成によれば、文字画素の値と、文字画素とは異なる画素の値と、に対して、互いに異なる画像処理が実行されるので、対象画像データに対する適切な画像処理を実現できる。   According to the above configuration, different image processing is executed on the value of the character pixel and the value of the pixel different from the character pixel, so that appropriate image processing on the target image data can be realized.

なお、本明細書に開示される技術は、種々の形態で実現することが可能であり、例えば、複合機、スキャナ、プリンタ、画像処理方法、これら装置の機能または上記方法を実現するためのコンピュータプログラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。   The technology disclosed in the present specification can be realized in various forms. For example, a multifunction device, a scanner, a printer, an image processing method, a function of these devices, or a computer for realizing the above method The present invention can be realized in the form of a program, a recording medium on which the computer program is recorded, and the like.

画像処理装置の一例である複合機200の構成を示すブロック図である。2 is a block diagram illustrating a configuration of a multifunction peripheral 200 that is an example of an image processing apparatus. 画像処理のフローチャートである。It is a flowchart of an image process. 画像処理で用いられる画像の一例を示す第1の図である。It is a 1st figure which shows an example of the image used by image processing. 文字特定処理で用いられる画像の一例を示す図である。It is a figure which shows an example of the image used by a character specific process. 第1の二値画像データ生成処理のフローチャートである。It is a flowchart of the 1st binary image data generation process. エッジ強調処理のフローチャートである。It is a flowchart of an edge emphasis process. 平滑化済みのR成分画像データとエッジ強調済みのR成分画像データとの説明図である。It is explanatory drawing of R component image data after smoothing, and R component image data after edge enhancement. レベル補正処理のためのトーンカーブの一例を示す図である。It is a figure which shows an example of the tone curve for a level correction process. 第2の二値画像データ生成処理のフローチャートである。It is a flowchart of the 2nd binary image data generation process. スキャンデータの最小成分値と最大成分値の説明図である。It is explanatory drawing of the minimum component value and the maximum component value of scan data. 画像処理に用いられる画像の一例を示す第2の図である。It is a 2nd figure which shows an example of the image used for an image process. 非文字領域判定処理のフローチャートである。It is a flowchart of a non-character area | region determination process. 非文字領域判定処理で用いられる画像の一例を示す図である。It is a figure which shows an example of the image used by a non-character area | region determination process. 膨張処理と収縮処理について説明する第1の図である。It is a 1st figure explaining an expansion process and a contraction process. 膨張処理と収縮処理について説明する第2の図である。It is the 2nd figure explaining expansion processing and contraction processing.

A.実施例:
A−1:複合機200の構成
実施の形態を実施例に基づき説明する。図1は、画像処理装置の一例である複合機200の構成を示すブロック図である。複合機200は、画像処理装置を制御するプロセッサであるCPU210と、DRAMなどの揮発性記憶装置220と、フラッシュメモリやハードディスクドライブなどの不揮発性記憶装置230と、液晶ディスプレイなどの表示部240と、液晶ディスプレイと重畳されたタッチパネルやボタンを含む操作部250と、ユーザの端末装置100などの外部装置と通信を行うためのインタフェース(通信IF)270と、印刷実行部280と、読取実行部290と、を備えている。
A. Example:
A-1: Configuration of MFP 200 The embodiment will be described based on examples. FIG. 1 is a block diagram illustrating a configuration of a multifunction peripheral 200 that is an example of an image processing apparatus. The multifunction device 200 includes a CPU 210 that is a processor that controls the image processing apparatus, a volatile storage device 220 such as a DRAM, a nonvolatile storage device 230 such as a flash memory and a hard disk drive, a display unit 240 such as a liquid crystal display, An operation unit 250 including a touch panel and buttons superimposed on a liquid crystal display, an interface (communication IF) 270 for communicating with an external device such as a user terminal device 100, a print execution unit 280, and a read execution unit 290 It is equipped with.

読取実行部290は、CPU210の制御に従って、一次元イメージセンサを用いて原稿を光学的に読み取ることによってスキャンデータを生成する。印刷実行部280は、CPU210の制御に従って、複数種類のトナー、具体的には、シアン(C)、マゼンタ(M)、イエロ(Y)、ブラック(K)のトナーを、色材として用いて、レーザ方式で用紙などの印刷媒体に画像を印刷する。具体的には、印刷実行部280は、感光ドラムを露光して静電潜像を形成し、該静電潜像にトナーを付着させてトナー像を形成する。印刷実行部280は、感光ドラム上に形成されたトナー像を用紙に転写する。なお、変形例では、印刷実行部280は、色材としてのインクを吐出して、用紙上に画像を形成するインクジェット方式の印刷実行部であっても良い。   The reading execution unit 290 generates scan data by optically reading a document using a one-dimensional image sensor under the control of the CPU 210. Under the control of the CPU 210, the print execution unit 280 uses a plurality of types of toners, specifically, cyan (C), magenta (M), yellow (Y), and black (K) toners as color materials. An image is printed on a printing medium such as paper by a laser method. Specifically, the print execution unit 280 exposes the photosensitive drum to form an electrostatic latent image, and attaches toner to the electrostatic latent image to form a toner image. The print execution unit 280 transfers the toner image formed on the photosensitive drum to a sheet. In the modification, the print execution unit 280 may be an ink jet type print execution unit that discharges ink as a color material to form an image on a sheet.

揮発性記憶装置220は、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域を提供する。不揮発性記憶装置230には、コンピュータプログラムPGが格納されている。コンピュータプログラムPGは、CPU210に複合機200の制御を実現させる制御プログラムである。本実施例では、コンピュータプログラムPGは、複合機200の製造時に、不揮発性記憶装置230に予め格納される形態で提供される。これに代えて、コンピュータプログラムPGは、サーバからダウンロードされる形態で提供されても良く、DVD−ROMなどに格納される形態で提供されてもよい。CPU210は、コンピュータプログラムPGを実行することにより、後述する画像処理を実行することができる。   The volatile storage device 220 provides a buffer area for temporarily storing various intermediate data generated when the CPU 210 performs processing. The non-volatile storage device 230 stores a computer program PG. The computer program PG is a control program that causes the CPU 210 to control the multifunction device 200. In this embodiment, the computer program PG is provided in a form stored in advance in the non-volatile storage device 230 at the time of manufacture of the multifunction device 200. Instead of this, the computer program PG may be provided in a form downloaded from a server, or may be provided in a form stored in a DVD-ROM or the like. The CPU 210 can execute image processing to be described later by executing the computer program PG.

A−2:画像処理
図2は、画像処理のフローチャートである。この画像処理は、例えば、ユーザが、読取実行部290の原稿台に、原稿を載置して、コピーの実行指示を入力した場合に実行される。この画像処理は、原稿を、読取実行部290を用いて読み取ることによって生成されるスキャンデータを取得し、該スキャンデータを用いて、原稿を示す印刷データを生成することで、いわゆる原稿のコピーを実現する処理である。
A-2: Image Processing FIG. 2 is a flowchart of image processing. This image processing is executed, for example, when the user places a document on the document table of the reading execution unit 290 and inputs a copy execution instruction. In this image processing, scan data generated by reading an original using the reading execution unit 290 is acquired, and print data indicating the original is generated using the scan data, so that a so-called copy of the original is generated. This is a process to be realized.

S10では、CPU210は、ユーザが原稿台に設置した原稿を、読取実行部290を用いて読み取ることによって、対象画像データとしてのスキャンデータを生成する。原稿は、例えば、複合機200、あるいは、図示しないプリンタによって画像が印刷された印刷物である。生成されたスキャンデータは、揮発性記憶装置220(図1)のバッファ領域に格納される。スキャンデータは、複数個の画素の値を含み、複数個の画素の値のそれぞれは、画素の色をRGB表色系の色値(RGB値とも呼ぶ)で表す。すなわち、スキャンデータは、RGB画像データである。1個の画素のRGB値は、例えば、赤色(R)と緑色(G)と青色(B)との3個の色成分の値(以下、R値、G値、B値とも呼ぶ)を含んでいる。本実施例では、各成分値の階調数は、256階調である。   In S <b> 10, the CPU 210 generates scan data as target image data by reading a document placed on a document table by a user using the reading execution unit 290. The document is, for example, a printed material on which an image is printed by the multifunction device 200 or a printer (not shown). The generated scan data is stored in the buffer area of the volatile storage device 220 (FIG. 1). The scan data includes a plurality of pixel values, and each of the plurality of pixel values represents the color of the pixel by an RGB color system color value (also referred to as an RGB value). That is, the scan data is RGB image data. The RGB value of one pixel includes, for example, three color component values of red (R), green (G), and blue (B) (hereinafter also referred to as R value, G value, and B value). It is out. In this embodiment, the number of gradations of each component value is 256 gradations.

RGB画像データであるスキャンデータは、RGB表色系を構成する3個の色成分に対応する3個の成分画像データ(R成分画像データ、G成分画像データ、B成分画像データ)を含んでいると言うことができる。各成分画像データは、1種類の色成分の値を、画素の値とする画像データである。   The scan data that is RGB image data includes three component image data (R component image data, G component image data, and B component image data) corresponding to the three color components constituting the RGB color system. Can be said. Each component image data is image data in which a value of one type of color component is used as a pixel value.

S15では、CPU210は、スキャンデータに対して、スキャンデータによって示されるスキャン画像を、拡大率Lrで拡大する拡大処理を実行して、拡大処理済みのスキャンデータを生成する。拡大率Lrは、例えば、ユーザによって、コピーの実行指示とともに入力される。拡大率Lrは、例えば、0.1〜6(10%〜600%)の範囲の値であり、1未満の拡大率Lrでの拡大処理は、スキャン画像のサイズを小さくする処理であり、1より大きな拡大率Lrでの拡大処理は、スキャン画像のサイズを大きくする処理である。スキャン画像のサイズは、具体的には、縦方向および横方向の画素数で定義される。なお、拡大処理前のスキャンデータを元画像データとも呼び、拡大処理済みのスキャンデータを対象画像データとも呼ぶ。以下では、単にスキャンデータと呼ぶとき、拡大処理済みのスキャンデータを意味する。   In S15, the CPU 210 performs an enlargement process for enlarging the scan image indicated by the scan data at the enlargement ratio Lr on the scan data, and generates the enlarged scan data. The enlargement ratio Lr is input together with a copy execution instruction by the user, for example. The enlargement ratio Lr is, for example, a value in the range of 0.1 to 6 (10% to 600%), and the enlargement process at an enlargement ratio Lr of less than 1 is a process for reducing the size of the scanned image. The enlargement process at a larger enlargement ratio Lr is a process for increasing the size of the scan image. Specifically, the size of the scanned image is defined by the number of pixels in the vertical direction and the horizontal direction. Note that scan data before enlargement processing is also called original image data, and scan data that has already been enlarged is also called target image data. Hereinafter, when simply referred to as scan data, it means scan data that has been enlarged.

図3は、画像処理で用いられる画像の一例を示す第1の図である。図3(A)には、スキャンデータによって示されるスキャン画像SIの一例が示されている。スキャン画像SIは、複数個の画素を含む。該複数個の画素は、第1方向D1と、第1方向D1と直交する第2方向D2と、に沿って、マトリクス状に配置されている。   FIG. 3 is a first diagram illustrating an example of an image used in image processing. FIG. 3A shows an example of the scan image SI indicated by the scan data. Scanned image SI includes a plurality of pixels. The plurality of pixels are arranged in a matrix along a first direction D1 and a second direction D2 orthogonal to the first direction D1.

図3(A)のスキャン画像SIは、原稿の用紙の地色を示す白色の背景Bg1と、2個の文字とは異なるオブジェクトOb1、Ob2と、4個の文字Ob3〜Ob6と、を含んでいる。本実施例では、文字とは異なるオブジェクトは、写真である。   The scanned image SI in FIG. 3A includes a white background Bg1 indicating the background color of the original paper, objects Ob1 and Ob2 that are different from the two characters, and four characters Ob3 to Ob6. Yes. In this embodiment, the object different from the character is a photograph.

S20では、CPU210は、スキャンデータに対して、文字特定処理を実行する。文字特定処理は、スキャン画像SI内の複数個の画素を、文字を示す複数個の文字画素と、文字を示さない複数個の非文字画素と、に分類することによって、文字画素を特定する処理である。   In S20, the CPU 210 performs a character specifying process on the scan data. The character specifying process is a process of specifying a character pixel by classifying a plurality of pixels in the scanned image SI into a plurality of character pixels indicating characters and a plurality of non-character pixels not indicating characters. It is.

文字特定処理によって、例えば、文字画素の値が「1」とされ、非文字画素の値が「0」とされた二値画像データ(文字特定データとも呼ぶ)が生成される。図3(B)には、文字特定データによって示される文字特定画像TIの一例が示されている。この文字特定画像TIには、スキャン画像SI内の4個の文字Ob3〜Ob6のエッジを構成する複数個の画素が、文字画素Tp3〜Tp7として、特定されている。なお、比較的大きな文字については、文字のエッジを構成する画素が文字画素として特定され、比較的小さな文字については、文字を構成する画素の全体が文字画素として特定される。文字特定処理の詳細は、後述する。   By the character specifying process, for example, binary image data (also referred to as character specifying data) in which the value of the character pixel is “1” and the value of the non-character pixel is “0” is generated. FIG. 3B shows an example of the character specifying image TI indicated by the character specifying data. In the character specifying image TI, a plurality of pixels constituting the edges of the four characters Ob3 to Ob6 in the scan image SI are specified as character pixels Tp3 to Tp7. For relatively large characters, the pixels constituting the edge of the character are identified as character pixels, and for relatively small characters, the entire pixels constituting the character are identified as character pixels. Details of the character identification process will be described later.

S30では、CPU210は、スキャンデータに対して、網点平滑化処理を実行して、平滑化画像を示す平滑化画像データを生成する。具体的には、CPU210は、スキャンデータに含まれる複数個の非文字画素の値のそれぞれに対して、ガウスフィルタなどの平滑化フィルタを用いた平滑化処理を実行して、平滑化処理済みの複数個の非文字画素の値を算出する。平滑化処理の対象となる非文字画素は、S20の文字特定処理によって生成された文字特定データを参照して特定される。CPU210は、スキャンデータに含まれる複数個の文字画素の値と、平滑化処理済みの複数個の非文字画素の値と、を含む平滑化画像データを生成する。   In S30, the CPU 210 performs halftone dot smoothing processing on the scan data to generate smoothed image data indicating a smoothed image. Specifically, the CPU 210 performs a smoothing process using a smoothing filter such as a Gaussian filter on each of the values of the plurality of non-character pixels included in the scan data, and the smoothing process has been performed. The values of a plurality of non-character pixels are calculated. The non-character pixel to be subjected to the smoothing process is specified with reference to the character specifying data generated by the character specifying process of S20. The CPU 210 generates smoothed image data including a plurality of character pixel values included in the scan data and a plurality of smoothed non-character pixel values.

図3(C)には、平滑化画像データによって示される平滑化画像GIが示されている。平滑化画像GIは、白色の背景Bg1gと、スキャン画像SI内のオブジェクトOb1〜Ob6が平滑化されたオブジェクトOb1g〜Ob6gと、を含んでいる。これらのオブジェクトOb1g〜Ob6g、背景Bg2gのうち、文字Ob3g〜Ob6g以外の部分(非文字部分とも呼ぶ)は、スキャン画像SIと比較して、平滑化されている。   FIG. 3C shows a smoothed image GI indicated by the smoothed image data. The smoothed image GI includes a white background Bg1g and objects Ob1g to Ob6g obtained by smoothing the objects Ob1 to Ob6 in the scan image SI. Of these objects Ob1g to Ob6g and background Bg2g, portions other than the characters Ob3g to Ob6g (also referred to as non-character portions) are smoothed compared to the scanned image SI.

S40では、CPU210は、平滑化画像データに対して、文字鮮鋭化処理を実行して、処理済み画像データを生成する。具体的には、CPU210は、平滑化画像データに含まれる複数個の文字画素の値のそれぞれに対して、アンシャープマスク処理や鮮鋭化フィルタを適用する処理などの鮮鋭化処理を実行して、鮮鋭化処理済みの複数個の文字画素の値を算出する。鮮鋭化処理の対象となる文字画素は、S20の文字特定処理によって生成された文字特定データを参照して特定される。そして、CPU210は、平滑化画像データに含まれる複数個の非文字画素の値(平滑化処理済みの複数個の非文字画素の値)と、鮮鋭化処理済みの複数個の文字画素の値と、を含む処理済み画像データを生成する。平滑化画像データに含まれる複数個の文字画素の値は、平滑化処理の対象ではないので、スキャンデータに含まれる複数個の文字画素の値と同じである。したがって、本ステップの文字鮮鋭化処理は、スキャンデータに含まれる複数個の文字画素の値に対して実行される、とも言うことができる。   In S40, the CPU 210 performs a character sharpening process on the smoothed image data to generate processed image data. Specifically, the CPU 210 performs a sharpening process such as an unsharp mask process or a process of applying a sharpening filter on each of the plurality of character pixel values included in the smoothed image data, The values of a plurality of character pixels that have been sharpened are calculated. The character pixel to be subjected to the sharpening process is specified with reference to the character specifying data generated by the character specifying process of S20. The CPU 210 then includes a plurality of non-character pixel values (smoothed non-character pixel values) included in the smoothed image data, and a plurality of sharpened character pixel values. To generate processed image data. Since the values of the plurality of character pixels included in the smoothed image data are not subject to smoothing processing, they are the same as the values of the plurality of character pixels included in the scan data. Therefore, it can be said that the character sharpening process in this step is performed on the values of a plurality of character pixels included in the scan data.

図3(D)には、処理済み画像データによって示される処理済み画像FIが示されている。処理済み画像FIは、白色の背景Bg1fと、スキャン画像SI内のオブジェクトOb1〜Ob6に対応するオブジェクトOb1f〜Ob6fを含んでいる。これらのオブジェクトOb1f〜Ob6fのうち、文字Ob3f〜Ob6fのエッジは、スキャン画像SI内の文字Ob3〜Ob6や、平滑化画像GI内の文字Ob3g〜Ob6gと比較して、鮮鋭化されている。また、写真Ob1f、Ob2fのエッジは、鮮鋭化されていない。   FIG. 3D shows a processed image FI indicated by the processed image data. The processed image FI includes a white background Bg1f and objects Ob1f to Ob6f corresponding to the objects Ob1 to Ob6 in the scan image SI. Among these objects Ob1f to Ob6f, the edges of the characters Ob3f to Ob6f are sharpened as compared with the characters Ob3 to Ob6 in the scan image SI and the characters Ob3g to Ob6g in the smoothed image GI. Further, the edges of the photographs Ob1f and Ob2f are not sharpened.

以上の説明から解るように、処理済み画像FI内のオブジェクトOb1f〜Ob6f、背景Bg2fは、鮮鋭化された文字と、平滑化された非文字を含む。   As can be understood from the above description, the objects Ob1f to Ob6f and the background Bg2f in the processed image FI include sharpened characters and smoothed non-characters.

S50では、CPU210は、処理済み画像データを用いて印刷データを生成する印刷データ生成処理を実行する。具体的には、RGB画像データである処理済み画像データに対して色変換処理が実行されて、印刷に用いられる色材に対応する色成分(C、M、Y、Kの成分)を有する色値であるCMYK値で画素ごとの色を示すCMYK画像データが生成される。色変換処理は、例えば、公知のルックアップテーブルを参照して実行される。CMYK値画像データに対して、ハーフトーン処理が実行されて、印刷に用いられる色材ごと、かつ、画素ごとに、ドットの形成状態を示すドットデータが生成される。ドットの形成状態は、例えば、ドット有、ドット無の2種類の状態や、大ドット、中ドット、小ドット、ドット無の4種類の状態を取り得る。ハーフトーン処理は、例えば、ディザ法や、誤差拡散法に従って実行される。該ドットデータは、印刷時に用いられる順に並べ替えられ、該ドットデータに、印刷コマンドが付加されることによって、印刷データが生成される。   In S50, the CPU 210 executes a print data generation process for generating print data using the processed image data. Specifically, a color having a color component (C, M, Y, K components) corresponding to a color material used for printing is performed by performing color conversion processing on processed image data that is RGB image data. CMYK image data indicating a color for each pixel with a CMYK value that is a value is generated. The color conversion process is executed with reference to a known lookup table, for example. Halftone processing is performed on the CMYK value image data, and dot data indicating a dot formation state is generated for each color material used for printing and for each pixel. The dot formation state can take, for example, two types of states with and without dots, and four types of states with large dots, medium dots, small dots, and no dots. The halftone process is executed according to, for example, a dither method or an error diffusion method. The dot data is rearranged in the order used in printing, and print data is generated by adding a print command to the dot data.

S60では、CPU210は、印刷処理を実行して、画像処理を終了する。具体的には、CPU210は、印刷データを印刷実行部280に供給して、印刷実行部280に処理済み画像を印刷させる。   In S60, the CPU 210 executes the printing process and ends the image processing. Specifically, the CPU 210 supplies print data to the print execution unit 280 and causes the print execution unit 280 to print the processed image.

以上説明した画像処理によれば、スキャンデータのうち、特定済みの複数個の文字画素の値に対して第1の画像処理(具体的には、エッジ鮮鋭化処理)が実行され(S40)、複数個の非文字画素の値に対して第1の画像処理とは異なる第2の画像処理(具体的には、網点平滑化処理)が実行され(S30)、処理済み画像データが生成される。この結果、文字画素の値と、文字画素とは異なる画素の値と、に対して、互いに異なる画像処理が実行されるので、スキャンデータに対する適切な画像処理を実現できる。なお、変形例では、S40の文字鮮鋭化処理が先に実行され、その後に、S30の網点平滑化処理が実行されても良い。   According to the image processing described above, first image processing (specifically, edge sharpening processing) is performed on the values of a plurality of specified character pixels in the scan data (S40), A second image process (specifically, a halftone dot smoothing process) different from the first image process is performed on a plurality of non-character pixel values (S30), and processed image data is generated. The As a result, different image processing is executed for the character pixel value and the pixel value different from the character pixel, so that appropriate image processing for the scan data can be realized. In the modification, the character sharpening process of S40 may be executed first, and then the halftone dot smoothing process of S30 may be executed.

より具体的には、鮮鋭化処理済みの複数個の文字画素の値と、平滑化処理済みの複数個の非文字画素の値と、を含む処理済み画像データが生成される(S30、S40)。この結果、見栄えの良い処理済み画像FIを示す処理済み画像データを生成することができる。   More specifically, processed image data including a plurality of character pixel values that have undergone sharpening processing and a plurality of non-character pixel values that have undergone smoothing processing are generated (S30, S40). . As a result, processed image data indicating the processed image FI having a good appearance can be generated.

例えば、図3(D)の処理済み画像FIに示すように、処理済み画像データでは、文字画素の値には、鮮鋭化処理済みの値が用いられている。この結果、処理済み画像FIの文字がシャープに見えるので、例えば、印刷される処理済み画像FIの見栄えを向上することができる。   For example, as shown in the processed image FI in FIG. 3D, in the processed image data, the value after the sharpening process is used as the value of the character pixel. As a result, since the characters of the processed image FI look sharp, for example, the appearance of the processed image FI to be printed can be improved.

また、処理済み画像データでは、処理済み画像FI内の写真などの文字とは異なるオブジェクトを構成する非文字画素の値には、平滑化処理済みの値が用いられている。この結果、処理済み画像FIの文字とは異なる部分に、例えば、モアレの原因となる網点が表れることを抑制できるので、印刷される処理済み画像FIにモアレなどの不具合が発生することを抑制できる。この結果、印刷される処理済み画像FIの見栄えを向上することができる。また、写真内のエッジが過度に強調されることが抑制されるので、画像FIの見栄えをさらに向上することができる。   In the processed image data, a smoothed value is used as the value of a non-character pixel constituting an object different from a character such as a photograph in the processed image FI. As a result, for example, it is possible to suppress the appearance of halftone dots that cause moire in a portion different from the characters of the processed image FI, thereby suppressing the occurrence of defects such as moire in the processed image FI to be printed. it can. As a result, the appearance of the processed image FI to be printed can be improved. Moreover, since it is suppressed that the edge in a photograph is emphasized too much, the appearance of the image FI can be further improved.

例えば、スキャンデータの生成に用いられた原稿は、画像が印刷された印刷物である。このため、例えば、原稿内の白とは異なる色を有する部分は、画像を形成するドットレベルでみると、網点を形成している。網点は、複数個のドットと、ドットが配置されていない部分(原稿の地色を示す部分)と、を含む。このために、スキャン画像SI内の原稿内の白とは異なる色を有する部分には、画素レベルでみると、網点が示されている。網点内のドットは、原稿の印刷時に用いられるディザマトリクスなどの影響によって、周期性を持って並んでいる。このためにスキャンデータを用いて印刷を行うと、ハーフトーン処理前の元画像(スキャン画像SI)内に存在している網点のドットの周期成分と、印刷画像を構成する網点のドットの周期成分と、が干渉して、モアレが表れやすい。本実施例の処理済み画像FIでは、平滑化処理によって、元画像(スキャン画像SI)内のエッジとは異なる部分のドットの周期成分が低減される。この結果、処理済み画像データを用いて、処理済み画像FIを印刷する場合に、例えば、印刷される処理済み画像FIにモアレが発生することを抑制できる。   For example, a document used for generating scan data is a printed material on which an image is printed. For this reason, for example, a portion having a color different from white in the original forms halftone dots when viewed at the dot level for forming an image. A halftone dot includes a plurality of dots and a portion where no dot is arranged (a portion indicating the background color of the document). For this reason, halftone dots are shown at the pixel level in a portion having a color different from white in the original in the scanned image SI. The dots in the halftone dots are arranged with periodicity due to the influence of a dither matrix used at the time of printing an original. For this purpose, when printing is performed using scan data, the dot components of halftone dots existing in the original image (scanned image SI) before halftone processing and the dots of dots constituting the print image are displayed. Moire is likely to appear due to interference with periodic components. In the processed image FI of the present embodiment, the periodic component of the dot in the portion different from the edge in the original image (scanned image SI) is reduced by the smoothing process. As a result, when the processed image FI is printed using the processed image data, for example, it is possible to suppress the occurrence of moire in the processed image FI to be printed.

特に、上記画像処理では、処理済み画像データを用いて、印刷データが生成される(S50)ので、例えば、印刷される処理済み画像FIに発生しやすいモアレを抑制可能な適切な印刷データを生成することができる。   In particular, in the image processing, print data is generated using the processed image data (S50). For example, appropriate print data that can suppress moire that is likely to occur in the processed image FI to be printed is generated. can do.

A−3:文字特定処理
図2のS20の文字特定処理について説明する。S22では、CPU210は、スキャンデータを用いて、第1の二値画像データ生成処理を実行して、第1の二値画像データを生成する。第1の二値画像データは、エッジ画素と非エッジ画素とを示す二値データである。ここで、第1の二値画像データによって示されるエッジ画素を第1のエッジ画素とも呼び、第1の二値画像データによって示される非エッジ画素を第1の非エッジ画素とも呼ぶ。第1の二値画像データ生成処理の詳細は、後述する。
A-3: Character Identification Process The character identification process in S20 of FIG. 2 will be described. In S22, the CPU 210 executes a first binary image data generation process using the scan data, and generates first binary image data. The first binary image data is binary data indicating edge pixels and non-edge pixels. Here, the edge pixel indicated by the first binary image data is also referred to as a first edge pixel, and the non-edge pixel indicated by the first binary image data is also referred to as a first non-edge pixel. Details of the first binary image data generation processing will be described later.

S24では、CPU210は、スキャンデータを用いて、第2の二値画像データ生成処理を実行して、第2の二値画像データを生成する。第2の二値画像データは、第1の二値画像データと同様に、エッジ画素と非エッジ画素とを示す二値データである。第2の二値画像データは、第1の二値画像データとは異なる処理によって生成され、第1の二値画像データとは異なるデータである。ここで、第2の二値画像データによって示されるエッジ画素を第2のエッジ画素とも呼び、第2の二値画像データによって示される非エッジ画素を第2の非エッジ画素とも呼ぶ。第2の二値画像データ生成処理の詳細は、後述する。   In S24, the CPU 210 executes the second binary image data generation process using the scan data, and generates the second binary image data. Similar to the first binary image data, the second binary image data is binary data indicating edge pixels and non-edge pixels. The second binary image data is generated by a process different from the first binary image data, and is different from the first binary image data. Here, the edge pixel indicated by the second binary image data is also referred to as a second edge pixel, and the non-edge pixel indicated by the second binary image data is also referred to as a second non-edge pixel. Details of the second binary image data generation processing will be described later.

S26では、CPU210は、S22にて生成された第1の二値画像データと、S24にて生成された第2の二値画像データと、を合成する論理和合成処理を実行して、最終的に特定されるエッジ画素と非エッジ画素とを示す二値画像データ(エッジ特定データとも呼ぶ)を生成する。具体的には、CPU210は、第1の二値画像データと、第2の二値画像データと、の各画素の論理和を取ることによって、エッジ特定データとしての二値画像データを生成する。換言すれば、CPU210は、第1の二値画像データによって特定される複数個の第1のエッジ画素と、第2の二値画像データによって特定される複数個の第2のエッジ画素と、を含む画素群であって、第1のエッジ画素とも第2のエッジ画素とも異なる画素を含まない画素群を、最終的に、複数個のエッジ画素として特定する。この結果、第1の二値画像データと第2の二値画像データとを用いて、対象画像内の画素がエッジ画素であるか否かを精度良く判断することができる。例えば、スキャン画像SI内のエッジ画素の特定漏れを効果的に低減できる。   In S26, the CPU 210 executes a logical sum synthesis process for synthesizing the first binary image data generated in S22 and the second binary image data generated in S24. Binary image data (also referred to as edge specifying data) indicating edge pixels and non-edge pixels specified in (1) is generated. Specifically, the CPU 210 generates binary image data as edge specifying data by calculating the logical sum of each pixel of the first binary image data and the second binary image data. In other words, the CPU 210 includes a plurality of first edge pixels specified by the first binary image data and a plurality of second edge pixels specified by the second binary image data. A pixel group that includes a pixel group that does not include a pixel different from the first edge pixel and the second edge pixel is finally specified as a plurality of edge pixels. As a result, it is possible to accurately determine whether or not the pixel in the target image is an edge pixel using the first binary image data and the second binary image data. For example, it is possible to effectively reduce specific omission of edge pixels in the scan image SI.

エッジ特定データによって特定されるエッジ画素は、文字画素の候補となる画素であり、文字候補画素とも呼ぶ。例えば、エッジ特定データは、文字候補画素(本実施例ではエッジ画素)の値が「1」とされ、文字候補画素ではない画素(本実施例では、非エッジ画素)の値が「0」とされた二値画像データである。   The edge pixels specified by the edge specifying data are pixels that are candidates for character pixels, and are also referred to as character candidate pixels. For example, in the edge specifying data, the value of a character candidate pixel (edge pixel in this embodiment) is “1”, and the value of a pixel that is not a character candidate pixel (non-edge pixel in this embodiment) is “0”. Binary image data.

図4は、文字特定処理で用いられる画像の一例を示す図である。図4(A)には、エッジ特定データによって示されるエッジ特定画像EIの一例が示されている。このエッジ特定画像EIには、スキャン画像SI内のオブジェクトOb1〜Ob6のエッジEg1〜Eg6を構成する複数個のエッジ画素が、文字候補画素として特定されている。このように、文字候補画素によって示されるエッジは、文字のエッジを含む。また、該エッジは、文字とは異なるオブジェクト(例えば、写真)に含まれる細線などのエッジを含む。   FIG. 4 is a diagram illustrating an example of an image used in the character identification process. FIG. 4A shows an example of the edge specifying image EI indicated by the edge specifying data. In the edge specifying image EI, a plurality of edge pixels constituting the edges Eg1 to Eg6 of the objects Ob1 to Ob6 in the scan image SI are specified as character candidate pixels. Thus, the edge indicated by the character candidate pixel includes the edge of the character. In addition, the edge includes an edge such as a thin line included in an object (for example, a photograph) different from the character.

S27では、S15の拡大処理における拡大率Lrは、閾値Lth未満であるか否かを判断する。例えば、拡大率の閾値Lthは、例えば、3(300%)である。拡大率Lrが閾値Lth未満である場合には(S27:YES)、CPU210は、S28に処理を進める。   In S27, it is determined whether or not the enlargement ratio Lr in the enlargement process in S15 is less than the threshold value Lth. For example, the threshold value Lth of the enlargement ratio is 3 (300%), for example. When the enlargement ratio Lr is less than the threshold Lth (S27: YES), the CPU 210 advances the process to S28.

S28では、CPU210は、スキャンデータに対して、非文字領域判定処理を実行して、非文字領域を特定する。すなわち、非文字領域を構成する複数個の画素と、非文字領域を構成しない複数個の画素と、を示す二値画像データ(非文字領域データとも呼ぶ)を生成する。詳細は、後述するが、非文字領域判定処理では、CPU210は、スキャンデータを用いて、スキャン画像SI内に配置される複数個の対象領域のそれぞれが、文字とは異なるオブジェクト(例えば、写真)を示す非文字領域であるか否かを対象領域ごとに判断する。CPU210は、対象領域ごとの判断結果に基づいて、非文字領域データを生成する。非文字領域データは、例えば、非文字領域を構成する画素の値が「1」とされ、非文字領域を構成しない画素の値が「0」とされた二値画像データである。   In S28, the CPU 210 performs a non-character area determination process on the scan data to identify a non-character area. That is, binary image data (also referred to as non-character area data) indicating a plurality of pixels constituting a non-character area and a plurality of pixels not constituting a non-character area is generated. Although details will be described later, in the non-character area determination process, the CPU 210 uses the scan data and each of the plurality of target areas arranged in the scan image SI is an object (for example, a photograph) different from the character. Is determined for each target area. The CPU 210 generates non-character area data based on the determination result for each target area. The non-character area data is, for example, binary image data in which the value of a pixel constituting the non-character area is “1” and the value of a pixel not constituting the non-character area is “0”.

図4(B)には、非文字領域データによって示される非文字領域画像AIの一例が示されている。この非文字領域画像AIは、スキャン画像SI内の写真Ob1、Ob2に対応する領域に、非文字領域AA1、AA2が特定されている。   FIG. 4B shows an example of the non-character area image AI indicated by the non-character area data. In this non-character area image AI, non-character areas AA1 and AA2 are specified in areas corresponding to photographs Ob1 and Ob2 in the scan image SI.

S29では、CPU210は、S26にて生成されたエッジ特定データと、S28にて生成された非文字領域データと、を合成する合成処理を実行して、文字画素と非文字画素とを示す上述した文字特定データ(図3(B)参照)を生成する。具体的には、CPU210は、エッジ特定データにて特定される複数個の文字候補画素のうち、非文字領域データにて特定される非文字領域AA1、AA2内に位置しない画素を、文字画素として特定する。CPU210は、エッジ特定データにて特定される複数個の文字候補画素のうち、非文字領域AA1、AA2内に位置する画素と、文字候補画素ではない画素を、非文字画素として特定する。換言すれば、スキャン画像SI内の複数個の画素のうち、S22〜S26にて文字候補画素であると決定され、かつ、S28にて決定される非文字領域とは異なる領域にある画素が、文字画素として特定される。文字特定データが生成されると、文字特定処理は、終了される。   In S29, the CPU 210 performs a synthesis process for synthesizing the edge specifying data generated in S26 and the non-character area data generated in S28 to show the character pixel and the non-character pixel as described above. Character specifying data (see FIG. 3B) is generated. Specifically, the CPU 210 sets, as character pixels, pixels that are not located in the non-character areas AA1 and AA2 specified by the non-character area data among the plurality of character candidate pixels specified by the edge specifying data. Identify. CPU210 specifies the pixel located in non-character area AA1 and AA2 and the pixel which is not a character candidate pixel among a plurality of character candidate pixels specified by edge specific data as a non-character pixel. In other words, among a plurality of pixels in the scanned image SI, pixels that are determined to be character candidate pixels in S22 to S26 and that are in a region different from the non-character region determined in S28 are: Identified as a character pixel. When the character specifying data is generated, the character specifying process is terminated.

拡大率Lrが閾値Lth以上である場合には(S27:NO)、CPU210は、S28、S29をスキップして文字特定処理を終了する。この場合には、S26の論理和合成処理によって生成されたエッジ特定データが、最終的な文字特定データとされる。すなわち、この場合には、CPU210は、S22〜S26において文字候補画素であると決定される画素を、文字画素として特定する。なお、変形例としては、CPU210は、S28の非文字領域判定処理を実行した後に、S27の判断を実行しても良い。すなわち、S28の後に、拡大率Lrが閾値Lth未満であるか否かが判断されても良い。この場合にも、拡大率Lrが閾値Lth未満である場合には、S29が実行されて、文字特定データが生成される。そして、拡大率Lrが閾値Lth以上である場合には、S29がスキップされ、S26の論理和合成処理によって生成されたエッジ特定データが、最終的な文字特定データとされる。   When the enlargement ratio Lr is equal to or greater than the threshold value Lth (S27: NO), the CPU 210 skips S28 and S29 and ends the character specifying process. In this case, the edge specifying data generated by the logical sum synthesis process in S26 is the final character specifying data. That is, in this case, the CPU 210 identifies the pixels determined to be character candidate pixels in S22 to S26 as character pixels. As a modification, the CPU 210 may execute the determination of S27 after executing the non-character area determination process of S28. That is, after S28, it may be determined whether or not the enlargement ratio Lr is less than the threshold value Lth. Also in this case, when the enlargement ratio Lr is less than the threshold value Lth, S29 is executed and character specifying data is generated. If the enlargement ratio Lr is greater than or equal to the threshold value Lth, S29 is skipped, and the edge specifying data generated by the logical sum synthesis process of S26 is used as final character specifying data.

A−4:第1の二値画像データ生成処理
図2のS22の第1の二値画像データ生成処理について説明する。図5は、第1の二値画像データ生成処理のフローチャートである。S100では、CPU210は、スキャンデータに含まれる3個の成分画像データ、すなわち、R成分画像データ、G成分画像データ、B成分画像データのそれぞれに対して、平滑化処理を実行する。これによって、3個の平滑化済みの成分画像データ、すなわち、平滑化済みのR成分画像データ、平滑化済みのG成分画像データ、平滑化済みのB成分画像データが生成される。
A-4: First Binary Image Data Generation Processing The first binary image data generation processing in S22 of FIG. 2 will be described. FIG. 5 is a flowchart of the first binary image data generation process. In S100, the CPU 210 executes a smoothing process on each of the three component image data included in the scan data, that is, R component image data, G component image data, and B component image data. As a result, three smoothed component image data, that is, smoothed R component image data, smoothed G component image data, and smoothed B component image data are generated.

平滑化処理は、処理対象の成分画像データによって示される成分画像を平滑化する処理である。本実施例の平滑化処理は、処理対象の成分画像データの各画素の値に対して、所定の平滑化フィルタを適用して、平滑化済みの各画素の値を算出する処理である。平滑化フィルタには、例えば、縦7画素×横7画素のサイズのガウスフィルタが用いられる。   The smoothing process is a process for smoothing the component image indicated by the component image data to be processed. The smoothing process of the present embodiment is a process of calculating the value of each smoothed pixel by applying a predetermined smoothing filter to the value of each pixel of the component image data to be processed. As the smoothing filter, for example, a Gaussian filter having a size of 7 vertical pixels × 7 horizontal pixels is used.

S110では、3個の平滑化済みの成分画像データのそれぞれに対して、エッジ強調処理を実行して、3個のエッジ強調済みの成分画像データ、すなわち、エッジ強調済みのR成分画像データ、エッジ強調済みのG成分画像データ、エッジ強調済みのB成分画像データを生成する。   In S110, edge enhancement processing is performed on each of the three smoothed component image data to obtain three edge-enhanced component image data, that is, edge-enhanced R-component image data, edge Emphasized G component image data and edge enhanced B component image data are generated.

図6は、エッジ強調処理のフローチャートである。ここでは、平滑化済みのR成分画像データが処理対象であるとして説明する。平滑化済みのG成分画像データおよび平滑化済みのB成分画像データに対しても同様の処理が行われる。   FIG. 6 is a flowchart of edge enhancement processing. Here, it is assumed that the smoothed R component image data is a processing target. The same processing is performed on the smoothed G component image data and the smoothed B component image data.

S200では、CPU210は、エッジ強調済みのR成分画像データを生成するためのキャンバスデータをメモリ(具体的には、揮発性記憶装置220のバッファ領域)に準備する。キャンバスデータによって示されるキャンバス(初期画像)は、スキャン画像SIと同じサイズの画像、すなわち、同じ画素数の画像である。キャンバスデータの各画素の値は、所定の初期値(例えば、0)である。   In S200, the CPU 210 prepares canvas data for generating edge-enhanced R component image data in a memory (specifically, a buffer area of the volatile storage device 220). The canvas (initial image) indicated by the canvas data is an image having the same size as the scan image SI, that is, an image having the same number of pixels. The value of each pixel of the canvas data is a predetermined initial value (for example, 0).

S205では、CPU210は、平滑化済みのR成分画像データによって示される平滑化済みのR成分画像内の複数個の画素から1個の注目画素を選択する。   In S205, the CPU 210 selects one pixel of interest from a plurality of pixels in the smoothed R component image indicated by the smoothed R component image data.

S210では、CPU210は、注目画素に対応するマスク値MVを算出する。マスク値MVは、注目画素の値TVと、注目画素に対して上下左右に隣接する4個の画素を含む所定個数の周辺画素の値と、を用いて、注目画素の値TVを平滑化する処理によって算出される。このために、マスク値MVを、平滑値とも呼ぶ。具体的には、注目画素を中心とする縦10画素×横10画素の矩形の範囲内の100個の画素の値の平均値が、注目画素に対応するマスク値MVとして算出される。   In S210, the CPU 210 calculates a mask value MV corresponding to the target pixel. The mask value MV smoothes the value TV of the target pixel using the value TV of the target pixel and the values of a predetermined number of surrounding pixels including four pixels adjacent to the target pixel in the vertical and horizontal directions. Calculated by processing. For this reason, the mask value MV is also called a smooth value. Specifically, an average value of the values of 100 pixels within a rectangular range of 10 pixels vertically × 10 pixels horizontally centered on the target pixel is calculated as a mask value MV corresponding to the target pixel.

S220では、CPU210は、注目画素の値TVと、注目画素に対応するマスク値MVと、の差分ΔVを算出する(ΔV=(TV−MV))。   In S220, the CPU 210 calculates a difference ΔV between the value TV of the target pixel and the mask value MV corresponding to the target pixel (ΔV = (TV−MV)).

S230では、CPU210は、差分ΔVは、基準以上であるか否かを判断する。具体的には、差分ΔVが、予め定められた閾値TH以上であるか否かが判断される。閾値THは、成分値が、0〜255の範囲の256階調の値である場合に、例えば、20〜30程度の値である。   In S230, the CPU 210 determines whether or not the difference ΔV is greater than or equal to a reference. Specifically, it is determined whether or not the difference ΔV is equal to or greater than a predetermined threshold value TH. The threshold value TH is a value of about 20 to 30 when the component value is a value of 256 gradations in the range of 0 to 255, for example.

差分ΔVが基準以上である場合には(S230:YES)、S240にて、CPU210は、注目画素の値TVと、注目画素に対応する差分ΔVと、の和(TV+ΔV)を、処理済みの値として算出する。差分ΔVが基準未満である場合には(S230:NO)、CPU210は、S240をスキップする。   When the difference ΔV is greater than or equal to the reference (S230: YES), in S240, the CPU 210 calculates the sum of the target pixel value TV and the difference ΔV corresponding to the target pixel (TV + ΔV) as a processed value. Calculate as When the difference ΔV is less than the reference (S230: NO), the CPU 210 skips S240.

S245では、CPU210は、注目画素の値を、S200にて準備されたキャンバスデータに記録する。S240が実行された場合には、S240にて算出された注目画素の値TVと、注目画素に対応する差分ΔVと、の和が、処理済みの値としてキャンバスデータに記録される。S240がスキップされた場合には、平滑化済みのR成分画像データの注目画素の値が、そのまま、キャンバスデータに記録される。   In S245, the CPU 210 records the value of the target pixel in the canvas data prepared in S200. When S240 is executed, the sum of the target pixel value TV calculated in S240 and the difference ΔV corresponding to the target pixel is recorded in the canvas data as a processed value. When S240 is skipped, the value of the target pixel of the smoothed R component image data is recorded in the canvas data as it is.

S250では、CPU210は、R成分画像内の全ての画素を注目画素として処理したか否かを判断する。未処理の画素がある場合には(S250:NO)、CPU210は、S205に戻って、未処理の画素を注目画素として選択する。全ての画素が処理された場合には(S250:YES)、CPU210は、エッジ強調処理を終了する。この時点でエッジ強調済みのR成分画像データが生成されている。   In S250, the CPU 210 determines whether or not all the pixels in the R component image have been processed as the target pixel. When there is an unprocessed pixel (S250: NO), the CPU 210 returns to S205 and selects an unprocessed pixel as a target pixel. When all the pixels have been processed (S250: YES), the CPU 210 ends the edge enhancement processing. At this time, edge-enhanced R component image data is generated.

図7は、平滑化済みのR成分画像データと、エッジ強調済みのR成分画像データと、の説明図である。図7(A)には、図5のS100の平滑化処理前のR成分画像データを概念的に示すグラフが図示されている。図7(B)、図7(C)には、それぞれ、平滑化処理済みのR成分画像データ、および、エッジ強調済みのR成分画像データを概念的に示すグラフが図示されている。各グラフのうち、左側の部分には、網点を示す網点領域が概念的に示され、右側の部分には、文字などのオブジェクトのエッジを示すエッジ領域が概念的に示されている。各グラフの縦軸は、R成分の値を示し、横軸は、所定の方向(例えば、図3の第1方向D1)の位置を示す。   FIG. 7 is an explanatory diagram of smoothed R component image data and edge-enhanced R component image data. FIG. 7A shows a graph conceptually showing the R component image data before the smoothing process in S100 of FIG. FIGS. 7B and 7C show graphs conceptually showing smoothed R component image data and edge-enhanced R component image data, respectively. In each graph, the left portion conceptually shows a halftone dot region indicating a halftone dot, and the right portion conceptually shows an edge region indicating an edge of an object such as a character. The vertical axis of each graph indicates the value of the R component, and the horizontal axis indicates the position in a predetermined direction (for example, the first direction D1 in FIG. 3).

平滑化処理前のR成分画像データには、例えば、網点領域において、複数個の網点と、該網点間の複数個の隙間と、に対応する複数個の谷部C1〜C3と、複数個の山部P1、P2と、が現れる(図7(A))。このような谷部C1〜C3と、複数個の山部P1、P2と、の間のR成分の値の差が大きいまま残存していると、後述するS150の二値化処理において、該R成分の値の差に起因して、網点を示すエッジ画素が特定されやすい。網点領域は、画素レベルの視点(網点を認識できる程度のミクロの視点)でみれば、網点を含むが、観察者の視点(網点を認識できない程度のマクロの視点)でみれば、均一な領域である。このため、本実施例では、網点領域内において、網点に起因するエッジ画素は、特定されるべきではない。網点領域は、図2のS30で平滑化されることが好ましく、S40にて、鮮鋭化されるべきではないからである。仮に、網点のエッジが鮮鋭化されると、網点の周期性が目立つために、該画像を印刷する場合に、モアレが目立ちやすくなるからである。例えば、スキャン画像SI内の写真などのオブジェクト内の均一な部分において、エッジ画素は、特定されるべきではない。   R component image data before smoothing processing includes, for example, a plurality of valley portions C1 to C3 corresponding to a plurality of halftone dots and a plurality of gaps between the halftone dots in a halftone dot region, A plurality of peaks P1 and P2 appear (FIG. 7A). If the difference in R component values between the valleys C1 to C3 and the plurality of peaks P1 and P2 remains large, in the binarization process of S150 described later, the R Due to the difference in the component values, an edge pixel indicating a halftone dot is likely to be specified. A halftone dot area includes halftone dots when viewed from a pixel-level viewpoint (a micro viewpoint that can recognize halftone dots), but from an observer's viewpoint (a macro viewpoint that does not recognize halftone dots). It is a uniform area. For this reason, in this embodiment, the edge pixel due to the halftone dot should not be specified in the halftone dot region. This is because the halftone dot region is preferably smoothed in S30 of FIG. 2, and should not be sharpened in S40. This is because if the halftone dot edge is sharpened, the periodicity of the halftone dot becomes conspicuous, and therefore, moire becomes conspicuous when the image is printed. For example, edge pixels should not be identified in a uniform part in an object such as a photograph in the scanned image SI.

平滑化済みのR成分画像データでは、平滑化処理によって、例えば、網点領域において、複数個の谷部C1a〜C3aと、複数個の山部P1a、P2aと、のR成分の値の差が、平滑化処理前のR成分画像データと比較して十分に小さくなっている(図7(B))。   In the smoothed R component image data, for example, in the halftone dot region, the difference in R component values between the plurality of valleys C1a to C3a and the plurality of peaks P1a and P2a is obtained by the smoothing process. It is sufficiently smaller than the R component image data before the smoothing process (FIG. 7B).

ここで、本実施例のエッジ強調処理では、注目画素の値TVと、注目画素に対応するマスク値MVと、の差分ΔVと、が大きいほど、エッジ強調の効果が大きくなる。このために、図7(B)の網点領域のように、比較的R成分の値の差が小さく平坦になっている領域では、エッジ強調の効果が小さくなる。また、本実施例のエッジ強調処理では、差分ΔVが基準未満である場合には、エッジ強調が行われずに、平滑化済みのR成分画像データの画素の値がそのまま採用される(図6のS230)。この結果、エッジ強調済みのR成分画像データでは、エッジ強調処理が行われたにも関わらずに、例えば、網点領域において、複数個の谷部C1b〜C3bと、複数個の山部P1b、P2bと、のR成分の値の差は、平滑化処理済みのR成分画像データと比較して大きくなってはいない(図7(C))。すなわち、平滑化済みのR成分画像データと同様に、エッジ強調済みのR成分画像データでは、複数個の谷部C1b〜C3bと、複数個の山部P1b、P2bと、のR成分の値の差が、平滑化処理前のR成分画像データ(図7(A))と比較して十分に小さくなっている(図7(C))。   Here, in the edge enhancement processing of the present embodiment, the effect of edge enhancement increases as the difference ΔV between the value TV of the target pixel and the mask value MV corresponding to the target pixel increases. For this reason, the effect of edge emphasis is reduced in a region where the difference in R component values is relatively small and flat, such as the halftone dot region in FIG. 7B. Further, in the edge enhancement processing of this embodiment, when the difference ΔV is less than the reference, the edge enhancement is not performed and the pixel value of the smoothed R component image data is used as it is (see FIG. 6). S230). As a result, in the R component image data that has undergone edge enhancement, for example, in the halftone dot region, a plurality of valleys C1b to C3b and a plurality of peaks P1b, The difference between the R component values of P2b and the R component image data subjected to the smoothing process is not large (FIG. 7C). That is, similarly to the smoothed R component image data, the edge-enhanced R component image data has R component values of a plurality of valleys C1b to C3b and a plurality of peaks P1b and P2b. The difference is sufficiently smaller than the R component image data before smoothing (FIG. 7A) (FIG. 7C).

平滑化処理前のR成分画像データには、例えば、文字などのオブジェクトのエッジを示すエッジ領域において、該エッジに対応してR成分の値が急激に変化する変動部E1が現れる(図7(A))。このような変動部E1において、値の変化が大きいほど、後述するS150の二値化処理において、該R成分の値の差に起因して、オブジェクトのエッジを示すエッジ画素が特定されやすい。   In the R component image data before the smoothing process, for example, in an edge region indicating an edge of an object such as a character, a fluctuation part E1 in which the value of the R component changes rapidly corresponding to the edge appears (FIG. 7 ( A)). In such a variation part E1, the larger the change in the value, the easier it is to identify the edge pixel indicating the edge of the object due to the difference in the value of the R component in the binarization process of S150 described later.

平滑化済みのR成分画像データでは、平滑化処理によって、例えば、エッジ領域において、変動部E1aにおける値の変化が、平滑化処理前のR成分画像データと比較して小さくなっている(緩やかになっている)(図7(B))。   In the smoothed R component image data, for example, in the edge region, the change in the value in the changing portion E1a is smaller than the R component image data before the smoothing processing due to the smoothing processing (slowly). (FIG. 7B).

しかしながら、文字などのオブジェクトのエッジに対応する変動部E1aにおける値の変化は、網点領域における値の変化よりは十分に大きいので、エッジ強調処理によって、再度、急激な変化に戻される。この結果、エッジ強調済みのR成分画像データでは、エッジ領域において、変動部E1bのR成分の値の変化は、平滑化処理済みのR成分画像データと比較して大きくなっている(図7(C))。このため、エッジ強調済みのR成分画像データでは、エッジ領域において、変動部E1bにおける値の変化が、平滑化処理前のR成分画像データと比較して、同程度、もしくは、急激になっている(図7(C))。   However, since the change in the value in the fluctuation part E1a corresponding to the edge of the object such as a character is sufficiently larger than the change in the value in the halftone dot region, it is again returned to a rapid change by the edge emphasis process. As a result, in the edge component-enhanced R component image data, the change in the value of the R component of the changing portion E1b in the edge region is larger than that in the smoothed R component image data (FIG. 7 ( C)). For this reason, in the edge component-enhanced R component image data, in the edge region, the change in the value in the variation portion E1b is comparable or abrupt compared to the R component image data before the smoothing process. (FIG. 7C).

以上の説明から解るように、本実施例では、各成分画像データに対して、平滑化処理(S100)と、エッジ強調処理(S110)とを、この順序で実行するので、網点のエッジを示すエッジ画素が特定されることを抑制することができ、かつ、文字などのオブジェクトのエッジを示すエッジ画素が特定されることを促進することができる。この結果、スキャン画像SI内の複数個のエッジ画素を適切に特定することができる。   As can be seen from the above description, in this embodiment, the smoothing process (S100) and the edge enhancement process (S110) are executed in this order for each component image data. It can suppress that the edge pixel to show is specified, and can promote specifying the edge pixel which shows the edge of objects, such as a character. As a result, it is possible to appropriately specify a plurality of edge pixels in the scan image SI.

R、G、Bの3個の色成分に対応する3個の強調処理済みの成分画像データが生成されると、図5の120では、該3個の強調処理済みの成分画像データを用いて、輝度画像データを生成する。輝度画像データは、該3個の強調処理済みの成分画像データによって示される強調済画像内の複数個の画素の輝度を示すデータである。具体的には、CPU210は、該3個の強調処理済みの成分画像データから取得される各画素のR値、G値、B値を用いて、各画素の輝度Yを算出する。輝度Yは、例えば、上記3成分の加重平均であり、具体的には、Y=0.299×R+0.587×G+0.114×Bの式を用いて算出できる。輝度画像データは、1種類の成分値(輝度を示す値)で構成される単成分画像データである。輝度成分データは、スキャンデータの対応する画素の値(RGB値)に基づく輝度Yを画素ごとに含んでいる。   When three enhanced component image data corresponding to the three color components of R, G, and B are generated, 120 of FIG. 5 uses the three enhanced component image data. Then, luminance image data is generated. The luminance image data is data indicating the luminance of a plurality of pixels in the enhanced image indicated by the three enhanced component image data. Specifically, the CPU 210 calculates the luminance Y of each pixel using the R value, G value, and B value of each pixel acquired from the three emphasized component image data. The luminance Y is, for example, a weighted average of the above three components, and specifically can be calculated using an equation of Y = 0.299 × R + 0.587 × G + 0.114 × B. The luminance image data is single component image data composed of one kind of component value (value indicating luminance). The luminance component data includes the luminance Y based on the value (RGB value) of the corresponding pixel of the scan data for each pixel.

S130では、CPU210は、生成された輝度画像データに対して、当該輝度画像データによって示される輝度画像内のエッジを抽出するエッジ抽出処理を実行して、エッジ抽出データを生成する。具体的には、CPU210は、輝度画像データの各画素の値に、公知のエッジ抽出フィルタ、例えば、ソーベルフィルタ(Sobel filter)を適用して、各画素のエッジ強度を算出する。CPU210は、これらのエッジ強度を、複数個の画素の値とするエッジ抽出データを生成する。   In S <b> 130, the CPU 210 generates edge extraction data by executing edge extraction processing for extracting edges in the luminance image indicated by the luminance image data with respect to the generated luminance image data. Specifically, the CPU 210 calculates the edge strength of each pixel by applying a known edge extraction filter, for example, a Sobel filter, to the value of each pixel of the luminance image data. The CPU 210 generates edge extraction data having these edge strengths as values of a plurality of pixels.

S140では、CPU210は、エッジ抽出データに対して、レベル補正処理を実行して、補正処理済みのエッジ抽出データを生成する。レベル補正処理は、エッジ抽出データの画素の値が取り得る階調値の範囲(本実施例では、0〜255の範囲)内の特定範囲を拡大する補正処理である。   In S140, the CPU 210 performs level correction processing on the edge extraction data to generate corrected edge extraction data. The level correction process is a correction process for enlarging a specific range within a range of gradation values that can be taken by the pixel value of the edge extraction data (in this embodiment, a range of 0 to 255).

図8は、レベル補正処理のためのトーンカーブの一例を示す図である。具体的には、CPU210は、エッジ抽出データの各画素に対して、図8のトーンカーブを適用する。この結果、閾値Vb(例えば、245)以上の値は、全て最大値(255)に変換されるとともに、閾値Va(例えば、10)以下の値は、全て最小値(0)に変換される。そして、閾値Vaより大きく、かつ、閾値Vb未満の範囲は、0から255の範囲に拡大される。このように、後述するS150の二値化処理の前に、二値化閾値を含む範囲(図8の閾値Vaより大きく、かつ、閾値Vb未満の範囲)を拡大するので、二値化の精度を向上できる。   FIG. 8 is a diagram illustrating an example of a tone curve for level correction processing. Specifically, the CPU 210 applies the tone curve of FIG. 8 to each pixel of the edge extraction data. As a result, all values above the threshold Vb (for example, 245) are converted to the maximum value (255), and all values below the threshold Va (for example, 10) are converted to the minimum value (0). A range larger than the threshold value Va and less than the threshold value Vb is expanded to a range of 0 to 255. As described above, since the range including the binarization threshold (the range greater than the threshold Va in FIG. 8 and less than the threshold Vb) is expanded before the binarization processing in S150 described later, the binarization accuracy is increased. Can be improved.

S150では、CPU210は、補正処理済みのエッジ抽出データに対して、二値化処理を実行して、二値画像データを生成する。例えば、CPU210は、エッジ画像データにおいて、画素の値(すなわち、エッジ強度)が閾値(例えば、128)以上である画素を、エッジ画素に分類し、画素の値が閾値未満である画素を、非エッジ画素に分類する。二値画像データでは、上述したように、エッジ画素の値は、「1」とされ、非エッジ画素の値は、「0」とされる。   In S150, the CPU 210 performs binarization processing on the corrected edge extraction data to generate binary image data. For example, in the edge image data, the CPU 210 classifies pixels having a pixel value (that is, edge strength) equal to or higher than a threshold value (for example, 128) as edge pixels, and sets pixels whose pixel value is less than the threshold value to non-pixel values. Classify into edge pixels. In the binary image data, as described above, the value of the edge pixel is “1”, and the value of the non-edge pixel is “0”.

以上説明した第1の二値画像データ生成処理によれば、図7を参照して説明したように、複数個の成分画像データのそれぞれに対して平滑化処理を実行することで、スキャン画像SI内に現れる網点の特徴を低減できる。さらに、図7を参照して説明したように、複数個の平滑化済みの成分画像データのそれぞれに対して、エッジ強調処理を実行することで、平滑化処理によって平滑化されたスキャン画像SI内のエッジを適切に強調できる。この結果、網点に起因するエッジ画素が特定されることを抑制しつつ、スキャン画像SI内のエッジ画素の適切に特定できる。   According to the first binary image data generation process described above, as described with reference to FIG. 7, the scan image SI is obtained by performing the smoothing process on each of the plurality of component image data. It is possible to reduce the characteristics of halftone dots appearing in the image. Further, as described with reference to FIG. 7, the edge enhancement process is performed on each of the plurality of smoothed component image data, thereby the scan image SI smoothed by the smoothing process. Can be properly emphasized. As a result, it is possible to appropriately specify the edge pixels in the scan image SI while suppressing the specification of the edge pixels due to the halftone dots.

さらに、単成分画像データとして、輝度画像データが用いられるので、スキャン画像SI内の複数個のエッジ画素をより適切に特定できる。例えば、網点は、印刷に用いられるC、M、Yの原色を有することが多いが、このような複数種の原色間の差は、R、G、Bの各成分画像データにおいて比較的大きくなるが、輝度画像データでは、比較的小さくなる。このために、輝度画像データを用いることで、網点に起因するエッジ画素が特定されることを適切に抑制できる。また、文字の読みやすさのために、文字の色と背景の色とは、輝度に比較的大きな差があることが多い。このために、輝度画像データを用いることで、文字をはじめとするオブジェクトのエッジを示すエッジ画素を適切に特定できる。   Furthermore, since luminance image data is used as the single component image data, a plurality of edge pixels in the scan image SI can be more appropriately identified. For example, a halftone dot often has C, M, and Y primary colors used for printing, but such a difference between a plurality of primary colors is relatively large in each of R, G, and B component image data. However, the luminance image data is relatively small. For this reason, it can suppress appropriately that the edge pixel resulting from a halftone dot is specified by using luminance image data. In addition, for the sake of readability of characters, there is often a relatively large difference in luminance between the character color and the background color. For this reason, by using the luminance image data, it is possible to appropriately specify the edge pixel indicating the edge of an object such as a character.

さらに、図6のエッジ強調処理では、注目画素に対応するマスク値(平滑値とも呼ぶ)の算出(S210)と、注目画素の値TVと注目画素に対応するマスク値との差分ΔVの算出(S220)と、注目画素の値TVと対応する差分ΔVとの和(TV+ΔV)の算出(S240)と、を含むいわゆるアンシャープマスク処理が実行される。この結果、スキャン画像SIのエッジを適切に強調できるので、特定すべきエッジ画素の特定漏れを抑制できる。この結果、スキャン画像SI内のエッジ画素をより適切に特定できる。   Further, in the edge enhancement processing of FIG. 6, calculation of a mask value (also referred to as a smooth value) corresponding to the target pixel (S210), and calculation of a difference ΔV between the value TV of the target pixel and the mask value corresponding to the target pixel ( A so-called unsharp mask process including S220) and calculation of the sum (TV + ΔV) of the value TV of the target pixel and the corresponding difference ΔV (S240) is executed. As a result, since the edge of the scan image SI can be appropriately emphasized, the specific omission of the edge pixel to be specified can be suppressed. As a result, the edge pixels in the scan image SI can be specified more appropriately.

さらに、図6のエッジ強調処理では、スキャン画像SI内の複数個の画素のうち、対応する差分ΔVが基準以上である画素については、アンシャープマスク処理の対象とされ、該差分ΔVが基準未満である画素については、アンシャープマスク処理の対象とされない(S230、240)。この結果、図7を参照して説明したように、スキャン画像SIの網点に起因する画素間の値の差が強調されることをさらに抑制できるので、網点に起因するエッジ画素の特定をさらに抑制できる。そして、文字などのオブジェクトのエッジについては適切に強調できる。したがって、スキャン画像SI内のエッジ画素をさらに適切に特定できる。   Furthermore, in the edge enhancement processing of FIG. 6, among the plurality of pixels in the scan image SI, pixels having a corresponding difference ΔV that is greater than or equal to the reference are subjected to unsharp mask processing, and the difference ΔV is less than the reference. Are not subjected to unsharp mask processing (S230, 240). As a result, as described with reference to FIG. 7, it is possible to further suppress the enhancement of the value difference between the pixels due to the halftone dots of the scan image SI. Further suppression is possible. The edges of objects such as characters can be emphasized appropriately. Therefore, the edge pixel in the scan image SI can be specified more appropriately.

A−5:第2の二値画像データ生成処理
図2のS24の第2の二値画像データ生成処理について説明する。図9は、第2の二値画像データ生成処理のフローチャートである。S300では、CPU210は、スキャンデータを用いて、最小成分データを生成する。具体的には、CPU210は、スキャンデータに含まれる複数個の画素の値(RGB値)のそれぞれから、最小成分値Vminを取得する。最小成分値Vminは、RGB値に含まれる複数個の成分値(R値、G値、B値)のうちの最小値である。CPU210は、これらの最小成分値Vminを複数個の画素の値とする画像データを、最小成分データとして生成する。最小成分データは、スキャン画像SIと同じサイズの画像を示す画像データである。最小成分データに含まれる複数個の画素の値のそれぞれは、スキャンデータの対応する画素の値(RGB値)の最小成分値Vminである。
A-5: Second Binary Image Data Generation Processing The second binary image data generation processing in S24 of FIG. 2 will be described. FIG. 9 is a flowchart of the second binary image data generation process. In S300, the CPU 210 generates minimum component data using the scan data. Specifically, the CPU 210 acquires the minimum component value Vmin from each of a plurality of pixel values (RGB values) included in the scan data. The minimum component value Vmin is a minimum value among a plurality of component values (R value, G value, B value) included in the RGB value. The CPU 210 generates image data having these minimum component values Vmin as values of a plurality of pixels as minimum component data. The minimum component data is image data indicating an image having the same size as the scanned image SI. Each of the values of the plurality of pixels included in the minimum component data is a minimum component value Vmin of the corresponding pixel value (RGB value) of the scan data.

図10は、スキャンデータの最小成分値と最大成分値の説明図である。図10(A)〜図10(E)には、RGB値の一例として、シアン(C)、マゼンタ(M)、イエロ(Y)、黒(K)、白(W)のRGB値が、棒グラフで図示されている。図10に示すように、C、M、Y、K、WのRGB値(R、G、B)は、それぞれ、(0、255、255)、(255、0、255)(255、255、0)、(0、0、0)、(255、255、255)である。   FIG. 10 is an explanatory diagram of the minimum component value and the maximum component value of the scan data. 10A to 10E, as an example of RGB values, RGB values of cyan (C), magenta (M), yellow (Y), black (K), and white (W) are shown as bar graphs. It is shown in the figure. As shown in FIG. 10, RGB values (R, G, B) of C, M, Y, K, and W are respectively (0, 255, 255), (255, 0, 255) (255, 255, 0), (0, 0, 0), (255, 255, 255).

これらのRGB値の輝度Yは、上述したように、例えば、Y=0.299×R+0.587×G+0.114×Bの式を用いて算出できる。C、M、Y、K、Wの輝度(0〜255の値で表す)は、約186、113、226、0、255であり、それぞれに異なる値となる(図10)。これに対して、C、M、Y、K、Wの最小成分値Vminは、図10に示すように、0、0、0、0、255となり、白(W)を除いて同じ値となる。   As described above, the luminance Y of these RGB values can be calculated using, for example, the equation Y = 0.299 × R + 0.587 × G + 0.114 × B. The luminances of C, M, Y, K, and W (represented by values from 0 to 255) are about 186, 113, 226, 0, and 255, and are different values (FIG. 10). On the other hand, the minimum component values Vmin of C, M, Y, K, and W are 0, 0, 0, 0, and 255 as shown in FIG. 10, and are the same values except for white (W). .

図11は、画像処理に用いられる画像の一例を示す第2の図である。図11(A)は、スキャン画像SIのうち、上述した網点領域の拡大図である。例えば、図11(A)の例では、スキャン画像SI内の網点領域は、複数個のMドットMDと、複数個のYドットYDと、を含んでいる。ここでは、説明のために、MドットMDを示す画像は、マゼンタの原色を有する均一な画像であり、YドットYDを示す画像は、イエロの原色を有する均一な画像であるとする。   FIG. 11 is a second diagram illustrating an example of an image used for image processing. FIG. 11A is an enlarged view of the above-described halftone dot region in the scan image SI. For example, in the example of FIG. 11A, the halftone dot region in the scan image SI includes a plurality of M dots MD and a plurality of Y dots YD. Here, for the sake of explanation, it is assumed that an image showing M dots MD is a uniform image having a magenta primary color, and an image showing Y dots YD is a uniform image having a yellow primary color.

図11(B)には、最小成分データによって示される最小成分画像MNIの一例が示されている。この最小成分画像MNIは、図11(A)のスキャン画像SIに対応している。最小成分画像MNIでは、スキャン画像SIのYドットMDに対応する領域MDb内の画素の値と、YドットYDに対応する領域YDb内の画素の値と、は互いに同じとなる。図11(C)には、比較例として、各画素の輝度を示す輝度画像データによって示される輝度画像YIが示されている。この輝度画像YIは、図11(A)のスキャン画像SIに対応している。輝度画像YIでは、最小成分画像MNIとは異なり、スキャン画像SIのMドットMDに対応する領域MDd内の画素の値と、YドットYDに対応する領域YDd内の画素の値と、は互いに異なる。   FIG. 11B shows an example of the minimum component image MNI indicated by the minimum component data. This minimum component image MNI corresponds to the scan image SI of FIG. In the minimum component image MNI, the value of the pixel in the region MDb corresponding to the Y dot MD of the scan image SI and the value of the pixel in the region YDb corresponding to the Y dot YD are the same. FIG. 11C shows a luminance image YI indicated by luminance image data indicating the luminance of each pixel as a comparative example. This luminance image YI corresponds to the scanned image SI in FIG. In the luminance image YI, unlike the minimum component image MNI, the value of the pixel in the region MDd corresponding to the M dot MD of the scan image SI is different from the value of the pixel in the region YDd corresponding to the Y dot YD. .

以上の説明から解るように、最小成分画像MNIでは、スキャン画像SIにおいて、原稿内のC、M、Y、Kドットが形成された部分に対応する複数個の画素の値の間の差が、輝度画像YIよりも小さくなる。そして、最小成分画像MNIでは、スキャン画像SIにおいて、原稿内の地色(用紙の白色)を示す領域に対応する地色領域の画素の値が、ドットが形成された部分に対応する画素の値よりも大きくなる。   As can be understood from the above description, in the minimum component image MNI, the difference between the values of the plurality of pixels corresponding to the portion where the C, M, Y, and K dots in the document are formed in the scanned image SI is as follows. It becomes smaller than the luminance image YI. In the minimum component image MNI, in the scanned image SI, the pixel value of the ground color area corresponding to the area indicating the ground color (white of the paper) in the document is the pixel value corresponding to the portion where the dot is formed. Bigger than.

S310では、CPU210は、生成された最小成分データに対して、該最小成分データによって示される最小成分画像MNIを平滑化する平滑化処理を実行して、平滑化済みの最小成分データを生成する。具体的には、CPU210は、最小成分データの各画素の値に、所定の平滑化フィルタ、本実施例では、縦5画素×横5画素のガウスフィルタを適用することによって、平滑化済みの各画素の値を算出する。平滑化済みの最小成分データは、スキャンデータの対応する画素の値(RGB値)に基づいて上述した処理で生成された平滑化済みの値を画素ごとに含んでいる。   In S310, the CPU 210 executes a smoothing process for smoothing the minimum component image MNI indicated by the minimum component data on the generated minimum component data, and generates smoothed minimum component data. Specifically, the CPU 210 applies a predetermined smoothing filter to the value of each pixel of the minimum component data, in this embodiment, a Gaussian filter of 5 vertical pixels × 5 horizontal pixels, so that each smoothed data The pixel value is calculated. The smoothed minimum component data includes, for each pixel, the smoothed value generated by the above-described processing based on the corresponding pixel value (RGB value) of the scan data.

S320では、CPU210は、平滑化済みの最小成分データに対して、当該平滑化済みの最小成分データによって示される平滑化済みの最小成分画像MNI内のエッジを抽出するエッジ抽出処理を実行して、エッジ抽出データを生成する。具体的には、CPU210は、平滑化済みの最小成分データの各画素の値に、図5のS130の処理と同一のソーベルフィルタを適用して、エッジ強度を算出する。CPU210は、これらのエッジ強度を、複数個の画素の値とするエッジ抽出データを生成する。   In S320, the CPU 210 executes edge extraction processing for extracting the edge in the smoothed minimum component image MNI indicated by the smoothed minimum component data with respect to the smoothed minimum component data, Edge extraction data is generated. Specifically, the CPU 210 calculates the edge strength by applying the same Sobel filter as the processing of S130 of FIG. 5 to the value of each pixel of the smoothed minimum component data. The CPU 210 generates edge extraction data having these edge strengths as values of a plurality of pixels.

S330では、CPU210は、エッジ抽出データに対して、レベル補正処理を実行して、補正処理済みのエッジ抽出データを生成する。レベル補正処理は、図5のS140の処理と同一である。S340では、CPU210は、補正処理済みのエッジ抽出データに対して、図5のS150の処理と同様の二値化処理を実行して、二値画像データを生成する。二値画像データでは、上述したように、エッジ画素の値は、「1」とされ、非エッジ画素の値は、「0」とされる。   In S330, the CPU 210 performs level correction processing on the edge extraction data to generate corrected edge extraction data. The level correction process is the same as the process of S140 in FIG. In S340, the CPU 210 performs binarization processing similar to the processing in S150 of FIG. 5 on the edge extraction data that has been subjected to correction processing, and generates binary image data. In the binary image data, as described above, the value of the edge pixel is “1”, and the value of the non-edge pixel is “0”.

以上説明した第2の二値画像データ生成処理によれば、最小成分データに対してエッジ抽出処理が実行され、エッジ抽出データが生成される(S320)。そして、該エッジ抽出データを二値化する処理(S340)を含むエッジ画素特定処理が実行することによって、スキャン画像SIの複数個のエッジ画素が特定される(S330、S340、図2のS26)。最小成分データでは、図11を参照して説明したように、網点領域において、画素間の値の差を抑制できるので、その後に、エッジ画素を特定する際に、網点に起因するエッジ画素が特定されることを抑制できる。したがって、スキャン画像SI内のエッジ画素を適切に特定できる。   According to the second binary image data generation process described above, the edge extraction process is executed on the minimum component data to generate edge extraction data (S320). A plurality of edge pixels of the scan image SI are specified by executing an edge pixel specifying process including a process of binarizing the edge extraction data (S340) (S330, S340, S26 in FIG. 2). . In the minimum component data, as described with reference to FIG. 11, the difference in values between pixels can be suppressed in the halftone dot region. Therefore, when the edge pixel is subsequently specified, the edge pixel due to the halftone dot is determined. Can be specified. Therefore, it is possible to appropriately specify the edge pixel in the scan image SI.

より具体的に説明すると、網点領域を構成する要素は、C、M、Y、Kの各ドットと、用紙の地色(白)と、の5種類である。最小成分データでは、これらの要素のうち、4種類の要素を示す画素の間の値の差を抑制できる。この結果、最小成分データを用いる場合には、網点のエッジを示すエッジ画素が特定されることを抑制することができる。   More specifically, there are five types of elements that constitute the halftone dot region: C, M, Y, and K dots, and the ground color (white) of the paper. In the minimum component data, it is possible to suppress a difference in values between pixels indicating four types of elements among these elements. As a result, when the minimum component data is used, it is possible to prevent the edge pixel indicating the edge of the halftone dot from being specified.

一方で、文字の色と背景の色とは、一方が、濃い色を有し、他方が薄い色を有する場合が多い。このために、文字と背景のうち、一方は、用紙の地色(白)を示す部分を比較的多く含み、他方は、C、M、Y、Kのドットを示す部分を比較的多く含む場合が多い。図10に示すように、最小成分データでは、C、M、Y、Kのドットを示す部分の画素の値と、用紙の地色(白)を示す部分の画素の値と、の間で、大きな差がある。このために、最小成分データを用いて、エッジ画素を特定すると、文字のエッジを構成するエッジ画素は、適切に特定できる可能性が高い。特に、イエロ(Y)は、C、M、Kと比較して濃度が低い(輝度が高い)。このために、用紙の地色(白)の背景に、イエロの文字がある場合には、輝度画像データを二値化しても、該イエロの文字のエッジを構成するエッジ画素を、適切に特定できない場合がある。本実施例では、このような場合でも該イエロの文字のエッジを構成するエッジ画素を、適切に特定できる。このために、輝度画像データを用いたエッジ画素の特定に加えて、最小成分データを用いたエッジ画素の特定を実行することで、輝度画像データだけでは、特定できない文字などのエッジ画素を特定し得る。この結果、スキャン画像SI内のエッジ画素の特定精度を向上できる。   On the other hand, in many cases, one of the character color and the background color has a dark color and the other has a light color. For this reason, one of the characters and the background includes a relatively large portion indicating the background color (white) of the paper, and the other includes a relatively large portion indicating C, M, Y, and K dots. There are many. As shown in FIG. 10, in the minimum component data, between the value of the pixel indicating the C, M, Y, and K dots and the value of the pixel indicating the ground color (white) of the paper, There is a big difference. For this reason, if edge pixels are specified using the minimum component data, there is a high possibility that the edge pixels constituting the edge of the character can be specified appropriately. In particular, yellow (Y) has a lower density (higher brightness) than C, M, and K. For this reason, if there is a yellow character on the background of the paper background (white), even if the luminance image data is binarized, the edge pixels constituting the edge of the yellow character are appropriately specified. There are cases where it is impossible. In this embodiment, even in such a case, the edge pixels constituting the edge of the yellow character can be appropriately specified. For this reason, in addition to specifying edge pixels using luminance image data, edge pixels such as characters that cannot be specified by luminance image data alone are specified by specifying edge pixels using minimum component data. obtain. As a result, it is possible to improve the accuracy of specifying edge pixels in the scan image SI.

さらに、最小成分データに対して、エッジ抽出処理の前に平滑化処理が実行される(S310)。この結果、平滑化処理によって、最小成分画像MNI内の網点領域おいて、画素間の値の差を、さらに抑制できる。例えば、スキャン画像SI内の網点領域において、C、M、Y、Kのドットの重なりや、読取実行部290での読取時のぼけなどによって、ドットを示す部分は、必ずしもC、M、Y、Kの原色を有している訳ではない。このために、最小成分画像MNI内では、C、M、Y、Kの各ドットを示す複数個の画素の間の値が、小さくなってはいるものの、ゼロではない。平滑化処理によって、該画素の間の値の差をさらに小さくすることができる。この結果、網点に起因するエッジ画素が特定されることを、さらに抑制できる。また、第2の二値画像データ生成処理においても、第1の二値画像データ生成処理と同様に、レベル補正処理(S330)が実行されるので、スキャン画像SI内のエッジ画素の特定精度を向上できる。   Further, a smoothing process is executed on the minimum component data before the edge extraction process (S310). As a result, the smoothing process can further suppress the difference in value between the pixels in the halftone dot region in the minimum component image MNI. For example, in a halftone dot region in the scanned image SI, a portion indicating a dot is not necessarily C, M, Y, due to overlapping of C, M, Y, K dots or blurring at the time of reading by the reading execution unit 290. , K does not have the primary color. For this reason, in the minimum component image MNI, values between a plurality of pixels indicating C, M, Y, and K dots are small but not zero. By the smoothing process, the value difference between the pixels can be further reduced. As a result, it can further be suppressed that the edge pixel caused by the halftone dot is specified. Also, in the second binary image data generation process, as in the first binary image data generation process, the level correction process (S330) is executed, so that the edge pixel specifying accuracy in the scan image SI is improved. Can be improved.

以上説明したように、上記実施例では、2種類の単成分画像データ、すなわち、輝度画像データと、最小成分データと、を用いて、最終的にエッジ画素が特定される(図2のS22〜S26)。このように互いに異なる処理を用いて生成される2種類の単成分画像データを用いて、スキャン画像SI内の複数個のエッジ画素が特定されるので、スキャン画像SI内の複数個のエッジ画素の特定漏れを抑制できる。例えば、白の背景にイエロの文字がある場合には、白とイエロの輝度の差は比較的小さいので、輝度画像データを用いて、該文字のエッジを構成するエッジ画素を特定することは困難である。これに対して、図10(C)、(E)から解るように、最小成分データでは、白とイエロとの差が大きく現れるので、白の背景にイエロの文字がある場合には、最小成分データを用いて、該文字のエッジを構成するエッジ画素を特定することは容易である。また、例えば、マゼンタの背景にイエロの文字がある場合には、最小成分データには、マゼンタとイエロとの差が現れないので、最小成分データを用いて、該文字のエッジを構成するエッジ画素を特定することは困難である。これに対して、マゼンタの背景にイエロの文字がある場合には、マゼンタとイエロの輝度の差は、比較的大きいので、輝度画像データを用いて、該文字のエッジを構成するエッジ画素を特定することは容易である。   As described above, in the above embodiment, an edge pixel is finally specified using two types of single component image data, that is, luminance image data and minimum component data (S22 to S22 in FIG. 2). S26). Since a plurality of edge pixels in the scan image SI are specified using two types of single component image data generated by using different processes in this way, a plurality of edge pixels in the scan image SI are identified. Specific leakage can be suppressed. For example, when there is a yellow character on a white background, the difference in luminance between white and yellow is relatively small, so it is difficult to identify edge pixels that constitute the edge of the character using luminance image data. It is. On the other hand, as can be seen from FIGS. 10C and 10E, in the minimum component data, a large difference between white and yellow appears. Therefore, when there is a yellow character on the white background, the minimum component Using data, it is easy to specify edge pixels that constitute the edge of the character. Also, for example, when there is a yellow character in the background of magenta, the minimum component data does not show a difference between magenta and yellow, so the edge pixel that forms the edge of the character using the minimum component data It is difficult to specify. On the other hand, when there is a yellow character on the magenta background, the brightness difference between magenta and yellow is relatively large, so the edge pixels that make up the edge of the character are identified using the brightness image data. It's easy to do.

また、輝度画像データに加えて用いられる単成分画像データは、最小成分データであるので、上述の通り、スキャン画像SI内の網点に起因するエッジ画素が特定されることは、抑制できる。   Further, since the single component image data used in addition to the luminance image data is the minimum component data, as described above, it is possible to suppress the specification of the edge pixels due to the halftone dots in the scan image SI.

A−6:非文字領域判定処理
図2のS28の非文字領域判定処理について説明する。図12は、非文字領域判定処理のフローチャートである。図13は、非文字領域判定処理で用いられる画像の一例を示す図である。
A-6: Non-Character Area Determination Process The non-character area determination process in S28 of FIG. 2 will be described. FIG. 12 is a flowchart of the non-character area determination process. FIG. 13 is a diagram illustrating an example of an image used in the non-character area determination process.

CPU210は、スキャンデータに対して、S405〜S420の前処理を実行して、前処理済画像データを生成する。   The CPU 210 performs preprocessing of S405 to S420 on the scan data, and generates preprocessed image data.

S405では、CPU210は、スキャンデータを用いて、上述した図9のS300と同様に、最小成分データを生成する。図9のS300で生成した最小成分データを、揮発性記憶装置220または不揮発性記憶装置230に保存しておく場合には、該最小成分データを利用しても良い。   In S405, the CPU 210 generates minimum component data using the scan data, as in S300 of FIG. 9 described above. When the minimum component data generated in S300 of FIG. 9 is stored in the volatile storage device 220 or the nonvolatile storage device 230, the minimum component data may be used.

S410では、CPU210は、最小成分データを二値化して、二値画像データを生成する。例えば、CPU210は、最小成分データにおいて、画素の値が閾値(例えば、128)以上である画素を、特定対象画素に分類し、画素の値が閾値以上である画素を、非特定対象画素に分類する。二値画像データでは、例えば、特定対象画素の値は、「1」とされ、非特定対象画素の値は、「0」とされる。上述したように、最小成分データでは、図10、図11を参照して説明したように、スキャン画像SIにおいて、原稿内のC、M、Y、Kドットが形成された部分に対応する複数個の画素の値が、原稿内の地色(用紙の白色)を示す領域に対応する地色領域の画素の値よりも小さくなる。したがって、本ステップで生成される二値画像データでは、原稿内のドットが形成された部分に対応する複数個の画素が、地色領域の複数個の画素が非特定対象画素に分類される。このように、最小成分データを二値化することで、原稿に印刷されたオブジェクト(ドットで形成される画像)を構成するオブジェクト画素を精度良く特定することができる。   In S410, the CPU 210 binarizes the minimum component data to generate binary image data. For example, in the minimum component data, the CPU 210 classifies pixels whose pixel value is a threshold value (for example, 128) or more as a specific target pixel, and classifies pixels whose pixel value is a threshold value or more as a non-specific target pixel. To do. In the binary image data, for example, the value of the specific target pixel is “1”, and the value of the non-specific target pixel is “0”. As described above, in the minimum component data, as described with reference to FIGS. 10 and 11, a plurality of scan images SI corresponding to portions where C, M, Y, and K dots are formed in the document. Is smaller than the pixel value of the ground color area corresponding to the area indicating the ground color (paper white) in the document. Therefore, in the binary image data generated in this step, a plurality of pixels corresponding to a portion where dots are formed in the document are classified, and a plurality of pixels in the ground color area are classified as non-specific target pixels. In this way, by binarizing the minimum component data, it is possible to accurately specify object pixels that constitute an object (image formed by dots) printed on a document.

ここで、本ステップで生成される二値画像データは、後述するS415の膨張処理を実行する前の画像データであるので、膨張処理前画像データとも呼び、膨張処理前画像データによって示される画像を膨張処理前画像OIとも呼ぶ。図13(A)には、膨張処理前画像OIの一例が示されている。膨張処理前画像OIでは、スキャン画像SI内のオブジェクトOb1〜Ob6に対応する特定対象画素Op1〜Op6が特定されている。原稿の文字は、比較的濃い色であることが多いので、膨張処理前画像OIにおいて、文字に対応する領域には、概ね隙間無く特定対象画素Op3〜Op6が特定される。原稿の写真領域には、全体にドットが形成されるので、膨張処理前画像OIにおいて、写真に対応する領域には、全体に特定対象画素Op1、Op2が特定される。ただし、写真は、濃い色も薄い色も含み得るので、膨張処理前画像OIにおいて、写真に対応する領域には、非特定対象画素(図13(A)の膨張処理前画像OI内の白色部分)も全体に分散して配置されている。   Here, since the binary image data generated in this step is image data before execution of the expansion processing of S415 described later, it is also referred to as pre-expansion image data, and the image indicated by the pre-expansion image data. Also referred to as pre-expansion image OI. FIG. 13A shows an example of the pre-expansion image OI. In the pre-expansion image OI, the identification target pixels Op1 to Op6 corresponding to the objects Ob1 to Ob6 in the scan image SI are identified. Since the characters of the document are often relatively dark, the specific target pixels Op3 to Op6 are specified with almost no gap in the area corresponding to the characters in the pre-expansion image OI. Since dots are formed in the entire photograph area of the document, the specific target pixels Op1 and Op2 are identified in the entire area corresponding to the photograph in the pre-expansion image OI. However, since the photograph can include both dark and light colors, the region corresponding to the photograph in the pre-expansion image OI includes a white portion in the pre-expansion image OI of the non-specific target pixel (FIG. 13A). ) Are also distributed throughout.

S415、S420では、CPU210は、膨張処理前画像データに対して、膨張処理と収縮処理とを実行して、前処理済画像データを生成する。図14、図15は、膨張処理と収縮処理について説明する図である。   In S415 and S420, the CPU 210 performs expansion processing and contraction processing on the pre-expansion image data to generate pre-processed image data. 14 and 15 are diagrams illustrating the expansion process and the contraction process.

S415では、CPU210は、膨張処理前画像データに対して、1回の膨張処理を実行する。図14(A)には、膨張処理前画像OIのうち、スキャン画像SI内の文字Ob3〜Ob6に対応する細線を含む部分画像PI1が示されている。図15(A)には、膨張処理前画像OIのうち、スキャン画像SI内の写真Ob1、Ob2に対応する領域の一部である部分画像PI2が示されている。図14(A)においてハッチングされた部分は、文字に対応する特定対象画素Optを示し、図15(A)においてハッチングされた部分は、写真に対応する特定対象画素Oppを示す。   In S415, the CPU 210 performs one expansion process on the pre-expansion image data. FIG. 14A shows a partial image PI1 including thin lines corresponding to the characters Ob3 to Ob6 in the scan image SI in the pre-expansion image OI. FIG. 15A shows a partial image PI2 that is a part of an area corresponding to the photographs Ob1 and Ob2 in the scan image SI in the pre-expansion image OI. The hatched portion in FIG. 14A indicates the specific target pixel Opt corresponding to the character, and the hatched portion in FIG. 15A indicates the specific target pixel Op corresponding to the photograph.

膨張処理は、例えば、所定サイズのフィルタ、図14(A)の例では、縦3画素×横3画素のサイズのフィルタFI1を用いて、実行される。具体的には、CPU210は、フィルタFI1を、膨張処理前画像データに対して適用して、膨張処理済みの二値画像データを生成する。すなわち、CPU210は、注目画素に、フィルタFI1の中心位置CC1(図14(A)参照)が重なるように、フィルタFI1を、膨張処理前画像OI上に配置する。CPU210は、フィルタFI1の範囲内に、特定対象画素が1個でも存在する場合には、生成すべき二値画像において注目画素に対応する画素を特定対象画素に設定する。CPU210は、フィルタFI1の範囲内に、特定対象画素が1つもない場合、すなわち、フィルタFI1の範囲内の9個の画素が、非特定対象画素である場合には、生成すべき二値画像において注目画素に対応する画素を非特定対象画素に設定する。CPU210は、二値画像BIの全ての画素を注目画素として、生成すべき二値画像内の対応する画素を、特定対象画素および非特定対象画素のいずれかに設定することによって、膨張処理済みの二値画像データを生成する。   The expansion processing is executed using, for example, a filter having a predetermined size, and in the example of FIG. 14A, a filter FI1 having a size of 3 vertical pixels × 3 horizontal pixels. Specifically, the CPU 210 applies the filter FI1 to the pre-expansion image data to generate binary image data that has undergone expansion processing. That is, the CPU 210 arranges the filter FI1 on the pre-expansion image OI so that the center position CC1 (see FIG. 14A) of the filter FI1 overlaps the target pixel. If even one specific target pixel exists within the range of the filter FI1, the CPU 210 sets a pixel corresponding to the target pixel in the binary image to be generated as the specific target pixel. When there is no specific target pixel in the range of the filter FI1, that is, when nine pixels in the range of the filter FI1 are non-specific target pixels, the CPU 210 A pixel corresponding to the target pixel is set as a non-specific target pixel. The CPU 210 sets all the pixels of the binary image BI as the target pixel and sets the corresponding pixel in the binary image to be generated as one of the specific target pixel and the non-specific target pixel, so that the expansion processing has been completed. Binary image data is generated.

図14(B)には、図14(A)の部分画像PI1に対応する膨張処理済みの部分画像PI1bが示されている。図15(B)には、図15(A)の部分画像PI2に対応する膨張処理済みの部分画像PI2bが示されている。図14(B)に示すように、膨張処理済みの二値画像(例えば、部分画像PI1b)では、文字に対応する特定対象画素Optによって示される線は、膨張処理前と比較して、太くなる。図15(B)に示すように、膨張処理済みの二値画像(例えば、部分画像PI2b)では、膨張処理前において写真に対応する領域内に混じっている非特定対象画素VA(図15(A))が、特定対象画素Oppに変更されて、写真に対応する領域内の全体が、特定対象画素Oppで構成される。   FIG. 14B shows a partial image PI1b that has been subjected to expansion processing, corresponding to the partial image PI1 of FIG. FIG. 15B shows an expanded partial image PI2b corresponding to the partial image PI2 in FIG. As illustrated in FIG. 14B, in the binary image that has been subjected to the expansion process (for example, the partial image PI1b), the line indicated by the specific target pixel Opt corresponding to the character is thicker than before the expansion process. . As shown in FIG. 15B, in the binary image after the expansion process (for example, the partial image PI2b), the non-specific target pixel VA (FIG. 15A) mixed in the region corresponding to the photograph before the expansion process. )) Is changed to the specific target pixel Op, and the entire region corresponding to the photograph is configured by the specific target pixel Op.

S420では、CPU210は、膨張処理済みの二値画像データに対して、3回の収縮処理を実行する。   In S420, the CPU 210 executes three contraction processes on the binary image data that has been subjected to the expansion process.

収縮処理は、例えば、所定サイズのフィルタ、図14(B)の例では、縦3画素×横3画素のサイズのフィルタFI2を用いて、膨張処理済みの二値画像データに対して実行される。具体的には、CPU210は、フィルタFI2を、二値画像データに対して適用して、収縮処理済みの二値画像データを生成する。すなわち、CPU210は、注目画素に、フィルタFI2の中心位置CC2(図14(B)参照)が重なるように、フィルタFI2を膨張処理済みの二値画像(例えば、部分画像PI1b、PI2b)に配置する。CPU210は、フィルタFI2の範囲内に、非特定対象画素が1個でも存在する場合には、生成すべき二値画像において注目画素に対応する画素を非特定対象画素に設定する。そして、CPU210は、フィルタFI2の範囲内に、非特定対象画素が1つもない場合には、生成すべき二値画像において注目画素に対応する画素を特定対象画素に設定する。CPU210は、膨張処理済みの二値画像の全ての画素を注目画素として、生成すべき二値画像内の対応する画素を、特定対象画素および非特定対象画素のいずれかに設定することによって、収縮処理済みの二値画像データを生成する。   The contraction process is executed on the binary image data that has been subjected to the expansion process using, for example, a filter of a predetermined size, and in the example of FIG. 14B, a filter FI2 having a size of 3 pixels vertically × 3 pixels horizontally. . Specifically, the CPU 210 applies the filter FI2 to the binary image data to generate binary image data that has been subjected to shrinkage processing. That is, the CPU 210 arranges the filter FI2 in the binary image (for example, partial images PI1b and PI2b) that has been subjected to the expansion process so that the center position CC2 (see FIG. 14B) of the filter FI2 overlaps the target pixel. . When at least one non-specific target pixel exists within the range of the filter FI2, the CPU 210 sets a pixel corresponding to the target pixel in the binary image to be generated as the non-specific target pixel. Then, if there is no non-specific target pixel in the range of the filter FI2, the CPU 210 sets a pixel corresponding to the target pixel in the binary image to be generated as the specific target pixel. The CPU 210 sets all of the pixels of the dilated binary image as the target pixel, and sets the corresponding pixel in the binary image to be generated as one of the specific target pixel and the non-specific target pixel. Processed binary image data is generated.

図14(C)には、図14(B)の部分画像PI1bに対応する収縮処理済みの部分画像PI1cが示されている。図15(C)には、図15(B)の部分画像PI2bに対応する収縮処理済みの部分画像PI2cが示されている。図14(C)に示すように、膨張処理済みの二値画像(例えば、部分画像PI1c)では、文字に対応する特定対象画素Optに示される線は、収縮処理前と比較して、細くなる。収縮処理前において写真に対応する領域には、非特定対象画素VAが混じっていないので(図15(B))、図15(C)に示すように、収縮処理済みの二値画像(例えば、部分画像PI2c)では、写真に対応する領域内の全体が、特定対象画素Oppのまま維持される。   FIG. 14C shows a contracted partial image PI1c corresponding to the partial image PI1b of FIG. 14B. FIG. 15C shows a contracted partial image PI2c corresponding to the partial image PI2b of FIG. As shown in FIG. 14C, in the binary image that has been subjected to the expansion process (for example, the partial image PI1c), the line indicated by the specific target pixel Opt corresponding to the character is thinner than before the contraction process. . Since the non-specific target pixel VA is not mixed in the region corresponding to the photograph before the contraction process (FIG. 15B), as illustrated in FIG. 15C, a binary image that has been subjected to the contraction process (for example, In the partial image PI2c), the entire area corresponding to the photograph is maintained as the specific target pixel Op.

CPU210は、1回目の収縮処理済みの二値画像データに対して、同様の収縮処理を実行して、2回目の収縮処理済みの二値画像データを生成し、2回目の収縮処理済みの二値画像データに対して、同様の収縮処理を実行して、3回目の収縮処理済みの二値画像データを生成する。3回目の収縮処理済みの二値画像データを、前処理済画像データともよび、前処理済画像データによって示される画像を、前処理済画像OIbとも呼ぶ。   The CPU 210 performs similar contraction processing on the binary image data that has been subjected to the first contraction processing, generates binary image data that has been subjected to the second contraction processing, and the binary image data that has been subjected to the second contraction processing. A similar contraction process is performed on the value image data to generate binary image data subjected to the third contraction process. The binary image data that has undergone the third contraction process is also referred to as preprocessed image data, and the image indicated by the preprocessed image data is also referred to as preprocessed image OIb.

図13(B)には、前処理済画像OIbの一例が示されている。前処理済画像OIbは、スキャン画像SI内のオブジェクトOb1〜Ob6に対応する特定対象画素Op1b〜Op6bが特定されている。   FIG. 13B shows an example of the preprocessed image OIb. In the preprocessed image OIb, specific target pixels Op1b to Op6b corresponding to the objects Ob1 to Ob6 in the scan image SI are specified.

前処理済画像OIbでは、文字に対応する特定対象画素Op3b〜Op6bで示される線は、膨張処理前画像OIと比較して、細くなっている。これは、収縮処理の回数(本実施例では、3回)が、膨張処理の回数(本実施例では、1回)より多いために、収縮処理の収縮の程度が、膨張処理の膨張の程度よりも大きいからである。なお、膨張処理前画像OIにて文字に対応する特定対象画素Op3〜Op6で示される線が比較的細い場合には、収縮処理によって、文字に対応する特定対象画素Op3〜Op6の全部または一部が、消滅する場合もある。非文字領域判定処理では、非文字領域が特定できれば良いので、文字に対応する特定対象画素Op3〜Op6は、消滅しても構わない。   In the preprocessed image OIb, the lines indicated by the specific target pixels Op3b to Op6b corresponding to the characters are thinner than the pre-expansion image OI. This is because the number of times of contraction processing (in this embodiment, three times) is larger than the number of times of expansion processing (in this example, one time), the degree of contraction of the contraction processing is the degree of expansion of the expansion processing. It is because it is larger than. In addition, when the lines indicated by the specific target pixels Op3 to Op6 corresponding to the characters in the pre-expansion image OI are relatively thin, all or part of the specific target pixels Op3 to Op6 corresponding to the characters by the contraction processing. However, it may disappear. In the non-character area determination process, it is sufficient that the non-character area can be specified. Therefore, the specification target pixels Op3 to Op6 corresponding to the characters may disappear.

前処理済画像OIbでは、写真に対応する領域内の全体が、特定対象画素Op1b、Op2bで構成される。これは、膨張処理によって、一旦、写真に対応する領域内の全体が、特定対象画素になった後では、収縮処理の収縮の程度が、膨張処理の膨張の程度よりも大きくても、写真に対応する領域内の全体が、特定対象画素のまま維持されるためである。収縮処理の収縮の程度が、膨張処理の膨張の程度よりも大きいために、前処理済画像OIbでは、写真に対応する複数個の特定対象画素Op1b、Op2bが位置する領域の全体が、膨張処理前画像OIにて写真に対応する複数個の特定対象画素Op1、Op2が位置する領域の全体よりも僅かに小さくなるが、その差は問題にならない程度である。   In the preprocessed image OIb, the entire area corresponding to the photograph is configured by the specific target pixels Op1b and Op2b. This is because once the entire area corresponding to the photograph becomes the target pixel by the expansion process, even if the degree of contraction of the contraction process is greater than the degree of expansion of the expansion process, This is because the entire corresponding region is maintained as the specific target pixel. Since the degree of contraction of the contraction process is larger than the degree of expansion of the expansion process, in the preprocessed image OIb, the entire region where the plurality of specific target pixels Op1b and Op2b corresponding to the photograph are located is the expansion process. Although it is slightly smaller than the entire area where the plurality of specific target pixels Op1 and Op2 corresponding to the photograph in the previous image OI are located, the difference is not a problem.

S425では、CPU210は、前処理済画像データに対して、ラベリング処理を行うことによって、複数個の対象領域を決定する。具体的には、CPU210は、連続する1以上の特定対象画素で構成される1つの領域を一つの対象領域として、一つの識別子を割り当てる。そして、CPU210は、互いに離れた複数の対象領域に、互いに異なる識別子を割り当てる。このようなラベリング処理によって、複数個の対象領域が特定される。図13(B)の例では、スキャン画像SI内の4個の文字Ob3b〜Ob6に対応する4個の対象領域TA3〜TA6と、スキャン画像SI内の2個の写真Ob1、Ob2に対応する2個の対象領域TA1、TA2と、が決定される。スキャン画像SIの複数個の画素と、膨張処理前画像OIの複数個の画素とは、一対一で対応しているので、膨張処理前画像OI上に対象領域を決定することは、スキャン画像SI上に対象領域を決定することと同義である。   In S425, the CPU 210 determines a plurality of target areas by performing a labeling process on the preprocessed image data. Specifically, the CPU 210 assigns one identifier, with one area composed of one or more consecutive specific target pixels as one target area. Then, the CPU 210 assigns different identifiers to a plurality of target areas separated from each other. A plurality of target areas are specified by such a labeling process. In the example of FIG. 13B, four target areas TA3 to TA6 corresponding to the four characters Ob3b to Ob6 in the scan image SI and 2 corresponding to the two photographs Ob1 and Ob2 in the scan image SI. The target areas TA1 and TA2 are determined. Since the plurality of pixels of the scan image SI and the plurality of pixels of the pre-expansion image OI correspond one-to-one, determining the target area on the pre-expansion image OI means that the scan image SI This is synonymous with determining the target area above.

S430では、CPU210は、非文字領域データを生成するためのキャンバスデータをメモリ(具体的には、揮発性記憶装置220のバッファ領域)に準備する。キャンバスデータによって示されるキャンバス(初期画像)は、スキャン画像SIと同じサイズの二値画像、すなわち、同じ画素数の二値画像である。キャンバスデータの各画素の値は、非文字領域とは異なる領域の画素であることを示す所定の初期値(例えば、0)である。   In S430, the CPU 210 prepares canvas data for generating non-character area data in a memory (specifically, a buffer area of the volatile storage device 220). The canvas (initial image) indicated by the canvas data is a binary image having the same size as the scanned image SI, that is, a binary image having the same number of pixels. The value of each pixel of the canvas data is a predetermined initial value (for example, 0) indicating that the pixel is in a region different from the non-character region.

S435では、CPU210は、前処理済画像OIbに決定済みの複数個の対象領域の中から、1個の注目対象領域を選択する。   In S435, the CPU 210 selects one target region of interest from among a plurality of target regions that have been determined for the preprocessed image OIb.

S440では、CPU210は、注目対象領域を構成する特定対象画素の画素数PNを算出する。S445では、CPU210は、画素数PNが閾値TH1以上であるか否かを判断する。閾値TH1は、原稿のサイズやスキャン画像SIの解像度に応じた値であり、文字や写真を含む原稿に基づくスキャンデータを用いて、経験的に予め定められる。画素数PNが閾値TH1以上である場合には(S445:YES)、CPU210は、S450に処理を進める。   In S440, the CPU 210 calculates the number of pixels PN of the specific target pixels constituting the target region of interest. In S445, the CPU 210 determines whether or not the pixel number PN is equal to or greater than the threshold value TH1. The threshold value TH1 is a value corresponding to the size of the document and the resolution of the scan image SI, and is empirically determined in advance using scan data based on the document including characters and photographs. When the pixel number PN is equal to or greater than the threshold value TH1 (S445: YES), the CPU 210 advances the process to S450.

S450では、CPU210は、注目対象領域に外接する外接矩形OSに対する注目対象領域の占有率PRを算出する。例えば、図13(B)の対象領域TA5が、注目対象領域である場合には、破線で示す外接矩形OS5の画素数SNに対する、対象領域TA5の画素数PNが、占有率PRとして算出される(PR=SN/PN)。S455では、CPU210は、占有率PRが閾値TH2以上であるか否かを判断する。閾値TH2は、文字や写真を含む原稿に基づくスキャンデータを用いて、経験的に予め定められる。閾値TH2は、例えば、80%〜90%である。占有率PRが閾値TH2以上である場合には(S455:YES)、CPU210は、S460に処理を進める。   In S450, the CPU 210 calculates the occupation rate PR of the target area for the circumscribed rectangle OS circumscribing the target area. For example, when the target area TA5 in FIG. 13B is the target area of interest, the pixel number PN of the target area TA5 with respect to the pixel number SN of the circumscribed rectangle OS5 indicated by the broken line is calculated as the occupation rate PR. (PR = SN / PN). In S455, the CPU 210 determines whether or not the occupation rate PR is equal to or greater than the threshold value TH2. The threshold value TH2 is empirically determined in advance using scan data based on a document including characters and photographs. The threshold value TH2 is, for example, 80% to 90%. If the occupation rate PR is equal to or greater than the threshold value TH2 (S455: YES), the CPU 210 advances the process to S460.

S460では、CPU210は、注目対象領域を非文字領域に設定する。具体的には、CPU210は、キャンバスデータにおいて、注目対象領域に対応する領域内の全ての画素の値を、非文字を示す値「1」に設定する。   In S460, the CPU 210 sets the target area as a non-character area. Specifically, the CPU 210 sets the value of all the pixels in the region corresponding to the target region of interest in canvas data to a value “1” indicating a non-character.

画素数PNが閾値TH1未満である場合には(S445:NO)、および、占有率PRが閾値TH2未満である場合には(S455:NO)、CPU210は、S460をスキップして、S470に処理を進める。すなわち、この場合には、注目対象領域は、非文字領域とは異なる領域に設定される。したがって、キャンバスデータにおいて、注目対象領域に対応する領域内の全ての画素の値は、初期値「0」に維持される。   When the pixel number PN is less than the threshold value TH1 (S445: NO), and when the occupation rate PR is less than the threshold value TH2 (S455: NO), the CPU 210 skips S460 and performs the process in S470. To proceed. That is, in this case, the attention target area is set to an area different from the non-character area. Accordingly, in the canvas data, the values of all the pixels in the region corresponding to the target region of interest are maintained at the initial value “0”.

S470では、CPU210は、前処理済画像OIb内の全ての対象領域を注目対象領域として処理したか否かを判断する。未処理の対象領域がある場合には(S470:NO)、CPU210は、S435に戻って、未処理の対象領域を注目対象領域として選択する。全ての対象領域が処理された場合には(S470:YES)、CPU210は、非文字領域判定処理を終了する。この時点で、図4(B)に示す非文字領域データが生成されている。   In S470, the CPU 210 determines whether or not all target areas in the preprocessed image OIb have been processed as the target area of interest. If there is an unprocessed target area (S470: NO), the CPU 210 returns to S435 and selects the unprocessed target area as the target area of interest. When all the target areas have been processed (S470: YES), the CPU 210 ends the non-character area determination process. At this point, the non-character area data shown in FIG. 4B is generated.

以上説明した本実施例によれば、文字特定処理(図2のS20)のS22〜S26にて、CPU210は、スキャンデータを用いて、スキャン画像SI内の複数個の画素のそれぞれが、文字画素の候補であるか否かを画素ごとに判断することによって、複数個の文字候補画素を決定する(図2のS22〜S26)。非文字領域判定処理(図2のS28、図12)では、CPU210は、スキャンデータに対して、膨張処理(図12のS415)を含む前処理(図12のS405〜S420)を実行して、前処理済画像データを生成する。CPU210は、前処理済画像データに対応する画像(前処理済画像OIb)上に配置される複数個の対象領域のそれぞれが特定の判断条件を満たすか否かを判断することによって、スキャン画像SI内の非文字領域を特定する(図12のS435〜S470)。スキャン画像SI内の複数個の画素のうち、図2のS26にて文字候補画素であると決定され、かつ、図2のS28にて特定される非文字領域とは異なる領域にある画素が、文字画素として特定される(図2のS29)。前処理済画像データでは、写真の網点を構成する特定対象画素が、膨張処理によって一塊の画素群として現れやすい(図13(B))。この結果、スキャン画像SI内において、写真などの網点を構成する画素を含む領域が、非文字領域として精度良く特定できる。そして、非文字領域とは異なる領域にある画素が、文字画素として特定される。したがって、例えば、図2のS26にて網点を構成する画素が文字候補画素であると誤って決定されたとしても、図2のS28の前処理済画像データを用いた判断によって、網点を構成する画素を含む領域が非文字領域であると決定されることで、網点を構成する画素が文字画素であると誤って特定されることを抑制できる。したがって、網点を含む画像であっても、スキャン画像SI内の文字画素を精度良く特定できる。   According to the present embodiment described above, in S22 to S26 of the character specifying process (S20 in FIG. 2), the CPU 210 uses the scan data so that each of the plurality of pixels in the scanned image SI is a character pixel. A plurality of character candidate pixels are determined by determining for each pixel whether or not it is a candidate for (S22 to S26 in FIG. 2). In the non-character area determination process (S28 in FIG. 2, FIG. 12), the CPU 210 performs pre-processing (S405 to S420 in FIG. 12) including scan processing (S415 in FIG. 12) on the scan data, Pre-processed image data is generated. The CPU 210 determines whether each of the plurality of target areas arranged on the image corresponding to the preprocessed image data (preprocessed image OIb) satisfies a specific determination condition, thereby determining the scan image SI. The non-character area is specified (S435 to S470 in FIG. 12). Among the plurality of pixels in the scan image SI, pixels that are determined to be character candidate pixels in S26 of FIG. 2 and that are in a region different from the non-character region specified in S28 of FIG. It is specified as a character pixel (S29 in FIG. 2). In the preprocessed image data, the specific target pixels constituting the halftone dots of the photograph are likely to appear as a group of pixels by the expansion process (FIG. 13B). As a result, in the scanned image SI, an area including pixels constituting a halftone dot such as a photograph can be accurately identified as a non-character area. Then, a pixel in an area different from the non-character area is specified as a character pixel. Therefore, for example, even if it is erroneously determined that the pixel constituting the halftone dot is a character candidate pixel in S26 of FIG. 2, the halftone dot is determined by the determination using the preprocessed image data in S28 of FIG. By determining that the area including the constituent pixels is a non-character area, it is possible to suppress erroneously specifying that the pixels constituting the halftone dots are character pixels. Therefore, even in an image including halftone dots, character pixels in the scan image SI can be specified with high accuracy.

さらに、本実施例の非文字領域判定処理では、前処理において、膨張処理(S415)の後に収縮処理(S420)を実行して、前処理済画像データが生成される。この結果、前処理済画像OIbにおいて、文字に対応する特定対象画素が一塊の画素群になることを抑制できる。例えば、文字を構成する細線が、膨張処理によって、隣接する他の線と部分的に繋がってしまったとしても、収縮処理によって再度分離することができる。この結果、スキャン画像SI内の文字に対応する領域が、非文字領域として誤って特定されることを抑制できる。   Further, in the non-character area determination process of the present embodiment, in the preprocess, the contraction process (S420) is executed after the expansion process (S415) to generate preprocessed image data. As a result, in the preprocessed image OIb, it is possible to suppress the specific target pixels corresponding to the characters from being a group of pixels. For example, even if a thin line constituting a character is partially connected to another adjacent line by the expansion process, it can be separated again by the contraction process. As a result, it is possible to prevent an area corresponding to the character in the scan image SI from being erroneously specified as a non-character area.

さらに、本実施例では、非文字領域を決定するための特定の判断条件は、外接矩形OSに占める特定対象画素の割合(占有率PR)が、基準割合(閾値TH2)以上であることを含む(図12のS455)。写真は、矩形の形状を有している可能性が高いのに対して、文字は、細線で構成される。このために、図13(B)に示すように、写真に対応する対象領域(例えば、対象領域TA1)は、文字に対応する対象領域(例えば、対象領域TA3)よりも占有率PRが高いと考えられる。占有率PRを用いることによって、非文字領域を適切に特定することができる。   Furthermore, in this embodiment, the specific determination condition for determining the non-character region includes that the ratio of the specific target pixel (occupancy ratio PR) in the circumscribed rectangle OS is equal to or higher than the reference ratio (threshold value TH2). (S455 in FIG. 12). A photograph is likely to have a rectangular shape, whereas characters are composed of thin lines. For this reason, as shown in FIG. 13B, the target area corresponding to the photograph (for example, the target area TA1) has a higher occupation rate PR than the target area corresponding to the characters (for example, the target area TA3). Conceivable. By using the occupation rate PR, the non-character region can be appropriately specified.

さらに、本実施例では、非文字領域を決定するための特定の判断条件は、対象領域内の特定対象画素の個数(画素数PN)が、基準数(閾値TH1)以上であることを含む(図12のS445)。本実施例で非文字として想定している写真は、図13(B)に示すように一塊の特定対象画素で構成され、スキャン画像SI上である程度の面積を占めている可能性が高い。文字は、細線で構成されるので、文字の面積は比較的小さい可能性が高い。このために、図13(B)に示すように、写真に対応する対象領域(例えば、対象領域TA1)は、文字に対応する対象領域(例えば、対象領域TA3)よりも画素数PNが多いと考えられる。画素数PNを用いることによって、非文字領域を適切に特定することができる。   Further, in the present embodiment, the specific determination condition for determining the non-character region includes that the number of specific target pixels (pixel number PN) in the target region is equal to or greater than the reference number (threshold value TH1) ( S445 in FIG. 12). A photograph assumed as a non-character in this embodiment is composed of a group of specific target pixels as shown in FIG. 13B and is likely to occupy a certain area on the scan image SI. Since the characters are composed of thin lines, the area of the characters is likely to be relatively small. For this reason, as shown in FIG. 13B, if the target area corresponding to the photograph (for example, the target area TA1) has a larger number of pixels PN than the target area corresponding to the characters (for example, the target area TA3). Conceivable. By using the number of pixels PN, the non-character region can be appropriately specified.

さらに、本実施例では、S420の収縮処理の収縮の程度は、S415の膨張処理の膨張の程度よりも大きい。この結果、収縮処理によって、膨張処理によって繋がってしまった細線をより確実に分離できる。したがって、文字に対応する特定対象画素が一塊の画素群になることをさらに効果的に抑制できる。   Furthermore, in this embodiment, the degree of contraction in the contraction process in S420 is greater than the degree of expansion in the expansion process in S415. As a result, the thin line connected by the expansion process can be more reliably separated by the contraction process. Therefore, it can suppress more effectively that the specific object pixel corresponding to a character becomes a lump pixel group.

さらに、本実施例では、S415の膨張処理は、1回行われ、S420の膨張処理は、3回行われる。すなわち、本実施例では、膨張処理は、1回の単位膨張処理を含み、収縮処理は、3回の単位収縮処理を含む。この結果、容易に、S420の収縮処理の収縮の程度は、S415の膨張処理の膨張の程度よりも大きくすることができる。   Further, in this embodiment, the expansion process of S415 is performed once, and the expansion process of S420 is performed three times. That is, in this embodiment, the expansion process includes one unit expansion process, and the contraction process includes three unit contraction processes. As a result, the degree of contraction in the contraction process in S420 can be easily made larger than the degree of expansion in the expansion process in S415.

さらに、本実施例の非文字領域判定処理では、CPU210は、前処理済画像データを用いて、前処理済画像OIb内の連続する複数個の特定対象画素によって構成される領域を、対象領域として決定する(図12のS425)。この結果、非文字領域であるか否かを決定するための適切な対象領域を決定することができる。   Further, in the non-character area determination process according to the present embodiment, the CPU 210 uses, as pre-processed image data, an area configured by a plurality of continuous specific target pixels in the pre-processed image OIb as a target area. Determine (S425 in FIG. 12). As a result, it is possible to determine an appropriate target area for determining whether or not it is a non-character area.

さらに、本実施例の非文字領域判定処理では、図12のS430にて準備されるキャンバスデータにおいて、各画素の初期値が、非文字領域とは異なる領域の画素であることを示す値(例えば、0)とされている。そして、対象領域のうち、非文字領域であると判断される領域だけが非文字領域に決定される(S460)。したがって、前処理済画像OIbにおいて、特定対象画素とは異なる画素(非特定対象画素)によって構成される領域(例えば、白地の背景領域)は、非文字領域とは異なる領域として特定される(図4(B))。この結果、例えば、文字に対応する特定対象画素が、S420の収縮処理によって消滅したとしても問題がない。したがって、文字画素を漏れなく特定することができる。   Furthermore, in the non-character area determination process of the present embodiment, in the canvas data prepared in S430 of FIG. 12, the initial value of each pixel is a value indicating that the pixel is in a different area from the non-character area (for example, , 0). And only the area | region judged to be a non-character area among object areas is determined as a non-character area (S460). Therefore, in the preprocessed image OIb, an area (for example, a white background area) configured by a pixel (non-specific target pixel) different from the specific target pixel is specified as a different area from the non-character area (see FIG. 4 (B)). As a result, for example, there is no problem even if the specific target pixel corresponding to the character disappears by the contraction process of S420. Therefore, character pixels can be specified without omission.

本実施例では、CPU210は、スキャンデータを用いて最小成分データを生成し(図12のS405)、最小成分データを用いて、膨張処理前画像データを生成し(図12のS410)、膨張処理前画像データに対して、膨張処理を含む処理(S415、S420)を実行して、前処理済画像データを生成する。この結果、最小成分データを用いることで、網点を構成する画素が特定対象画素として精度良く特定される。したがって、非文字領域が精度良く特定される。   In this embodiment, the CPU 210 generates minimum component data using the scan data (S405 in FIG. 12), generates pre-expansion image data using the minimum component data (S410 in FIG. 12), and performs expansion processing. Processing (S415, S420) including expansion processing is executed on the pre-image data to generate pre-processed image data. As a result, by using the minimum component data, the pixels constituting the halftone dots are accurately identified as the identification target pixels. Therefore, the non-character area is specified with high accuracy.

さらに、上記実施例によれば、CPU210は、S15での拡大処理の拡大率Lrが閾値Lth未満である場合には(S27:YES)、S28の非文字領域判定処理とS29の合成処理とを実行する。すなわち、この場合には、スキャン画像SI内の複数個の画素のうち、S22〜S26にて文字候補画素であると決定され、かつ、S28にて非文字画素であると決定されない画素が、文字画素として特定される。そして、拡大率Lrが閾値Lth以上である場合には(S27:NO)、S28とS29の処理は実行されない。すなわち、この場合には、スキャン画像SI内の複数個の画素のうち、文字候補画素であると決定される画素が、文字画素として特定される。この結果、スキャンデータの生成時の拡大率Lrに応じて、適切な文字画素が特定される。詳しく説明すると、スキャン画像SIを閾値Lth以上の拡大率で拡大して出力(本実施例では印刷)する場合には、出力される画像において、網点自体が比較的大きいので、網点が目立っていても不自然な見栄えにはならないことが多い。このために、拡大率Lrが閾値Lth以上である場合には、出力される画像において、当該大きな網点がはっきりと見える方が、ぼけているよりも自然な見栄えになることが多い。また、拡大コピーは、原稿をそのまま拡大して示す画像を出力すべきであるので、拡大コピーでは、網点もそのまま拡大されて出力されること望ましいと考えられる。さらには、網点があるサイズ以上に拡大されると、印刷時のドットの周期成分との干渉によるモアレが発生しなくなる。このために、拡大率Lrが閾値Lth以上である場合には、網点のエッジは、文字のエッジと同様に、エッジ強調処理の対象となる方が、平滑化処理の対象となるよりも好ましいと考えられる。このために、拡大率Lrが閾値Lth以上である場合には、スキャン画像SI内の複数個の画素のうち、文字画素とともに網点のエッジを構成する画素を含み得る文字候補画素が、文字画素として特定されることが好ましいと考えられる。   Further, according to the above embodiment, when the enlargement ratio Lr of the enlargement process in S15 is less than the threshold Lth (S27: YES), the CPU 210 performs the non-character area determination process in S28 and the composition process in S29. Execute. That is, in this case, among a plurality of pixels in the scan image SI, pixels that are determined as character candidate pixels in S22 to S26 and that are not determined as non-character pixels in S28 are characters. Identified as a pixel. When the enlargement ratio Lr is equal to or greater than the threshold Lth (S27: NO), the processes of S28 and S29 are not executed. That is, in this case, a pixel determined to be a character candidate pixel among a plurality of pixels in the scan image SI is specified as a character pixel. As a result, an appropriate character pixel is specified in accordance with the enlargement ratio Lr when the scan data is generated. More specifically, when the scan image SI is enlarged and printed (printed in this embodiment) with an enlargement ratio equal to or greater than the threshold value Lth, the halftone dots are relatively large in the output image, so the halftone dots are conspicuous. However, it often does not look unnatural. For this reason, when the enlargement ratio Lr is equal to or greater than the threshold value Lth, it is often more natural to see the large halftone dot clearly in the output image than to blur it. In addition, since the enlarged copy should output an image showing the original as it is, it is desirable that the halftone dot is also enlarged and output in the enlarged copy. Furthermore, when the halftone dots are enlarged beyond a certain size, moire due to interference with the periodic component of dots during printing does not occur. For this reason, when the enlargement ratio Lr is greater than or equal to the threshold value Lth, the edge of the halftone dot is preferably the target of edge enhancement processing, as is the case of the character edge, than the target of smoothing processing. it is conceivable that. For this reason, when the enlargement ratio Lr is equal to or greater than the threshold value Lth, a character candidate pixel that can include a pixel that forms a halftone dot edge together with the character pixel among the plurality of pixels in the scan image SI is a character pixel. It is considered preferable to be specified as

以上の説明から解るように、本実施例における最小成分データは、第1の画像データの例であり、特定対象画素は、特定条件を満たす画素の例であり、膨張処理前画像データは、中間画像データの例である。   As can be understood from the above description, the minimum component data in the present embodiment is an example of the first image data, the specific target pixel is an example of a pixel that satisfies the specific condition, and the pre-expansion image data is intermediate. It is an example of image data.

B.変形例: B. Variations:

(1)上記実施例の図12の非文字領域判定処理において、前処理は、S420の収縮処理を含んでいるが、S420の収縮処理は、省略されても良い。この場合でも、非文字領域判定処理において、写真Ob1、Ob2に対応する領域を、非文字領域として特定できる。この場合には、例えば、S455の判断において文字領域の占有率PRが上記実施例に比べて大きな値になるので、TH2などの閾値は、上記実施例に比べ大きく設定される。 (1) In the non-character area determination process of FIG. 12 in the above-described embodiment, the preprocessing includes the contraction process of S420, but the contraction process of S420 may be omitted. Even in this case, in the non-character area determination process, the areas corresponding to the photographs Ob1 and Ob2 can be specified as non-character areas. In this case, for example, since the occupancy rate PR of the character area is larger than that in the above embodiment in the determination of S455, the threshold value such as TH2 is set larger than that in the above embodiment.

(2)上記実施例の図12の非文字領域判定処理において、S420の収縮処理の収縮の程度は、S412の膨張処理の膨張の程度よりも大きい。これに代えて、S420の収縮処理の収縮の程度は、S412の膨張処理の膨張の程度と同じでも良よい。また、S420の収縮処理の収縮の程度は、S412の膨張処理の膨張の程度より小さくても良い。 (2) In the non-character area determination process of FIG. 12 of the above embodiment, the degree of contraction in the contraction process in S420 is greater than the degree of expansion in the expansion process in S412. Instead, the degree of contraction in the contraction process in S420 may be the same as the degree of expansion in the expansion process in S412. Further, the degree of contraction in the contraction process in S420 may be smaller than the degree of expansion in the expansion process in S412.

(3)上記実施例の図12の非文字領域判定処理において、S415の膨張処理の回数は、1回であるが、1回に限られない。一般的には、S415の膨張処理は、N回(Nは1以上の整数)の単位膨張処理を含めば良い。同様に、S420の収縮処理の回数は、3回であるが、3回に限られない。一般的には、S420の収縮処理は、M回(Mは1以上の整数)の単位収縮処理を含めば良い。この場合に、収縮処理の収縮の程度を、膨張処理の膨張の程度よりも大きくするために、M>Nを満たすことが好ましい。 (3) In the non-character area determination process of FIG. 12 in the above embodiment, the number of expansion processes in S415 is one, but is not limited to one. In general, the expansion processing in S415 may include unit expansion processing N times (N is an integer of 1 or more). Similarly, the number of contraction processes in S420 is three, but is not limited to three. In general, the contraction process in S420 may include unit contraction processes M times (M is an integer of 1 or more). In this case, it is preferable to satisfy M> N in order to make the degree of contraction of the contraction process larger than the degree of expansion of the expansion process.

(4)上記実施例の図12の非文字領域判定処理において、S420の収縮処理の回数が、S415の膨張処理の回数より多くされることで、S420の収縮処理の収縮の程度が、S412の膨張処理の膨張の程度よりも大きくされている。これに代えて、S420の収縮処理で用いられるフィルタFI2が、S415の膨張処理で用いられるフィルタFI1よりも大きくされることで、収縮処理の収縮の程度が、膨張処理の膨張の程度よりも大きくされても良い。 (4) In the non-character area determination process of FIG. 12 in the above embodiment, the number of contraction processes in S420 is made larger than the number of expansion processes in S415, so that the degree of contraction in the contraction process in S420 is the same as in S412. It is larger than the degree of expansion in the expansion process. Instead, the filter FI2 used in the contraction process of S420 is made larger than the filter FI1 used in the expansion process of S415, so that the degree of contraction of the contraction process is larger than the degree of expansion of the expansion process. May be.

(5)上記実施例の図12の非文字領域判定処理において、連続する複数個の特定対象画素が、1個の対象領域TA1〜TA6に決定されている(S425、図13(B))。これに代えて、例えば、前処理済画像OIbを升目状に分割することによって、前処理済画像OIb上に複数個の矩形の対象領域が決定されても良い。この場合には、対象領域には、特定対象画素と、非特定対象画素と、の両方が含まれ得る。この場合には、対象領域に含まれる特定対象画素の個数が閾値以上である場合に、該対象領域は非文字領域であると判断されても良いし、対象領域の総画素数に占める特定対象画素の画素数の割合が閾値以上である場合に、該対象領域は非文字領域であると判断されても良い。 (5) In the non-character area determination process of FIG. 12 in the above embodiment, a plurality of consecutive specific target pixels are determined as one target area TA1 to TA6 (S425, FIG. 13B). Instead, for example, a plurality of rectangular target areas may be determined on the preprocessed image OIb by dividing the preprocessed image OIb into a grid shape. In this case, the target region may include both the specific target pixel and the non-specific target pixel. In this case, if the number of specific target pixels included in the target area is greater than or equal to the threshold, the target area may be determined to be a non-character area, or the specific target occupying the total number of pixels in the target area When the ratio of the number of pixels is equal to or greater than the threshold value, the target area may be determined to be a non-character area.

(6)上記実施例の非文字領域判定処理において、対象領域が非文字領域であると判断されるための特定の判断条件は、画素数PNが閾値TH1以上であり、かつ、占有率PRが閾値TH2以上であることである。特定の判断条件は、これに限られない。例えば、特定の判断条件は、画素数PNが閾値TH1以上であること、または、占有率PRが閾値TH2以上であることであっても良い。また、特定の判断条件は、画素数PNが閾値TH1以上であることだけが用いられても良いし、占有率PRが閾値TH2以上であることだけが用いられても良い。また、特定の判断条件は、他の条件、例えば、対象領域の縦横比が、写真の領域として想定される所定の縦横比の範囲内であることを含んでも良い。 (6) In the non-character area determination process of the above embodiment, the specific determination condition for determining that the target area is a non-character area is that the number of pixels PN is equal to or greater than the threshold value TH1 and the occupation ratio PR is That is, the threshold value TH2 or more. The specific judgment condition is not limited to this. For example, the specific determination condition may be that the number of pixels PN is equal to or greater than the threshold value TH1, or the occupation rate PR is equal to or greater than the threshold value TH2. Further, the specific determination condition may be that only the number of pixels PN is equal to or greater than the threshold value TH1, or that the occupation rate PR is equal to or greater than the threshold value TH2. Further, the specific determination condition may include other conditions, for example, that the aspect ratio of the target area is within a predetermined aspect ratio assumed as a photograph area.

(7)上記実施例の図2の画像処理において、S24の第2の二値画像データ生成処理およびS26の合成処理は省略されても良い。すなわち、第1の二値画像データ生成処理において特定される複数個のエッジ画素が、最終的なエッジ特定データであっても良い。 (7) In the image processing of FIG. 2 in the above embodiment, the second binary image data generation processing in S24 and the synthesis processing in S26 may be omitted. That is, the plurality of edge pixels specified in the first binary image data generation process may be final edge specifying data.

(8)上記実施例の図2の画像処理において、図2のS27は省略されても良い。すなわち、CPU210は、スキャンデータの生成時の拡大率Lrに拘わらずに、S28、S29を常に実行しても良い。 (8) In the image processing of FIG. 2 in the above embodiment, S27 of FIG. 2 may be omitted. In other words, the CPU 210 may always execute S28 and S29 regardless of the enlargement ratio Lr when the scan data is generated.

(9)図5の第1の二値画像データ生成処理(図5)では、単成分画像データとして、輝度画像データが用いられる(S120)。これに代えて、スキャンデータの対応する画素のRGB値に含まれる3個の成分値(R値、G値、B値)の平均値を、各画素の値とする平均成分値画像データが用いられても良い。 (9) In the first binary image data generation process (FIG. 5) in FIG. 5, luminance image data is used as the single component image data (S120). Instead of this, average component value image data having an average value of three component values (R value, G value, B value) included in the RGB value of the corresponding pixel of the scan data as the value of each pixel is used. May be.

(10)上記実施例の第2の二値画像データ生成処理(図9)では、単成分画像データとして、最小成分データが用いられる(S300)。これに代えて、最大成分データや反転最小成分データが用いられても良い。 (10) In the second binary image data generation process (FIG. 9) of the above embodiment, the minimum component data is used as the single component image data (S300). Instead of this, maximum component data or inverted minimum component data may be used.

最大成分データは、スキャンデータに含まれる複数個の画素に対応する複数個の値を含み、該複数個の値のそれぞれは、スキャンデータの対応する画素の最大成分値Vmaxである。最大成分値Vmaxは、スキャンデータの対応する画素のRGB値に含まれる複数個の成分値(R値、G値、B値)のうちの最大値である。   The maximum component data includes a plurality of values corresponding to a plurality of pixels included in the scan data, and each of the plurality of values is a maximum component value Vmax of the corresponding pixel of the scan data. The maximum component value Vmax is the maximum value among a plurality of component values (R value, G value, B value) included in the RGB value of the corresponding pixel of the scan data.

反転最小成分データは、以下のように、取得される。先ず、スキャンデータに含まれる複数個の画素の値(RGB値)のそれぞれについて、複数個の成分値(R値、G値、B値)が反転された反転済みの色値が生成される。反転前のRGB値を(Rin、Gin、Bin)とすると、反転済みのRGB値(Rout、Gout、Bout)は、以下の式(1)〜(3)で表される。   The inversion minimum component data is acquired as follows. First, for each of a plurality of pixel values (RGB values) included in the scan data, an inverted color value is generated by inverting a plurality of component values (R value, G value, B value). If the RGB values before inversion are (Rin, Gin, Bin), the inverted RGB values (Rout, Gout, Bout) are expressed by the following equations (1) to (3).

Rout=Rmax−Rin …(1)
Gout=Gmax−Gin …(2)
Bout=Bmax−Bin …(3)
Rout = Rmax−Rin (1)
Gout = Gmax−Gin (2)
Bout = Bmax−Bin (3)

ここで、Rmax、Gmax、Bmaxは、それぞれ、R値、G値、B値が取り得る値の最大値であり、本実施例では、Rmax=Gmax=Bmax=255である。これらの反転済みのRGB値を複数個の画素の値とする画像データが、反転画像データとして生成される。そして、反転画像データを用いて、反転最小成分データが生成される。具体的には、反転画像データに含まれる複数個の反転済みのRGB値のそれぞれから、反転最小成分値VRminが取得される。反転最小成分値VRminは、該反転済みのRGB値に含まれる複数個の成分値(R値、G値、B値)のうちの最小値である。反転最小成分データは、これらの反転最小成分値VRminを、複数個の画素の値とする画像データである。   Here, Rmax, Gmax, and Bmax are the maximum values that the R value, G value, and B value can take, respectively, and in this embodiment, Rmax = Gmax = Bmax = 255. Image data having these inverted RGB values as values of a plurality of pixels is generated as inverted image data. Then, the inverted minimum component data is generated using the inverted image data. Specifically, the inverted minimum component value VRmin is obtained from each of a plurality of inverted RGB values included in the inverted image data. The inversion minimum component value VRmin is the minimum value among a plurality of component values (R value, G value, B value) included in the inverted RGB value. The inversion minimum component data is image data in which these inversion minimum component values VRmin are values of a plurality of pixels.

反転最小成分値VRminは、最大成分値の反転値であり、VRmin=(255−Vmax)の関係が成り立つ。このために、最大成分データと反転最小成分データとは、両方とも、スキャンデータの各画素の値に含まれる複数個の成分値のうちの最大値に基づく値(最大値の反転値、あるいは、最大値そのもの)を、画素の値とする画像データである、と言うことができる。なお、実施例の最小成分データは、スキャンデータの各画素の値に含まれる複数個の成分値のうちの最小値に基づく値を、画素の値とする画像データである、と言うことができる。   The inversion minimum component value VRmin is an inversion value of the maximum component value, and the relationship VRmin = (255−Vmax) is established. For this reason, both the maximum component data and the inverted minimum component data are both values based on the maximum value among the plurality of component values included in the value of each pixel of the scan data (the inverted value of the maximum value, or It can be said that the maximum value itself is image data having pixel values. It can be said that the minimum component data of the embodiment is image data in which a value based on the minimum value among a plurality of component values included in each pixel value of the scan data is a pixel value. .

図10に示すように、C、M、Y、K、Wの最大成分値Vmaxは、255、255、255、0、255となり、黒(K)を除いて同じ値となる。したがって、最大成分データや反転最小成分データにおいては、網点領域を構成する5種類の要素、すなわち、C、M、Y、Kの各ドットと、用紙の地色(白)と、のうちの4種類の要素(C、M、Yのドットと、用紙の地色(白))を示す画素間の値の差が抑制される。この結果、最大成分データや反転最小成分データを用いる場合には、最小成分データを用いる場合と同様に、網点に起因するエッジ画素が特定されることを抑制できる。   As shown in FIG. 10, the maximum component values Vmax of C, M, Y, K, and W are 255, 255, 255, 0, and 255, which are the same values except for black (K). Therefore, in the maximum component data and the inverted minimum component data, among the five types of elements constituting the halftone dot region, that is, each dot of C, M, Y, K, and the ground color (white) of the paper Differences in values between pixels indicating four types of elements (C, M, and Y dots and paper ground color (white)) are suppressed. As a result, when the maximum component data and the inverted minimum component data are used, it is possible to suppress the specification of the edge pixels due to the halftone dots, as in the case of using the minimum component data.

(11)上記各実施例では、文字画素に対して、文字鮮鋭化処理が実行され(図2のS40)、非文字画素に対して、網点平滑化処理が実行される(図2のS30)。これに代えて、文字画素に対しては、文字の見栄えを向上するためのアンチエイリアス処理が実行されても良い。また、非文字画素に対しては、例えば、印刷時の色材の使用量を減らすために、色を飛ばす処理(白に変換する処理)が実行されても良い。一般的には、文字画素と、非文字画素と、に互いに異なる画像処理が実行されることが好ましい。あるいは、文字画素と非文字画素のいずれか一方に対して、特定の画像処理が実行され、他方に対して、該特定の画像処理が実行されなくても良い。 (11) In each of the above embodiments, the character sharpening process is performed on the character pixels (S40 in FIG. 2), and the halftone dot smoothing process is performed on the non-character pixels (S30 in FIG. 2). ). Instead, an antialiasing process for improving the appearance of the character may be performed on the character pixel. For non-character pixels, for example, a process of skipping colors (a process of converting to white) may be performed in order to reduce the amount of color material used during printing. In general, it is preferable that different image processing is performed on character pixels and non-character pixels. Alternatively, the specific image processing may be performed on one of the character pixel and the non-character pixel, and the specific image processing may not be performed on the other.

(12)上記実施例では、図5のS130や図9のS320のエッジ抽出処理において、ソーベルフィルタ(Sobel filter)が用いられている。これに代えて、これらエッジ抽出処理では、ロバーツフィルタや、ラプラシアンフィルタなどの他のエッジ抽出フィルタが用いられても良い。 (12) In the above embodiment, a Sobel filter is used in the edge extraction process of S130 of FIG. 5 or S320 of FIG. Instead, other edge extraction filters such as a Roberts filter and a Laplacian filter may be used in these edge extraction processes.

(13)上記実施例では、対象画像データは、スキャンデータであるが、これに限られない。対象画像データは、2次元イメージセンサを備えるデジタルカメラによって印刷物を読み取ることによって生成されても良い。 (13) In the above embodiment, the target image data is scan data, but is not limited thereto. The target image data may be generated by reading a printed matter with a digital camera including a two-dimensional image sensor.

(14)上記実施例では、第1の二値画像データと、第2の二値画像データと、の論理和を取ることによって、エッジ特定データが生成される(図2のS26)。これに代えて、第1の二値画像データと、第2の二値画像データと、第3の二値画像データと、の論理和を取ることによって、エッジ特定データが生成されても良い。第3の二値画像データには、例えば、上述した最大成分データを用いて生成される二値画像データが用いられても良い。これによって、文字などのエッジの特定漏れをさらに抑制することができる。 (14) In the above embodiment, the edge specifying data is generated by taking the logical sum of the first binary image data and the second binary image data (S26 in FIG. 2). Instead of this, the edge specifying data may be generated by taking the logical sum of the first binary image data, the second binary image data, and the third binary image data. As the third binary image data, for example, binary image data generated using the maximum component data described above may be used. As a result, it is possible to further suppress specific omission of edges such as characters.

(15)上記実施例の第1の二値画像データ生成処理(図5)や第2の二値画像データ生成処理(図9)は、適宜に変更可能である。例えば、図5のS110、S110、S140の処理の全部または一部は、省略可能である。また、図9のS310、S330のうちの全部または一部は、省略可能である。 (15) The first binary image data generation process (FIG. 5) and the second binary image data generation process (FIG. 9) of the above embodiment can be changed as appropriate. For example, all or part of the processing of S110, S110, and S140 in FIG. 5 can be omitted. Further, all or part of S310 and S330 in FIG. 9 may be omitted.

(16)図2の画像処理を実現する画像処理装置は、複合機200に限らず、種々の装置であってよい。例えば、スキャナやデジタルカメラが、自身で生成された画像データを用いて、プリンタに供給するための印刷データを生成するために、図2の画像処理を実行しても良い。また、例えば、スキャナやプリンタと通信可能な接続される端末装置(例えば、端末装置100)やサーバ(図示省略)が、スキャナから取得したスキャンデータを用いて、図2の画像処理を実行して、印刷データを生成し、該印刷データをプリンタに供給しても良い。また、ネットワークを介して互いに通信可能な複数個のコンピュータ(例えば、クラウドサーバ)が、画像処理に要する機能を一部ずつ分担して、全体として、画像処理を実行してもよい。この場合、複数個のコンピュータの全体が、画像処理装置の例である。 (16) The image processing apparatus that realizes the image processing of FIG. 2 is not limited to the multifunction machine 200, and may be various apparatuses. For example, the scanner or digital camera may execute the image processing of FIG. 2 in order to generate print data to be supplied to a printer using image data generated by itself. Further, for example, a connected terminal device (for example, the terminal device 100) or server (not shown) that can communicate with the scanner or printer executes the image processing of FIG. 2 using the scan data acquired from the scanner. The print data may be generated and the print data may be supplied to the printer. In addition, a plurality of computers (for example, cloud servers) that can communicate with each other via a network may share the functions required for image processing, and execute image processing as a whole. In this case, the entirety of the plurality of computers is an example of the image processing apparatus.

(17)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。例えば、図12のS410の機械学習モデルを用いて文字確率Txrを算出する処理は、ASICなどの専用のハードウェアによって、実行されても良い。 (17) In each of the above embodiments, a part of the configuration realized by hardware may be replaced with software. Conversely, part or all of the configuration realized by software is replaced with hardware. You may do it. For example, the process of calculating the character probability Txr using the machine learning model in S410 of FIG. 12 may be executed by dedicated hardware such as an ASIC.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。   As mentioned above, although this invention was demonstrated based on the Example and the modification, Embodiment mentioned above is for making an understanding of this invention easy, and does not limit this invention. The present invention can be changed and improved without departing from the spirit and scope of the claims, and equivalents thereof are included in the present invention.

100…端末装置、200…複合機、210…CPU、220…揮発性記憶装置、230…不揮発性記憶装置、240…表示部、250…操作部、270…通信IF、280…印刷実行部、290…読取実行部、PG…コンピュータプログラム、SI…スキャン画像、TI…文字特定画像、GI…平滑化画像、FI…処理済み画像、EI…エッジ特定画像、BI…ブロック判定画像、YI…輝度画像、SI…スキャン画像、DT…網点、SB…サブブロック   DESCRIPTION OF SYMBOLS 100 ... Terminal device, 200 ... MFP, 210 ... CPU, 220 ... Volatile storage device, 230 ... Nonvolatile storage device, 240 ... Display part, 250 ... Operation part, 270 ... Communication IF, 280 ... Print execution part, 290 ... Read execution unit, PG ... Computer program, SI ... Scanned image, TI ... Character specific image, GI ... Smoothed image, FI ... Processed image, EI ... Edge specific image, BI ... Block determination image, YI ... Luminance image, SI: Scanned image, DT: Halftone dot, SB: Sub-block

Claims (11)

画像処理装置であって、
対象画像を示す対象画像データを取得する画像取得部と、
前記対象画像データを用いて、前記対象画像内の複数個の画素のそれぞれが、文字画素の候補であるか否かを画素ごとに判断することによって、複数個の候補画素を決定する候補決定部と、
前記対象画像データに対して膨張処理を含む前処理を実行して、前処理済画像データを生成する前処理部と、
前記前処理済画像データに対応する画像上に配置される複数個の対象領域のそれぞれが特定の判断条件を満たすか否かを判断することによって、前記対象画像内の非文字領域を特定する非文字領域特定部と、
前記対象画像内の複数個の画素のうち、前記候補画素であると決定され、かつ、前記非文字領域とは異なる領域にある画素を、前記文字画素として特定する文字特定部と、
を備える、画像処理装置。
An image processing apparatus,
An image acquisition unit for acquiring target image data indicating the target image;
A candidate determination unit that determines a plurality of candidate pixels by determining, for each pixel, whether or not each of the plurality of pixels in the target image is a character pixel candidate using the target image data. When,
A preprocessing unit that performs preprocessing including expansion processing on the target image data to generate preprocessed image data;
A non-character region in the target image is identified by determining whether each of the plurality of target regions arranged on the image corresponding to the preprocessed image data satisfies a specific determination condition. A character area identification part;
A character identifying unit that identifies, as the character pixel, a pixel that is determined to be the candidate pixel among a plurality of pixels in the target image and that is in a region different from the non-character region;
An image processing apparatus comprising:
請求項1に記載の画像処理装置であって、
前記前処理部は、前記膨張処理の後に収縮処理を実行して、前記前処理済画像データを生成する、画像処理装置。
The image processing apparatus according to claim 1,
The image processing apparatus, wherein the preprocessing unit executes a contraction process after the expansion process to generate the preprocessed image data.
請求項2に記載の画像処理装置であって、
前記前処理に含まれる前記収縮処理の収縮の程度は、前記前処理に含まれる前記膨張処理の膨張の程度よりも大きい、画像処理装置。
The image processing apparatus according to claim 2,
The image processing apparatus, wherein a degree of contraction of the contraction process included in the preprocess is larger than a degree of expansion of the expansion process included in the preprocess.
請求項3に記載の画像処理装置であって、
前記前処理に含まれる前記膨張処理は、N回(Nは1以上の整数)の単位膨張処理を含み、
前記前処理に含まれる前記収縮処理は、M回(MはM>Nを満たす整数)の単位収縮処理を含む、画像処理装置。
The image processing apparatus according to claim 3,
The expansion processing included in the preprocessing includes unit expansion processing N times (N is an integer of 1 or more),
The image processing apparatus, wherein the contraction process included in the preprocessing includes unit contraction process M times (M is an integer satisfying M> N).
請求項1〜4のいずれかに記載の画像処理装置であって、さらに、
前記前処理済画像データを用いて、画像内の特定条件を満たす連続する複数個の画素によって構成される領域を、前記対象領域として決定する、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
An image processing apparatus that determines, using the preprocessed image data, an area composed of a plurality of continuous pixels that satisfy a specific condition in an image as the target area.
請求項5のいずれかに記載の画像処理装置であって、
前記画像内の特定条件を満たす複数個の画素とは異なる複数個の画素によって構成される領域は、前記非文字領域とは異なる領域として特定される、画像処理装置。
The image processing apparatus according to claim 5,
An image processing apparatus, wherein an area constituted by a plurality of pixels different from a plurality of pixels satisfying a specific condition in the image is specified as an area different from the non-character area.
請求項1〜6のいずれかに記載の画像処理装置であって、
前記特定の判断条件は、前記対象領域に基づく判定領域に占める特定条件を満たす画素の割合が基準割合以上であることを含む、画像処理装置。
The image processing apparatus according to claim 1,
The image processing apparatus, wherein the specific determination condition includes a ratio of pixels satisfying a specific condition in a determination area based on the target area being a reference ratio or more.
請求項1〜7のいずれかに記載の画像処理装置であって、
前記特定の判断条件は、前記対象領域内の特定条件を満たす画素の個数が基準数以上であることを含む、画像処理装置。
The image processing apparatus according to claim 1,
The image processing apparatus, wherein the specific determination condition includes that the number of pixels satisfying the specific condition in the target region is equal to or greater than a reference number.
請求項1〜8のいずれかに記載の画像処理装置であって、
前記対象画像データに含まれる前記複数個の画素の値のそれぞれは、複数個の成分値を含む色値であり、
前記前処理部は、
前記対象画像データに含まれる前記複数個の画素の値に対応する複数個の第1値を含む第1の画像データと、前記対象画像データに含まれる前記複数個の画素の値に対応する複数個の第2値を含む第2の画像データと、のうちの少なくとも一方を生成し、
前記第1の画像データと前記第2の画像データとのうちの少なくとも一方を用いて中間画像データを生成し、
前記中間画像データに対して、前記膨張処理を含む処理を実行して、前記前処理済画像データを生成し、
前記第1の画像データに含まれる前記複数個の第1値のそれぞれは、対応する前記画素の値に含まれる前記複数個の成分値のうちの最小値に基づく値であり、
前記第2の画像データに含まれる前記複数個の第2値のそれぞれは、対応する前記画素の値に含まれる前記複数個の成分値のうちの最大値に基づく値である、画像処理装置。
The image processing apparatus according to claim 1,
Each of the plurality of pixel values included in the target image data is a color value including a plurality of component values,
The pre-processing unit is
First image data including a plurality of first values corresponding to the values of the plurality of pixels included in the target image data, and a plurality of corresponding to the values of the plurality of pixels included in the target image data Generating at least one of second image data including the second values,
Generating intermediate image data using at least one of the first image data and the second image data;
The intermediate image data is subjected to processing including the expansion processing to generate the preprocessed image data,
Each of the plurality of first values included in the first image data is a value based on a minimum value among the plurality of component values included in the value of the corresponding pixel,
Each of the plurality of second values included in the second image data is a value based on a maximum value among the plurality of component values included in the corresponding pixel value.
請求項1〜9のいずれかに記載の画像処理装置であって、さらに、
前記対象画像データのうち、特定済みの前記文字画素の値に対して第1の画像処理を実行し、前記文字画素とは異なる画素の値に対して前記第1の画像処理とは異なる第2の画像処理を実行して、画像処理済みの前記対象画像データを生成する画像処理部を備える、画像処理装置。
The image processing apparatus according to claim 1, further comprising:
A first image process is executed on the specified character pixel value of the target image data, and a second value different from the first image process is applied to a pixel value different from the character pixel. An image processing apparatus comprising: an image processing unit that executes the image processing to generate the target image data that has undergone image processing.
コンピュータプログラムであって、
対象画像を示す対象画像データを取得する画像取得機能と、
前記対象画像データを用いて、前記対象画像内の複数個の画素のそれぞれが、文字画素の候補であるか否かを画素ごとに判断することによって、複数個の候補画素を決定する候補決定機能と、
前記対象画像データに対して膨張処理を含む前処理を実行して、前処理済画像データを生成する前処理機能と、
前記前処理済画像データに対応する画像上に配置される複数個の対象領域のそれぞれが特定の判断条件を満たすか否かを判断することによって、前記対象画像内の非文字領域を特定する非文字領域特定機能と、
前記対象画像内の複数個の画素のうち、前記候補画素であると決定され、かつ、前記非文字領域とは異なる領域にある画素を、前記文字画素として特定する文字特定機能と、
をコンピュータに実現させる、コンピュータプログラム。
A computer program,
An image acquisition function for acquiring target image data indicating the target image;
Candidate determination function for determining a plurality of candidate pixels by determining for each pixel whether or not each of the plurality of pixels in the target image is a character pixel candidate using the target image data When,
A preprocessing function for generating preprocessed image data by executing preprocessing including expansion processing on the target image data;
A non-character region in the target image is identified by determining whether each of the plurality of target regions arranged on the image corresponding to the preprocessed image data satisfies a specific determination condition. Character area identification function,
A character specifying function for specifying, as the character pixel, a pixel that is determined to be the candidate pixel among a plurality of pixels in the target image and is in a region different from the non-character region;
A computer program that causes a computer to realize
JP2018050232A 2017-09-20 2018-03-16 Image processing equipment and computer programs Active JP6867609B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2018050232A JP6867609B2 (en) 2018-03-16 2018-03-16 Image processing equipment and computer programs
US16/136,422 US10423854B2 (en) 2017-09-20 2018-09-20 Image processing apparatus that identifies character pixel in target image using first and second candidate character pixels
US16/553,591 US10565465B2 (en) 2017-09-20 2019-08-28 Image processing apparatus that identifies character pixel in target image using first and second candidate character pixels

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018050232A JP6867609B2 (en) 2018-03-16 2018-03-16 Image processing equipment and computer programs

Publications (2)

Publication Number Publication Date
JP2019161623A true JP2019161623A (en) 2019-09-19
JP6867609B2 JP6867609B2 (en) 2021-04-28

Family

ID=67993570

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018050232A Active JP6867609B2 (en) 2017-09-20 2018-03-16 Image processing equipment and computer programs

Country Status (1)

Country Link
JP (1) JP6867609B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07160812A (en) * 1993-12-09 1995-06-23 Canon Inc Device and method for image processing
JPH08241376A (en) * 1995-03-02 1996-09-17 Canon Inc Device and method for character recognition
JP2005260452A (en) * 2004-03-10 2005-09-22 Fuji Xerox Co Ltd Image processing apparatus
JP2006180424A (en) * 2004-12-24 2006-07-06 Ricoh Co Ltd Image processing apparatus and image processing method, and computer-readable memory medium recording program that makes computer execute image processing method
JP2008294678A (en) * 2007-05-23 2008-12-04 Kyocera Mita Corp Image processor and image forming apparatus
JP2009231945A (en) * 2008-03-19 2009-10-08 Konica Minolta Business Technologies Inc Image processing apparatus, image forming apparatus, control method for the image processing apparatus, and control program for the image processing apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07160812A (en) * 1993-12-09 1995-06-23 Canon Inc Device and method for image processing
JPH08241376A (en) * 1995-03-02 1996-09-17 Canon Inc Device and method for character recognition
JP2005260452A (en) * 2004-03-10 2005-09-22 Fuji Xerox Co Ltd Image processing apparatus
JP2006180424A (en) * 2004-12-24 2006-07-06 Ricoh Co Ltd Image processing apparatus and image processing method, and computer-readable memory medium recording program that makes computer execute image processing method
JP2008294678A (en) * 2007-05-23 2008-12-04 Kyocera Mita Corp Image processor and image forming apparatus
JP2009231945A (en) * 2008-03-19 2009-10-08 Konica Minolta Business Technologies Inc Image processing apparatus, image forming apparatus, control method for the image processing apparatus, and control program for the image processing apparatus

Also Published As

Publication number Publication date
JP6867609B2 (en) 2021-04-28

Similar Documents

Publication Publication Date Title
JP6781406B2 (en) Image processing equipment and computer programs
JP4684959B2 (en) Image processing apparatus, image processing method, and program
JP2002084420A (en) Image processing unit, image processing method and recording medium with stored image processing program
JP6127877B2 (en) Image processing apparatus and computer program
JP2009278363A (en) Image processor and image processing method
JP2018056873A (en) Image processing device and computer program
US10565465B2 (en) Image processing apparatus that identifies character pixel in target image using first and second candidate character pixels
JP2020052893A (en) Image processing apparatus and computer program
JP6031921B2 (en) Image processing apparatus and program
US10339636B2 (en) Image processing apparatus that specifies edge pixel in target image by calculating edge strength
JP6944127B2 (en) Image processing equipment, computer programs, and image processing methods
JP6867609B2 (en) Image processing equipment and computer programs
JP2019140538A (en) Image processing system, image formation device, image processing method, and program
US10389909B2 (en) Image processing apparatus that specifies edge pixel in target image using minimum and maximum component values of pixel value in target image data
JP6841254B2 (en) Image processing equipment and computer programs
JP6879465B2 (en) Image processing equipment and computer programs
JP2010273393A (en) Image processor, and method of controlling the same
JP7248944B2 (en) Image processing device and computer program
JP7205689B2 (en) Image processing device and computer program
JP5949399B2 (en) Image processing apparatus and program
JP3564216B2 (en) Image processing device
JP6852665B2 (en) Image processing equipment, computer programs, and image processing methods
JP2015220742A (en) Image processing system, image forming apparatus, and control method for them
JP2018056874A (en) Image processing device and computer program
JP2018169988A (en) Image processing apparatus and computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200312

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20201116

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20201124

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210124

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210323

R150 Certificate of patent or registration of utility model

Ref document number: 6867609

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150