JP7205689B2 - Image processing device and computer program - Google Patents

Image processing device and computer program Download PDF

Info

Publication number
JP7205689B2
JP7205689B2 JP2018229489A JP2018229489A JP7205689B2 JP 7205689 B2 JP7205689 B2 JP 7205689B2 JP 2018229489 A JP2018229489 A JP 2018229489A JP 2018229489 A JP2018229489 A JP 2018229489A JP 7205689 B2 JP7205689 B2 JP 7205689B2
Authority
JP
Japan
Prior art keywords
blocks
pixels
character
image data
background
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018229489A
Other languages
Japanese (ja)
Other versions
JP2020092363A (en
Inventor
将也 ▲高▼須
竜司 山田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2018229489A priority Critical patent/JP7205689B2/en
Publication of JP2020092363A publication Critical patent/JP2020092363A/en
Application granted granted Critical
Publication of JP7205689B2 publication Critical patent/JP7205689B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本明細書は、イメージセンサを用いて印刷物を読み取ることによって生成される画像データに対する画像処理に関し、特に、画像内の文字画素を特定するための画像処理に関する。 The present specification relates to image processing for image data generated by reading printed matter using an image sensor, and more particularly to image processing for identifying character pixels in an image.

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

特許文献1に開示された画像処理装置は、画素ごとにエッジであるか否かを判定するエッジ判定と、画素ごとに網点であるかを判定する網点判定と、を実行する。画像処理装置は、エッジであり、かつ、網点ではない画素を、文字を示す画素として特定する。 The image processing apparatus disclosed in Japanese Patent Application Laid-Open No. 2002-200013 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 device identifies pixels that are edges and are not halftone dots as pixels representing characters.

特開平4-318659号公報JP-A-4-318659 特開平3-208467号公報JP-A-3-208467

このように、網点を含む画像であっても、例えば、網点に起因して文字のない領域において文字画素が誤って特定されることを抑制して、文字画素を精度良く特定できる技術が求められていた。 As described above, even in an image including halftone dots, for example, there is a technique that prevents erroneous identification of character pixels in an area without characters due to halftone dots, thereby accurately identifying character pixels. was wanted.

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

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

[適用例1]画像処理装置であって、イメージセンサを用いて印刷物を読み取ることによって生成される対象画像データを取得する画像取得部と、前記対象画像データを用いて、前記対象画像データによって示される対象画像内の複数個の画素の中から文字画素の候補である複数個の候補画素を特定する第1の特定部であって、前記対象画像内のエッジを構成する複数個のエッジ画素を前記候補画素として特定する処理を含む、前記第1の特定部と、前記対象画像内に複数個のブロックを配置する配置部であって、前記複数個のブロックは、背景の特徴を示す特定の特徴値を有する複数の背景ブロックと、前記特定の特徴値とは異なる特徴値を有する非背景ブロックと、を含む、前記配置部と、前記対象画像データを用いて、前記対象画像に配置される複数個のブロックのうちの非背景ブロックが連続する個数である連続数を特定する連続数特定部と、前記連続数に基づいて前記複数個のブロックから文字ブロックを特定する第2の特定部と、前記候補画素の特定結果と、前記文字ブロックの特定結果と、に基づいて、前記対象画像内の複数個の前記文字画素を特定する第3の特定部と、を備える画像処理装置。 [Application Example 1] An image processing apparatus comprising: an image acquisition unit that acquires target image data generated by reading printed matter using an image sensor; a first identifying unit that identifies a plurality of candidate pixels that are candidates for character pixels from among a plurality of pixels in a target image that is captured, wherein a plurality of edge pixels forming an edge in the target image are identified; and a placement unit for placing a plurality of blocks in the target image, wherein the plurality of blocks is a specific block indicating characteristics of a background. arranged in the target image using the placement unit and the target image data, including a plurality of background blocks having feature values and non-background blocks having feature values different from the specific feature values; a continuation number identifying unit that identifies a continuation number, which is the number of continuations of non-background blocks among a plurality of blocks in the background block; and a second identification unit that identifies a character block from the plurality of blocks based on the continuation number. and a third identifying unit that identifies the plurality of character pixels in the target image based on the result of identifying the candidate pixel and the result of identifying the character block.

背景とは異なるオブジェクトは、文字や写真などの種類に応じて特徴の連続性が異なる。上記構成によれば、背景とは異なる非背景ブロックが連続する個数である連続数に基づいて文字ブロックが特定されるので、上述した特徴の連続性を考慮して適切に文字ブロックを特定できる。したがって、候補画素の特定結果と文字ブロックの特定結果とに基づいて、対象画像内の文字画素を精度良く特定できる。 Objects that are different from the background have different feature continuity depending on the type, such as characters or photographs. According to the above configuration, character blocks are identified based on the number of consecutive non-background blocks that are different from the background, so character blocks can be appropriately identified in consideration of the continuity of the features described above. Therefore, the character pixels in the target image can be accurately identified based on the identification result of the candidate pixel and the identification result of the character block.

なお、本明細書に開示される技術は、種々の形態で実現することが可能であり、例えば、複合機、スキャナ、プリンタ、画像処理方法、これら装置の機能または上記方法を実現するためのコンピュータプログラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。 It should be noted that the technology disclosed in this specification can be implemented in various forms. It can be implemented in the form of a program, a recording medium recording the computer program, or the like.

画像処理装置の一例である複合機200の構成を示すブロック図である。1 is a block diagram showing the configuration of a multi-function peripheral 200, which is an example of an image processing apparatus; FIG. 画像処理のフローチャートである。4 is a flowchart of image processing; 画像処理で用いられる画像の一例を示す第1の図である。FIG. 4 is a first diagram showing an example of an image used in image processing; 文字特定処理で用いられる画像の一例を示す図である。It is a figure which shows an example of the image used by character specific processing. 第1の二値画像データ生成処理のフローチャートである。4 is a flowchart of first binary image data generation processing; エッジ強調処理のフローチャートである。6 is a flowchart of edge enhancement processing; 平滑化済みのR成分画像データとエッジ強調済みのR成分画像データとの説明図である。FIG. 4 is an explanatory diagram of smoothed R component image data and edge-enhanced R component image data; レベル補正処理のためのトーンカーブの一例を示す図である。FIG. 10 is a diagram showing an example of a tone curve for level correction processing; 第2の二値画像データ生成処理のフローチャートである。9 is a flowchart of second binary image data generation processing; スキャンデータの最小成分値と最大成分値の説明図である。FIG. 4 is an explanatory diagram of minimum component values and maximum component values of scan data; 画像処理に用いられる画像の一例を示す第2の図である。FIG. 4 is a second diagram showing an example of an image used for image processing; 第1実施例のブロック判定処理のフローチャートである。4 is a flowchart of block determination processing of the first embodiment; 第1実施例のブロック判定処理のフローチャートである。4 is a flowchart of block determination processing of the first embodiment; スキャン画像SI上に配置される複数個のブロックBLの説明図である。FIG. 3 is an explanatory diagram of a plurality of blocks BL arranged on a scanned image SI; ランレングス情報の説明図である。FIG. 4 is an explanatory diagram of run length information; スキャン画像SI上に特定される各種のブロックの説明図である。FIG. 4 is an explanatory diagram of various blocks specified on the scanned image SI; 第2実施例のブロック判定処理のフローチャートである。10 is a flowchart of block determination processing of the second embodiment;

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 Embodiments will be described based on examples. FIG. 1 is a block diagram showing the configuration of a multifunction machine 200, which is an example of an image processing apparatus. The MFP 200 includes a CPU 210 that is a processor that controls an image processing device, a volatile storage device 220 such as a DRAM, a nonvolatile storage device 230 such as a flash memory or 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 the user's terminal device 100, a print execution unit 280, and a read execution unit 290. , is equipped with

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

揮発性記憶装置220は、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域を提供する。不揮発性記憶装置230には、コンピュータプログラムPGが格納されている。コンピュータプログラムPGは、CPU210に複合機200の制御を実現させる制御プログラムである。本実施例では、コンピュータプログラムPGは、複合機200の製造時に、不揮発性記憶装置230に予め格納される形態で提供される。これに代えて、コンピュータプログラムPGは、サーバからダウンロードされる形態で提供されても良く、DVD-ROMなどに格納される形態で提供されてもよい。CPU210は、コンピュータプログラムPGを実行することにより、後述する画像処理を実行することができる。 Volatile storage device 220 provides a buffer area for temporarily storing various intermediate data generated when CPU 210 performs processing. A computer program PG is stored in the nonvolatile storage device 230 . The computer program PG is a control program that causes the CPU 210 to control the MFP 200 . In this embodiment, the computer program PG is provided in a form pre-stored in the non-volatile storage device 230 when the MFP 200 is manufactured. Alternatively, the computer program PG may be provided in the form of being downloaded from a server, or may be provided in the form of being stored on a DVD-ROM or the like. The CPU 210 can execute image processing, which will 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 platen of the reading execution unit 290 and inputs a copy execution instruction. This image processing acquires scan data generated by reading a document using the reading execution unit 290, and uses the scan data to generate print data representing the document, thereby making a so-called copy of the document. This is the process to be implemented.

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 reads the document placed on the platen by the user using the reading execution unit 290 to generate scan data as target image data. The document is, for example, a printed matter in which an image is printed by the MFP 200 or a printer (not shown). The generated scan data is stored in a buffer area of 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 with a color value (also called an RGB value) in the RGB color system. 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). I'm in. In this embodiment, the number of gradations of each component value is 256 gradations.

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

図3は、画像処理で用いられる画像の一例を示す第1の図である。図3(A)には、スキャンデータによって示されるスキャン画像SIの一例が示されている。スキャン画像SIは、複数個の画素を含む。該複数個の画素は、第1方向D1と、第1方向D1と直交する第2方向D2と、に沿って、マトリクス状に配置されている。 FIG. 3 is a first diagram showing an example of an image used in image processing. FIG. 3A shows an example of a scanned image SI represented by scan data. Scan 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と、3個の文字とは異なるオブジェクトOb1~Ob3と、2個の文字Ob4、Ob5と、2個の文字Ob4、Ob5の背景Bg2と、を含んでいる。文字とは異なるオブジェクトは、例えば、写真である。背景Bg2は、白色とは異なる色を有する均一な画像である。 The scanned image SI of FIG. 3A includes a white background Bg1 indicating the background color of the paper of the original, three objects Ob1 to Ob3 different from characters, two characters Ob4 and Ob5, and two characters Ob4 and Ob5. and a background Bg2 of characters Ob4 and Ob5. An object different from text is, for example, a photograph. Background Bg2 is a uniform image having a color different from white.

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

文字特定処理によって、例えば、文字画素の値が「1」とされ、非文字画素の値が「0」とされた二値画像データ(文字特定データとも呼ぶ)が生成される。図3(B)には、文字特定データによって示される文字特定画像TIの一例が示されている。この文字特定画像TIには、スキャン画像SI内の2個の文字Ob4、Ob5のエッジを構成する複数個の画素が、文字画素Tp4、Tp5として、特定されている。なお、比較的大きな文字については、文字のエッジを構成する画素が文字画素として特定され、比較的小さな文字については、文字を構成する画素の全体が文字画素として特定される。文字特定処理の詳細は、後述する。 By the character identification process, for example, binary image data (also referred to as character identification data) is generated in which the value of character pixels is set to "1" and the value of non-character pixels is set to "0". FIG. 3B shows an example of the character identification image TI indicated by the character identification data. In this character identification image TI, a plurality of pixels forming edges of two characters Ob4 and Ob5 in the scanned image SI are identified as character pixels Tp4 and Tp5. For relatively large characters, the pixels forming the edges of the characters are identified as character pixels, and for relatively small characters, the entire pixels forming the characters 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 executes halftone dot smoothing processing on the scan data to generate smoothed image data representing a smoothed image. Specifically, the CPU 210 executes smoothing processing using a smoothing filter such as a Gaussian filter on each of the values of a plurality of non-character pixels included in the scan data, and performs smoothing processing. Calculate values for a plurality of non-character pixels. Non-character pixels to be smoothed are specified by referring to the character specifying data generated by the classification process of S20. The CPU 210 generates smoothed image data including the values of a plurality of character pixels included in the scan data and the values of a plurality of non-character pixels that have been smoothed.

図3(C)には、平滑化画像データによって示される平滑化画像GIが示されている。平滑化画像GIは、白色の背景Bg1gと、スキャン画像SI内のオブジェクトOb1~Ob5、背景Bg2が平滑化されたオブジェクトOb1g~Ob5g、背景Bg2gを含んでいる。これらのオブジェクトOb1g~Ob5g、背景Bg2gのうち、文字Ob4g、Ob5g以外の部分(非文字部分とも呼ぶ)は、スキャン画像SIと比較して、平滑化されている。 FIG. 3C shows the smoothed image GI represented by the smoothed image data. The smoothed image GI includes a white background Bg1g, objects Ob1 to Ob5 in the scanned image SI, objects Ob1g to Ob5g obtained by smoothing the background Bg2, and a background Bg2g. Of these objects Ob1g to Ob5g and background Bg2g, portions other than the characters Ob4g and Ob5g (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 executes character sharpening processing on the smoothed image data to generate processed image data. Specifically, the CPU 210 executes sharpening processing such as unsharp mask processing and processing applying a sharpening filter to each of the values of a plurality of character pixels included in the smoothed image data. Values of a plurality of sharpened character pixels are calculated. The character pixels to be sharpened are specified by referring to the character specifying data generated by the classification process of S20. Then, the CPU 210 calculates the values of the plurality of non-character pixels (the values of the plurality of non-character pixels that have undergone the smoothing process) and the values of the plurality of character pixels that have undergone the sharpening process, which are included in the smoothed image data. , to generate processed image data including . The values of the plurality of character pixels included in the smoothed image data are the same as the values of the plurality of character pixels included in the scan data because they are not subject to smoothing processing. Therefore, it can be said that the character sharpening process of 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~Ob5、背景Bg2に対応するオブジェクトOb1f~Ob5f、背景Bg2fを含んでいる。これらのオブジェクトOb1f~Ob5f、背景Bg2fのうち、文字Ob4f、Ob5fのエッジは、スキャン画像SI内の文字Ob4、Ob5や、平滑化画像GI内の文字Ob4g、Ob5gと比較して、鮮鋭化されている。また、文字以外のオブジェクトOb1f~Ob3f、背景Bg2fのエッジは、鮮鋭化されていない。 FIG. 3D shows the processed image FI indicated by the processed image data. The processed image FI includes a white background Bg1f, objects Ob1 to Ob5 in the scanned image SI, objects Ob1f to Ob5f corresponding to the background Bg2, and a background Bg2f. Among these objects Ob1f to Ob5f and the background Bg2f, the edges of the characters Ob4f and Ob5f are sharpened compared to the characters Ob4 and Ob5 in the scanned image SI and the characters Ob4g and Ob5g in the smoothed image GI. there is Edges of objects Ob1f to Ob3f other than characters and background Bg2f are not sharpened.

以上の説明から解るように、処理済み画像FI内のオブジェクトOb1f~Ob5f、背景Bg2fは、鮮鋭化された文字と、平滑化された非文字を含む。 As can be seen from the above description, the objects Ob1f to Ob5f 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 print data generation processing for generating print data using the processed image data. Specifically, color conversion processing is performed on the processed image data, which is RGB image data, to obtain a color having color components (C, M, Y, and K components) corresponding to the color materials used for printing. CMYK image data is generated that indicates the color of each pixel with the CMYK values. Color conversion processing is executed, for example, with reference to a known lookup table. Halftone processing is performed on the CMYK value image data to generate dot data indicating the state of dot formation for each color material used for printing and for each pixel. The dot formation state can take, for example, two types of dot states and no dot states, and four types of states of large dots, medium dots, small dots, and no dots. Halftone processing is performed, for example, according to a dither method or an error diffusion method. The dot data are rearranged in order of use at the time of 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 print processing and ends the image processing. Specifically, CPU 210 supplies print data to print execution unit 280 and causes print execution unit 280 to print the processed image.

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

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

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

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

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

特に、上記画像処理では、印刷データ生成部としてのCPU210は、処理済み画像データを用いて、印刷データを生成する(S50)ので、例えば、印刷される処理済み画像FIに発生しやすいモアレを抑制可能な適切な印刷データを生成することができる。 In particular, in the image processing described above, the CPU 210 as a print data generation unit uses the processed image data to generate print data (S50). Possible appropriate print data can be generated.

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

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

S26では、CPU210は、S22にて生成された第1の二値画像データと、S24にて生成された第2の二値画像データと、を合成する論理和合成処理を実行して、最終的に特定されるエッジ画素と非エッジ画素とを示す二値画像データ(エッジ特定データとも呼ぶ)を生成する。具体的には、CPU210は、第1の二値画像データと、第2の二値画像データと、の各画素の論理和を取ることによって、エッジ特定データとしての二値画像データを生成する。 In S26, the CPU 210 executes logical sum synthesis processing for synthesizing the first binary image data generated in S22 and the second binary image data generated in S24. Binary image data (also called edge identification data) indicating edge pixels and non-edge pixels identified by . Specifically, the CPU 210 generates binary image data as edge identification data by calculating the logical sum of each pixel of the first binary image data and the second binary image data.

換言すれば、第1の特定部としてのCPU210は、第1の二値画像データによって特定される複数個の第1のエッジ画素と、第2の二値画像データによって特定される複数個の第2のエッジ画素と、を含む画素群であって、第1のエッジ画素とも第2のエッジ画素とも異なる画素を含まない画素群を、最終的に、複数個のエッジ画素(文字候補画素)として特定する。この結果、第1の二値画像データと第2の二値画像データとを用いて、対象画像内の画素がエッジ画素であるか否かを精度良く判断することができる。例えば、スキャン画像SI内のエッジ画素の特定漏れを効果的に低減できる。 In other words, the CPU 210 as a first specifying unit determines a plurality of first edge pixels specified by the first binary image data and a plurality of edge pixels specified by the second binary image data. 2 edge pixels, and does not include pixels different from either the first edge pixel or the second edge pixel, is finally defined as a plurality of edge pixels (character candidate pixels). Identify. As a result, using the first binary image data and the second binary image data, it is possible to accurately determine whether a pixel in the target image is an edge pixel. For example, omission of specifying edge pixels in the scanned image SI can be effectively reduced.

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

図4は、文字特定処理で用いられる画像の一例を示す図である。図4(A)には、エッジ特定データによって示されるエッジ特定画像EIの一例が示されている。このエッジ特定画像EIには、スキャン画像SI内のオブジェクトOb1~Ob5のエッジEg1~Eg5を構成する複数個のエッジ画素と、背景Bg1と背景Bg2との境界のエッジEg8を構成する複数個のエッジ画素とが、文字候補画素として特定されている。このように、文字候補画素によって示されるエッジは、文字のエッジを含む。また、該エッジは、文字とは異なるオブジェクト(例えば、写真)に含まれる細線などのエッジを含む。 FIG. 4 is a diagram showing an example of an image used in character identification processing. FIG. 4A shows an example of an edge identification image EI indicated by edge identification data. This edge identification image EI includes a plurality of edge pixels forming edges Eg1 to Eg5 of objects Ob1 to Ob5 in the scan image SI, and a plurality of edges forming an edge Eg8 on the boundary between the background Bg1 and the background Bg2. pixels are identified as character candidate pixels. Thus, edges indicated by character candidate pixels include character edges. The edges also include edges such as thin lines included in objects other than characters (for example, photographs).

S28では、CPU210は、スキャンデータに対して、ブロック判定処理を実行して、ブロックごとに、文字を含む文字ブロックと、文字を含まない非文字ブロックと、を示す二値画像データ(ブロック判定データとも呼ぶ)を生成する。ブロック判定処理は、スキャンデータを用いて、スキャン画像SI内に配置される複数個のブロックのそれぞれが、文字ブロックであるか否かをブロックごとに判断する処理である。1個のブロックは、N個(Nは2以上の整数)の画素を含む矩形の領域である。ブロック判定データは、文字ブロックを構成する画素の値が「1」とされ、非文字ブロックを構成する画素の値が「0」とされた二値画像データである。 In S28, the CPU 210 executes block determination processing on the scan data to generate binary image data (block determination data (also called The block determination process uses scan data to determine whether each of a plurality of blocks arranged in the scan image SI is a character block or not. One block is a rectangular area containing N (N is an integer equal to or greater than 2) pixels. The block determination data is binary image data in which the value of pixels forming a character block is "1" and the value of pixels forming a non-character block is "0".

図4(B)には、ブロック判定データによって示されるブロック判定画像BIの一例が示されている。このブロック判定画像BIには、スキャン画像SI内の文字Ob4、Ob5が配置された領域を示す文字ブロックBk4、Bk5が特定されている。 FIG. 4B shows an example of the block determination image BI indicated by the block determination data. Character blocks Bk4 and Bk5 indicating areas where characters Ob4 and Ob5 in the scan image SI are arranged are specified in the block determination image BI.

S29では、CPU210は、S26にて生成されたエッジ特定データと、S28にて生成されたブロック判定データと、を合成する論理積合成処理を実行して、文字画素と非文字画素とを示す上述した文字特定データ(図3(B)参照)を生成する。具体的には、CPU210は、エッジ特定データと、ブロック判定データと、の各画素の論理積を取ることによって、文字特定データとしての二値画像データを生成する。換言すれば、CPU210は、エッジ特定データによって特定される複数個の候補画素のうち、ブロック判定データによって特定される文字ブロック内に位置する画素を、文字画素として特定する。CPU210は、スキャン画像SI内の複数個の画素のうち、エッジ特定データによって特定される複数個の候補画素とは異なる画素、および、ブロック判定データによって特定される文字ブロックとは異なるブロック内に位置する画素を、非文字画素として特定する。文字特定データが生成されると、文字特定処理は、終了される。 In S29, the CPU 210 executes a logical AND synthesizing process for synthesizing the edge specifying data generated in S26 and the block determination data generated in S28, thereby obtaining the character pixels and the non-character pixels. character identification data (see FIG. 3B). Specifically, the CPU 210 generates binary image data as character identification data by taking a logical AND of each pixel of the edge identification data and the block determination data. In other words, the CPU 210 identifies, as character pixels, pixels located in the character block identified by the block determination data among the plurality of candidate pixels identified by the edge identification data. The CPU 210 selects, among the plurality of pixels in the scan image SI, pixels that are different from the plurality of candidate pixels specified by the edge specifying data and that are located in blocks different from the character block specified by the block determination data. pixels are identified as non-character pixels. Once the character identification data is generated, the character identification process is terminated.

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 of S22 in FIG. 2 will be described. FIG. 5 is a flowchart of the first binary image data generation process. In S100, the CPU 210 executes smoothing processing on each of the three component image data included in the scan data, that is, the R component image data, the G component image data, and the B component image data. As a result, three pieces of 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 of smoothing the component image indicated by the component image data to be processed. The smoothing process of this embodiment is a process of applying a predetermined smoothing filter to the value of each pixel of the component image data to be processed to calculate the value of each smoothed pixel. For 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 pieces of smoothed component image data to obtain three pieces of edge-enhanced component image data, that is, edge-enhanced R component image data, edge G component image data that has been emphasized and B component image data that has been edge emphasized are generated.

図6は、エッジ強調処理のフローチャートである。ここでは、平滑化済みのR成分画像データが処理対象であるとして説明する。平滑化済みのG成分画像データおよび平滑化済みのB成分画像データに対しても同様の処理が行われる。 FIG. 6 is a flowchart of edge enhancement processing. Here, it is assumed that smoothed R component image data is to be processed. Similar 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 the memory (specifically, the 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 scanned image SI, that is, an image having the same number of pixels. The value of each pixel of canvas data is a predetermined initial value (eg, 0).

S205では、CPU210は、平滑化済みのR成分画像データによって示される平滑化済みのR成分画像内の複数個の画素から1個の注目画素を選択する。 In S205, the CPU 210 selects one target pixel 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として算出される。 At S210, the CPU 210 calculates a mask value MV corresponding to the pixel of interest. The mask value MV is obtained by smoothing the value TV of the pixel of interest using the value TV of the pixel of interest and the values of a predetermined number of surrounding pixels including four pixels adjacent to the pixel of interest above, below, left and right. Calculated by processing. For this reason, the mask value MV is also called a smooth value. Specifically, the average value of the values of 100 pixels within a rectangular range of 10 vertical pixels×10 horizontal pixels centered on the pixel of interest is calculated as the mask value MV corresponding to the pixel of interest.

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

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

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

S245では、CPU210は、注目画素の値を、S200にて準備されたキャンバスデータに記録する。S240が実行された場合には、S240にて算出された注目画素の値TVと、注目画素に対応する差分ΔVと、の和が、処理済みの値としてキャンバスデータに記録される。S240がスキップされた場合には、平滑化済みのR成分画像データの注目画素の値が、そのまま、キャンバスデータに記録される。 At S245, the CPU 210 records the value of the target pixel in the canvas data prepared at 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. If S240 is skipped, the value of the pixel of interest in the smoothed R component image data is recorded as is in the canvas data.

S250では、CPU210は、R成分画像内の全ての画素を注目画素として処理したか否かを判断する。未処理の画素がある場合には(S250:NO)、CPU210は、S205に戻って、未処理の画素を注目画素として選択する。全ての画素が処理された場合には(S250:YES)、CPU210は、エッジ強調処理を終了する。この時点でエッジ強調済みのR成分画像データが生成されている。 In S250, CPU 210 determines whether or not all pixels in the R component image have been processed as pixels of interest. If there is an unprocessed pixel (S250: NO), the CPU 210 returns to S205 and selects the unprocessed pixel as the pixel of interest. When all pixels have been processed (S250: YES), the CPU 210 terminates the edge enhancement process. At this point, edge-enhanced R component image data has been 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 of 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 area indicating halftone dots, and the right portion conceptually shows an edge area indicating the 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 (eg, 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内の背景Bg2などの均一な部分や、オブジェクトのエッジとは異なる部分において、エッジ画素は、特定されるべきではない。 The R component image data before the smoothing process includes, for example, a plurality of valleys C1 to C3 corresponding to a plurality of halftone dots and a plurality of gaps between the halftone dots in the halftone dot area, A plurality of peaks P1 and P2 appear (FIG. 7(A)). If there remains a large difference in the value of the R component between the troughs C1 to C3 and the plurality of peaks P1 and P2, the R Edge pixels representing halftone dots are likely to be identified due to the difference in component values. A halftone dot area includes halftone dots when viewed from a pixel-level viewpoint (a microscopic viewpoint where halftone dots can be recognized), but when viewed from an observer's viewpoint (a macroscopic viewpoint where halftone dots cannot be recognized) , is a uniform region. Therefore, in this embodiment, edge pixels caused by halftone dots should not be specified in the halftone dot area. This is because halftone dot areas are preferably smoothed in S30 of FIG. 2 and should not be sharpened in S40. This is because if the edges of the halftone dots are sharpened, the periodicity of the halftone dots becomes conspicuous, and moire becomes more conspicuous when the image is printed. For example, edge pixels should not be identified in uniform parts such as the background Bg2 in the scan image SI and in parts different from the edge of the object.

平滑化済みのR成分画像データでは、平滑化処理によって、例えば、網点領域において、複数個の谷部C1a~C3aと、複数個の山部P1a、P2aと、のR成分の値の差が、平滑化処理前のR成分画像データと比較して十分に小さくなっている(図7(B))。 In the smoothed R component image data, for example, in the halftone dot area, the differences in the R component values between the plurality of valleys C1a to C3a and the plurality of peaks P1a and P2a are reduced. , is sufficiently smaller than the R component image data before smoothing (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 this embodiment, the edge enhancement effect increases as the difference ΔV between the target pixel value TV and the mask value MV corresponding to the target pixel increases. For this reason, the effect of edge enhancement is reduced in a flat area with a relatively small difference in R component value, such as the halftone dot area in FIG. 7B. In addition, in the edge enhancement processing of this embodiment, when the difference ΔV is less than the reference, edge enhancement is not performed, and the pixel values of the smoothed R component image data are used as they are (see FIG. 6). S230). As a result, in the edge-enhanced R component image data, for example, a plurality of valleys C1b to C3b, a plurality of peaks P1b, and a plurality of peaks P1b, The difference between the R component values of P2b and P2b is not large compared to the smoothed R component image data (FIG. 7(C)). That is, in the edge-enhanced R component image data, similar to the smoothed R component image data, the values of the R components of the plurality of valleys C1b to C3b and the plurality of peaks P1b and P2b are The difference is sufficiently small (FIG. 7(C)) compared to the R component image data (FIG. 7(A)) before smoothing.

平滑化処理前の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 the edge of an object such as a character, a fluctuating portion E1 in which the value of the R component changes sharply corresponding to the edge appears (see FIG. 7 ( A)). In such a fluctuation portion E1, the greater the change in value, the easier it is for the edge pixel indicating the edge of the object to be identified in the binarization processing of S150, which will be described later, due to the difference in the value of the R component.

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

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

以上の説明から解るように、本実施例では、各成分画像データに対して、平滑化処理(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 performed on each component image data in this order, so that the edge of the halftone dot is It is possible to suppress the edge pixels indicating the edge from being specified, and to promote the edge pixels indicating the edge of the object such as characters to be specified. As a result, a plurality of edge pixels in the scanned image SI can be appropriately specified.

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を画素ごとに含んでいる。輝度成分データは、第1の画像データの例である。 When three pieces of enhanced component image data corresponding to the three color components of R, G, and B are generated, at 120 in FIG. , to generate luminance image data. The brightness image data is data representing the brightness of a plurality of pixels in the enhanced image indicated by the three pieces of 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 obtained from the three pieces of component image data that have undergone the enhancement process. The luminance Y is, for example, the weighted average of the above three components, and can be specifically calculated using the formula Y=0.299×R+0.587×G+0.114×B. The luminance image data is single-component image data composed of one type of component value (a value indicating luminance). The luminance component data includes luminance Y for each pixel based on the values (RGB values) of corresponding pixels in the scan data. Luminance component data is an example of first image data.

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

S140では、CPU210は、エッジ抽出データに対して、レベル補正処理を実行して、補正処理済みのエッジ抽出データを生成する。レベル補正処理は、エッジ抽出データの画素の値が取り得る階調値の範囲(本実施例では、0~255の範囲)内の特定範囲を拡大する補正処理である。 In S140, the CPU 210 executes 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 the range of gradation values (0 to 255 in this embodiment) that the pixel values of the edge extraction data can take.

図8は、レベル補正処理のためのトーンカーブの一例を示す図である。具体的には、CPU210は、エッジ抽出データの各画素に対して、図8のトーンカーブを適用する。この結果、閾値Vb(例えば、245)以上の値は、全て最大値(255)に変換されるとともに、閾値Va(例えば、10)以下の値は、全て最小値(0)に変換される。そして、閾値Vaより大きく、かつ、閾値Vb未満の範囲は、0から255の範囲に拡大される。このように、後述するS150の二値化処理の前に、二値化閾値を含む範囲(図8の閾値Vaより大きく、かつ、閾値Vb未満の範囲)を拡大するので、二値化の精度を向上できる。 FIG. 8 is a diagram showing 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 equal to or higher than the threshold Vb (eg, 245) are converted to the maximum value (255), and all values equal to or lower than the threshold Va (eg, 10) are converted to the minimum value (0). Then, the range greater than the threshold Va and less than the threshold Vb is expanded to the range from 0 to 255. In this way, since the range including the binarization threshold (the range larger than the threshold Va and less than the threshold Vb in FIG. 8) is expanded before the binarization processing of S150, which will be described later, the binarization accuracy can be improved.

S150では、CPU210は、補正処理済みのエッジ抽出データに対して、二値化処理を実行して、二値画像データを生成する。例えば、CPU210は、エッジ画像データにおいて、画素の値(すなわち、エッジ強度)が閾値(例えば、128)以上である画素を、エッジ画素に分類し、画素の値が閾値未満である画素を、非エッジ画素に分類する。二値画像データでは、上述したように、エッジ画素の値は、「1」とされ、非エッジ画素の値は、「0」とされる。 In S150, the CPU 210 executes 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 whose pixel values (that is, edge strength) are equal to or greater than a threshold (for example, 128) as edge pixels, and classifies pixels whose pixel values are less than the threshold as non-edge pixels. Classify as an edge pixel. In binary image data, as described above, edge pixels have a value of "1" and non-edge pixels have a value of "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 It is possible to reduce halftone dot features that appear in the image. Furthermore, as described with reference to FIG. 7, by executing edge enhancement processing on each of the plurality of pieces of smoothed component image data, the scan image SI smoothed by the smoothing processing edges can be properly emphasized. As a result, it is possible to appropriately identify edge pixels in the scan image SI while suppressing the identification of edge pixels caused by halftone dots.

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

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

さらに、図6のエッジ強調処理では、スキャン画像SI内の複数個の画素のうち、対応する差分ΔVが基準以上である画素については、アンシャープマスク処理の対象とされ、該差分ΔVが基準未満である画素については、アンシャープマスク処理の対象とされない(S230、240)。この結果、図7を参照して説明したように、スキャン画像SIの網点に起因する画素間の値の差が強調されることをさらに抑制できるので、網点に起因するエッジ画素の特定をさらに抑制できる。そして、文字などのオブジェクトのエッジについては適切に強調できる。したがって、スキャン画像SI内のエッジ画素をさらに適切に特定できる。 Further, in the edge enhancement process of FIG. 6, among a plurality of pixels in the scanned image SI, pixels with a corresponding difference ΔV 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 difference in value between pixels caused by halftone dots in the scan image SI, so that it is possible to specify edge pixels caused by halftone dots. can be suppressed further. Edges of objects such as characters can be appropriately emphasized. Therefore, edge pixels in the scan image SI can be more appropriately identified.

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 of S24 in FIG. 2 will be described. FIG. 9 is a flowchart of the second binary image data generation process. At S300, CPU 210 generates minimum component data using the scan data. Specifically, the CPU 210 obtains the minimum component value Vmin from each of the plurality of pixel values (RGB values) included in the scan data. The minimum component value Vmin is the minimum value among a plurality of component values (R value, G value, B value) included in the RGB values. 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 representing an image of the same size as the scanned image SI. Each of the plurality of pixel values included in the minimum component data is the minimum component value Vmin of the corresponding pixel values (RGB values) 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 maximum component value of scan data. FIGS. 10A to 10E show bar graphs of RGB values of cyan (C), magenta (M), yellow (Y), black (K), and white (W) as examples of RGB values. is illustrated. As shown in FIG. 10, the RGB values (R, G, B) of C, M, Y, K, and W are (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)を除いて同じ値となる。 The luminance Y of these RGB values can be calculated using, for example, the formula Y=0.299*R+0.587*G+0.114*B, as described above. The luminances of C, M, Y, K, and W (represented by values from 0 to 255) are approximately 186, 113, 226, 0, and 255, which 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, which are the same 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 showing an example of an image used for image processing. FIG. 11A is an enlarged view of the above halftone dot area in the scanned image SI. For example, in the example of FIG. 11A, the halftone dot area in the scanned 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 the image showing the M dots MD is a uniform image having the primary color of magenta, and the image showing the Y dots YD is a uniform image having the primary color of yellow.

図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 scanned image SI of FIG. 11(A). In the minimum component image MNI, the values of the pixels in the area MDb corresponding to the Y dots MD of the scan image SI are the same as the values of the pixels in the area YDb corresponding to the Y dots YD. FIG. 11C shows, as a comparative example, a luminance image YI represented by luminance image data indicating the luminance of each pixel. This luminance image YI corresponds to the scanned image SI in FIG. 11(A). In the luminance image YI, unlike the minimum component image MNI, the values of the pixels in the area MDd corresponding to the M dots MD of the scan image SI are different from the values of the pixels in the area YDd corresponding to the Y dots YD. .

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

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

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

S330では、CPU210は、エッジ抽出データに対して、レベル補正処理を実行して、補正処理済みのエッジ抽出データを生成する。レベル補正処理は、図5のS140の処理と同一である。S340では、CPU210は、補正処理済みのエッジ抽出データに対して、図5のS150の処理と同様の二値化処理を実行して、二値画像データを生成する。二値画像データでは、上述したように、エッジ画素の値は、「1」とされ、非エッジ画素の値は、「0」とされる。 In S330, the CPU 210 executes 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 executes the same binarization process as the process of S150 in FIG. 5 on the corrected edge extraction data to generate binary image data. In binary image data, as described above, edge pixels have a value of "1" and non-edge pixels have a value of "0".

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

より具体的に説明すると、網点領域を構成する要素は、C、M、Y、Kの各ドットと、用紙の地色(白)と、の5種類である。最小成分データでは、これらの要素のうち、4種類の要素を示す画素の間の値の差を抑制できる。この結果、最小成分データを用いる場合には、網点のエッジを示すエッジ画素が特定されることを抑制することができる。 More specifically, the elements that make up the halftone dot area are five types of C, M, Y, and K dots, and the ground color (white) of the paper. In the minimum component data, it is possible to suppress the difference in value between pixels representing four types of these elements. As a result, when using the minimum component data, it is possible to suppress the edge pixels 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, it is often the case that one of the character color and the background color has a dark color and the other has a light color. For this reason, if one of the characters and the background contains a relatively large portion indicating the ground color (white) of the paper, and the other contains a relatively large portion indicating the dots of C, M, Y, and K. There are many. As shown in FIG. 10, in the minimum component data, between the pixel values of the portion indicating the C, M, Y, and K dots and the pixel value of the portion indicating the background 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 forming the edge of the character can be appropriately specified. In particular, yellow (Y) has a lower density (higher brightness) than C, M, and K. For this reason, when there is a yellow character on the background of the background color (white) of the paper, even if the brightness image data is binarized, the edge pixels forming the edge of the yellow character can be appropriately specified. Sometimes you can't. In this embodiment, even in such a case, it is possible to appropriately specify the edge pixels forming the edge of the yellow character. For this reason, in addition to identifying edge pixels using luminance image data, edge pixels are identified using minimum component data, thereby identifying edge pixels such as characters that cannot be identified using luminance image data alone. obtain. As a result, the accuracy of specifying edge pixels in the scanned image SI can be improved.

さらに、最小成分データに対して、エッジ抽出処理の前に平滑化処理が実行される(S310)。この結果、平滑化処理によって、最小成分画像MNI内の網点領域おいて、画素間の値の差を、さらに抑制できる。例えば、スキャン画像SI内の網点領域において、C、M、Y、Kのドットの重なりや、読取実行部290での読取時のぼけなどによって、ドットを示す部分は、必ずしもC、M、Y、Kの原色を有している訳ではない。このために、最小成分画像MNI内では、C、M、Y、Kの各ドットを示す複数個の画素の間の値が、小さくなってはいるものの、ゼロではない。平滑化処理によって、該画素の間の値の差をさらに小さくすることができる。この結果、網点に起因するエッジ画素が特定されることを、さらに抑制できる。また、第2の二値画像データ生成処理においても、第1の二値画像データ生成処理と同様に、レベル補正処理(S330)が実行されるので、スキャン画像SI内のエッジ画素の特定精度を向上できる。 Furthermore, smoothing processing is performed on the minimum component data before edge extraction processing (S310). As a result, the smoothing process can further suppress the difference in value between pixels in the halftone dot area in the minimum component image MNI. For example, in the halftone dot area in the scanned image SI, the portion indicating the dot may not always be C, M, Y due to overlapping of C, M, Y, K dots, blurring during reading by the reading execution unit 290, or the like. , K primaries. For this reason, in the minimum component image MNI, the values between the plurality of pixels representing each dot of C, M, Y and K are small but not zero. A smoothing process can further reduce the difference in values between the pixels. As a result, the identification of edge pixels caused by halftone dots can be further suppressed. 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 accuracy of specifying the edge pixels in the scan image SI can be improved. can improve.

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

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

A-6:ブロック判定処理
図2のS28のブロック判定処理について説明する。図12、図13は、第1実施例のブロック判定処理のフローチャートである。図14は、スキャン画像SI上に配置される複数個のブロックBLの説明図である。ブロック判定処理は、上述したように、スキャンデータを用いて、スキャン画像SI内に配置される複数個のブロックBLのそれぞれが、文字ブロックであるか否かを判断することによって、ブロック判定データを生成する処理である。
A-6: Block Determination Processing The block determination processing of S28 in FIG. 2 will be described. 12 and 13 are flow charts of block determination processing of the first embodiment. FIG. 14 is an explanatory diagram of a plurality of blocks BL arranged on the scan image SI. As described above, the block determination process uses scan data to determine whether or not each of the plurality of blocks BL arranged in the scan image SI is a character block. This is the process to generate.

S400では、CPU210は、ブロック判定データを生成するためのキャンバスデータをメモリ(具体的には、揮発性記憶装置220のバッファ領域)に準備する。キャンバスデータによって示されるキャンバス(初期画像)は、スキャン画像SIと同じサイズの画像、すなわち、同じ画素数の画像である。キャンバスデータの各画素の値は、所定の初期値(例えば、0)である。 In S400, the CPU 210 prepares canvas data for generating block determination data in the memory (specifically, the 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 scanned image SI, that is, an image having the same number of pixels. The value of each pixel of canvas data is a predetermined initial value (eg, 0).

S402では、CPU210は、スキャン画像SI上に複数個のブロックBLを設定する。例えば、図14に示すように、スキャン画像SIは、マトリクス状に配置された縦P行×横Q列のブロックBLに分割される(P、Qは2以上の整数)。1個のブロックBLは、縦m×横n個の(m×n)個の画素を含む矩形の領域である(m、nは2以上の整数)。例えば、m、nは、それぞれ、20である。 In S402, the CPU 210 sets a plurality of blocks BL on the scanned image SI. For example, as shown in FIG. 14, the scan image SI is divided into blocks BL of P rows×Q columns arranged in a matrix (P and Q are integers of 2 or more). One block BL is a rectangular area containing m×n pixels (m and n are integers equal to or greater than 2). For example, m and n are each 20.

S404では、CPU210は、スキャン画像SIにおいて設定された複数個のブロックBLから、1個の注目ブロックを選択する。 At S404, the CPU 210 selects one target block from a plurality of blocks BL set in the scan image SI.

S405では、CPU210は、公知の変換式を用いて、注目ブロックの各画素のRGB値をHSV表色系の色値(HSV値とも呼ぶ)に変換する。各HSV値は、3個の成分値、すなわち、色相を示すH値と、彩度を示すS値と、明度を示すV値と、を含む。H値は、0度~360度の範囲の値を取る。S値は、0%~100%の範囲の値を取り、0%は無彩色を示す。V値は、0%~100%の値を取り、0%は黒、100%は白を示す。 In S405, the CPU 210 converts the RGB values of each pixel of the block of interest into color values of the HSV color system (also referred to as HSV values) using a known conversion formula. Each HSV value includes three component values: an H value that indicates hue, an S value that indicates saturation, and a V value that indicates brightness. The H value ranges from 0 degrees to 360 degrees. The S value ranges from 0% to 100%, with 0% indicating achromatic color. The V value ranges from 0% to 100%, with 0% indicating black and 100% indicating white.

S407では、CPU210は、注目ブロック内の各画素を8個の基本色のいずれかに分類する。8個の基本色は、K、C、M、Y、R、G、B、Wの8色である。例えば、S値が所定の基準値(例えば、20%)未満であり、かつ、V値が50%未満の画素は、Kの画素に分類される。S値が所定の基準値未満であり、かつ、V値が50%以上の画素は、Wの画素に分類される。S値が所定の基準値以上である画素は、H値(色相)に応じて、有彩色であるC、M、Y、R、G、Bのいずれかに分類される。C、M、Y、R、G、Bに対応するH値の範囲は、予め定められている。 In S407, the CPU 210 classifies each pixel in the block of interest into one of eight basic colors. The eight basic colors are K, C, M, Y, R, G, B, and W. For example, pixels whose S value is less than a predetermined reference value (eg, 20%) and whose V value is less than 50% are classified as K pixels. A pixel whose S value is less than a predetermined reference value and whose V value is 50% or more is classified as a W pixel. A pixel having an S value equal to or greater than a predetermined reference value is classified into one of C, M, Y, R, G, and B, which are chromatic colors, according to the H value (hue). The ranges of H values corresponding to C, M, Y, R, G, and B are predetermined.

S410では、CPU210は、注目ブロックの最頻色を、注目ブロックの代表色(ブロック色とも呼ぶ)に決定する。注目ブロックの最頻色は、8個の基本色のうち、S407にて最も多数の画素が分類された色である。本実施例では、スキャン画像SIの背景Bg1の色として、スキャンされた用紙の色である白(W)が想定されている。このために、背景Bg1を主に含むブロックBLのブロック色は、Wに決定され、背景Bg1とは異なるオブジェクトを主に含むブロックBLの代表色は、そのオブジェクトの色に応じて、C、M、Y、K、R、G、Bのいずれかに決定される。 In S410, the CPU 210 determines the most frequent color of the block of interest as the representative color (also called block color) of the block of interest. The most frequent color of the block of interest is the color for which the largest number of pixels are classified in S407 among the eight basic colors. In this embodiment, white (W), which is the color of the scanned paper, is assumed as the color of the background Bg1 of the scanned image SI. For this reason, the block color of the block BL that mainly includes the background Bg1 is determined to be W, and the representative color of the block BL that mainly includes an object different from the background Bg1 is C or M depending on the color of the object. , Y, K, R, G, or B.

S415では、CPU210は、スキャン画像SI内の全てのブロックBLを注目ブロックとして処理したか否かを判断する。未処理のブロックBLがある場合には(S415:NO)、CPU210は、S404に処理を戻す。全てのブロックBLが処理された場合には(S415:YES)、CPU210は、S420に処理を進める。 In S415, the CPU 210 determines whether or not all blocks BL in the scan image SI have been processed as target blocks. If there is an unprocessed block BL (S415: NO), the CPU 210 returns the process to S404. If all blocks BL have been processed (S415: YES), the CPU 210 advances the process to S420.

S420では、CPU210は、横方向(図14の第1方向D1)のカラーランレングス情報RLcを生成する。カラーランレングス情報RLcは、第1方向D1に沿って、背景色(本実施例ではW)を代表色とするブロックBL(背景ブロックとも呼ぶ)が連続する個数(連続数とも呼ぶ)と、背景色とは異なる色(本実際例では、C、M、Y、K、R、G、B)を代表色とするブロックBL(非背景ブロックとも呼ぶ)の連続数と、が記録された情報である。カラーランレングス情報RLcは、図14のスキャン画像SIの左端から右端まで伸びる1行分のブロック群(例えば、図14のブロック群BG1)ごとに生成される。本実施例では、スキャン画像SIに縦P行×横Q列のブロックBLが配置されるので、1行分のブロック群は、Q個のブロックBLを含む。そして、P行のブロック群に対応するP個のカラーランレングス情報RLcが生成される。 In S420, CPU 210 generates color run length information RLc in the horizontal direction (first direction D1 in FIG. 14). The color run-length information RLc includes the number of consecutive blocks BL (also called background blocks) whose representative color is the background color (W in this embodiment) along the first direction D1, and the number of consecutive blocks BL. The number of consecutive blocks BL (also referred to as non-background blocks) whose representative colors are different colors (C, M, Y, K, R, G, and B in this actual example), and the recorded information. be. The color run-length information RLc is generated for each row of block groups (for example, block group BG1 in FIG. 14) extending from the left end to the right end of the scan image SI in FIG. In this embodiment, blocks BL of P rows×Q columns are arranged in the scanned image SI, so that one row of blocks BL includes Q blocks BL. Then, P pieces of color run length information RLc corresponding to the block group of P rows are generated.

図15は、ランレングス情報の説明図である。図15(A)には、1行分のブロック群BGcの一例が示されている。各ブロックBL内のアルファベットは、そのブロックBLの代表色を示す。図15(A)にて、ハッチングされたブロックは非背景ブロックであり、ハッチングされていないブロックは、背景ブロックである。図15(B)には、カラーランレングス情報RLcの一例が示されている。カラーランレングス情報RLcは、5個の連続数情報Lc1~Lc5を含んでいる。これらの連続数情報Lc1~Lc5は、それぞれ、図15(A)のブロック群BGcのうち、4個の連続する背景ブロックA1、5個の連続する非背景ブロックA2、2個の連続する背景ブロックA3、3個の連続する非背景ブロック群A4、3個の連続する背景ブロックA5に対応している。 FIG. 15 is an explanatory diagram of run length information. FIG. 15A shows an example of block group BGc for one row. The alphabet in each block BL indicates the representative color of that block BL. In FIG. 15A, hatched blocks are non-background blocks, and non-hatched blocks are background blocks. FIG. 15B shows an example of color run length information RLc. The color run length information RLc includes five consecutive number information Lc1 to Lc5. These consecutive number information Lc1 to Lc5 are, respectively, four consecutive background blocks A1, five consecutive non-background blocks A2, and two consecutive background blocks in the block group BGc in FIG. A3 corresponds to a group of three consecutive non-background blocks A4 and three consecutive background blocks A5.

S430では、CPU210は、注目非背景ブロックを選択する。具体的には、カラーランレングス情報RLcを参照して、スキャン画像SIに配置された複数個のブロックBLの中から、第1方向D1に連続する1組の非背景ブロックを、注目非背景ブロックとして選択される。例えば、図14の例では、スキャン画像SI内の文字TX1、TX2の一部に対応する非背景ブロックAa、Abと、横線LNに対応する非背景ブロックAcと、文字TX1、TX2より大きな文字BTの一部に対応する非背景ブロックAdと、写真PCの一部に対応する非背景ブロックAeと、が例示されている。これらの非背景ブロックが、注目非背景ブロックとして一組ずつ選択される。 At S430, the CPU 210 selects a non-background block of interest. Specifically, with reference to the color run-length information RLc, a set of non-background blocks continuous in the first direction D1 is selected from among the plurality of blocks BL arranged in the scan image SI as a non-background block of interest. is selected as For example, in the example of FIG. 14, the non-background blocks Aa and Ab corresponding to parts of the characters TX1 and TX2 in the scan image SI, the non-background block Ac corresponding to the horizontal line LN, and the characters BT larger than the characters TX1 and TX2 and a non-background block Ae corresponding to part of the photo PC. These non-background blocks are selected one by one as non-background blocks of interest.

S435は、CPU210は、カラーランレングス情報RLcを参照して、注目非背景ブロックの連続数は、閾値TH1未満であるか否かを判断する。一般的に、小さな文字は、背景上に配置される細線で構成されることが多いために、小さな文字が配置された文字領域では、背景色を有する領域と非背景色(文字色)を有する領域とが短い間隔で繰り返される場合が多い。これに対して、写真などが配置された網点領域は、比較的大きな矩形の領域であり、該領域の全体、もしくは、ほとんどの部分が非背景色(写真内の様々な色)を有する。このために、文字に対応する非背景ブロックの連続数は、網点領域に対応する非背景ブロックの連続数と比較して小さくなる。閾値TH1は、例えば、小さな文字が配置された文字領域と、写真などが配置された網点領域と、を判別できるように、サンプル画像を用いて予め実験的に決定される。 In S435, the CPU 210 refers to the color run length information RLc to determine whether or not the number of consecutive non-background blocks of interest is less than the threshold TH1. In general, small characters are often composed of thin lines placed on the background, so a character area in which small characters are placed has an area with a background color and a non-background color (character color). region is repeated at short intervals in many cases. On the other hand, a halftone dot area in which a photograph or the like is arranged is a relatively large rectangular area, and the whole or most of the area has non-background colors (various colors in the photograph). For this reason, the number of consecutive non-background blocks corresponding to characters is smaller than the number of consecutive non-background blocks corresponding to halftone dot areas. The threshold TH1 is experimentally determined in advance using a sample image so that, for example, a character area in which small characters are arranged and a halftone dot area in which a photograph or the like is arranged can be discriminated.

注目非背景ブロックの連続数が閾値TH1未満である場合には(S435:YES)、S445にて、CPU210は、注目非背景ブロックを、文字ブロックに決定する。注目非背景ブロックの連続数が閾値TH1以上である場合には(S435:NO)、S450にて、CPU210は、注目非背景ブロックを、網点ブロックの候補である網点候補ブロックに決定する。 If the number of consecutive non-background blocks of interest is less than the threshold TH1 (S435: YES), in S445 the CPU 210 determines the non-background block of interest to be a character block. If the number of consecutive non-background blocks of interest is equal to or greater than the threshold TH1 (S435: NO), in S450, the CPU 210 determines the non-background blocks of interest as halftone dot candidate blocks that are candidates for halftone dot blocks.

S455では、CPU210は、スキャン画像SI内の全ての非背景ブロックを注目ブロックとして処理したか否かを判断する。未処理の非背景ブロックがある場合には(S455:NO)、CPU210は、S430に処理を戻す。全ての非背景ブロックが処理された場合には(S455:YES)、CPU210は、S460に処理を進める。 In S455, the CPU 210 determines whether or not all non-background blocks in the scan image SI have been processed as blocks of interest. If there is an unprocessed non-background block (S455: NO), the CPU 210 returns the process to S430. If all non-background blocks have been processed (S455: YES), the CPU 210 advances the process to S460.

S460の時点で、スキャン画像SI内の複数個のブロックBLは、背景ブロックと、文字ブロックと、網点候補ブロックと、のいずれかに分類されている。図16は、スキャン画像SI上に特定される各種のブロックの説明図である。図16の例では、スキャン画像SI内の文字TX1、TX2に対応する複数個のブロックBA1、BA2は、文字ブロックに分類される。横線LNに対応する複数個のブロックBA3と、大きな文字BTに対応する複数個のブロックBA4と、写真PCに対応する複数個のブロックBA5は、網点候補ブロックに分類される。これらのブロックBA1~BA5とは異なるブロックBLは、背景ブロックに分類される。 At the time of S460, the plurality of blocks BL in the scan image SI are classified into any of background blocks, character blocks, and halftone dot candidate blocks. FIG. 16 is an explanatory diagram of various blocks specified on the scan image SI. In the example of FIG. 16, a plurality of blocks BA1 and BA2 corresponding to characters TX1 and TX2 in the scanned image SI are classified as character blocks. A plurality of blocks BA3 corresponding to horizontal lines LN, a plurality of blocks BA4 corresponding to large characters BT, and a plurality of blocks BA5 corresponding to photographs PC are classified as halftone dot candidate blocks. Blocks BL different from these blocks BA1 to BA5 are classified as background blocks.

ここで、横線LNは、文字と同様にエッジが強調された方が見栄えが向上する。また、大きな文字BTは、文字であるのでエッジが強調された方が見栄えが向上する。このために、本来は、横線LNや大きな文字BTに対応するブロックBLは、文字ブロックとして特定されることが好ましく、網点候補ブロックとして特定されることは好ましくない。この段階では、横線LNや大きな文字BTに対応するブロックBLは、網点候補ブロックとして特定されているので、これらのブロックBLを文字ブロックとして特定するように、特定結果を修正することが好ましい。そこで、本実施例では、以下に説明する図13のS460~S515が実行される。 Here, the appearance of the horizontal line LN is improved when the edges are emphasized in the same manner as the characters. Also, since the large character BT is a character, the appearance is improved when the edge is emphasized. For this reason, originally, blocks BL corresponding to horizontal lines LN and large characters BT should preferably be specified as character blocks, and should not be specified as halftone dot candidate blocks. At this stage, blocks BL corresponding to horizontal lines LN and large characters BT are identified as halftone dot candidate blocks, so it is preferable to correct the identification result so as to identify these blocks BL as character blocks. Therefore, in this embodiment, S460 to S515 in FIG. 13, which will be described below, are executed.

S460では、CPU210は、網点候補ブロックに対してラベリングを実行して、1以上の連続する網点候補ブロックから成る網点候補領域を特定する。ラベリングは、第1方向D1や第2方向D2に連続する1以上の網点候補ブロックで構成される連続な1つの領域に、1つの識別子を割り当て、網点候補ブロックで構成される互いに離れた領域に、互いに異なる識別子を割り当てる処理である。図16の例では、上述した複数個のブロックBA3と、複数個のブロックBA4と、複数個のブロックBA5と、に対応する3個の網点候補領域が特定される。 At S460, the CPU 210 labels the halftone dot candidate blocks to identify a halftone dot candidate area consisting of one or more consecutive halftone dot candidate blocks. Labeling is performed by assigning one identifier to one continuous region composed of one or more halftone dot candidate blocks continuous in the first direction D1 or the second direction D2, This is a process of assigning different identifiers to areas. In the example of FIG. 16, three halftone dot candidate areas are specified corresponding to the plurality of blocks BA3, the plurality of blocks BA4, and the plurality of blocks BA5.

S465では、CPU210は、S460にて特定された1以上の網点候補領域から1個の注目網点候補領域を選択する。 At S465, the CPU 210 selects one halftone dot candidate area of interest from the one or more halftone dot candidate areas specified at S460.

S470では、CPU210は、注目網点候補領域を構成する各ブロックBLを、エッジブロックと、非エッジブロックと、のいずれかに分類する。具体的には、CPU210は、図2のS22の第1の二値画像データ生成処理(図5)にて生成された第1の二値画像データを参照して、各ブロックBLに含まれる第1のエッジ画素の個数をカウントする。CPU210は、第1のエッジ画素の個数が所定の閾値THe以上であるブロックBLをエッジブロックに分類し、第1のエッジ画素の個数が所定の閾値THe未満であるブロックBLを非エッジブロックに分類する。変形例では、図2のS24の第2の二値画像データ生成処理(図9)にて生成された第2の二値画像データを参照して、第2のエッジ画素の個数に基づいて、エッジブロックと非エッジブロックとに分類しても良い。第1のエッジ画素、第2のエッジ画素は、いずれも文字候補画素の一部である。あるいは、図2のS26の論理和合成処理にて生成されたエッジ特定データを参照して、エッジ画素(文字候補画素)の個数に基づいて、エッジブロックと非エッジブロックとに分類しても良い。 At S470, the CPU 210 classifies each block BL forming the target halftone dot candidate area into either an edge block or a non-edge block. Specifically, the CPU 210 refers to the first binary image data generated in the first binary image data generation process (FIG. 5) of S22 of FIG. Count the number of 1 edge pixels. The CPU 210 classifies blocks BL whose number of first edge pixels is equal to or greater than a predetermined threshold value THe as edge blocks, and classifies blocks BL whose number of first edge pixels is less than a predetermined threshold value THe as non-edge blocks. do. In the modified example, referring to the second binary image data generated in the second binary image data generation process (FIG. 9) in S24 of FIG. 2, based on the number of second edge pixels, They may be classified into edge blocks and non-edge blocks. Both the first edge pixel and the second edge pixel are part of the character candidate pixels. Alternatively, the edge identification data generated by the logical sum synthesis processing of S26 in FIG. 2 may be referred to and classified into edge blocks and non-edge blocks based on the number of edge pixels (character candidate pixels). .

図16において、網点候補領域となる複数個のブロックBA3~BA5において、クロスハッチングが付されたブロックBLは、エッジブロックであり、クロスハッチングが付されていないブロックBLは、非エッジブロックである。例えば、横線LNに対応する網点候補領域(複数個のブロックBA3)では、全てのブロックBLがエッジブロックに分類されている。大きな文字BTに対応する網点候補領域(複数個のブロックBA4)では、大きな文字BTの外縁に対応するブロックBLだけがエッジブロックに分類されている。写真PCに対応する網点候補領域(複数個のブロックBA5)では、外縁に対応するブロックBLと、内部の一部のブロックBLと、がエッジブロックに分類されている。写真PCの内部は、一般的に、滑らかな部分とエッジが存在する部分とが分散して混在している。このために、写真PCに対応する網点候補領域では、写真PCの内部にエッジブロックと非エッジブロックとが分散して混在している。 In FIG. 16, among a plurality of blocks BA3 to BA5 that are halftone dot candidate areas, cross-hatched blocks BL are edge blocks, and cross-hatched blocks BL are non-edge blocks. . For example, in the halftone dot candidate area (a plurality of blocks BA3) corresponding to the horizontal line LN, all blocks BL are classified as edge blocks. In the halftone dot candidate area (a plurality of blocks BA4) corresponding to the large character BT, only the blocks BL corresponding to the outer edge of the large character BT are classified as edge blocks. In the halftone dot candidate area (a plurality of blocks BA5) corresponding to the photograph PC, the block BL corresponding to the outer edge and some blocks BL inside are classified as edge blocks. The interior of the photo PC generally contains a mixture of smooth portions and edged portions. For this reason, in the halftone dot candidate area corresponding to the photo PC, edge blocks and non-edge blocks are scattered and mixed inside the photo PC.

S475では、CPU210は、注目網点候補領域について横方向(図16の第1方向D1)のエッジランレングス情報RLeを生成する。横方向のエッジランレングス情報RLeは、第1方向D1に沿って、エッジブロックが連続する個数(連続数とも呼ぶ)と、非エッジブロックの連続数と、が記録された情報である。横方向のエッジランレングス情報RLeは、注目網点候補領域(例えば、図16の複数個のブロックBA5から成る領域)について、左端から右端まで伸びる1行分のブロック群(例えば、図16のブロック群BG2)ごとに生成される。例えば、注目網点候補領域がK行分(Kは1以上の整数)のブロック群を含む場合には、K行のブロック群に対応するK個の横方向のエッジランレングス情報RLeが生成される。 At S475, the CPU 210 generates edge run length information RLe in the horizontal direction (the first direction D1 in FIG. 16) for the halftone dot candidate area of interest. The horizontal edge run-length information RLe is information in which the number of consecutive edge blocks (also referred to as the consecutive number) and the number of consecutive non-edge blocks along the first direction D1 are recorded. The horizontal edge run-length information RLe is a block group for one row extending from the left end to the right end (for example, the block generated for each group BG2). For example, if the halftone dot candidate area of interest includes a group of blocks of K rows (K is an integer equal to or greater than 1), then K pieces of horizontal edge run length information RLe corresponding to the group of blocks of K rows are generated. be.

図15(C)には、網点候補領域の1行分のブロック群BGeの一例が示されている。ブロック群BGeにおいて、「E」が付されたブロックBLは、エッジブロックであり、空欄のブロックBLは、非エッジブロックである。図15(D)には、エッジランレングス情報RLeの一例が示されている。エッジランレングス情報RLeは、6個の連続数情報Le1~Lc6を含んでいる。これらの連続数情報Le1~Lc6は、それぞれ、図15(C)のブロック群BGeのうち、1個のエッジブロックB1、3個の連続する非エッジブロックB2、1個のエッジブロックB3、2個の連続する非エッジブロックB4、2個の連続するエッジブロックB5、2個の連続する非エッジブロックB6に対応している。 FIG. 15C shows an example of a block group BGe for one line of the halftone dot candidate area. In the block group BGe, blocks BL marked with "E" are edge blocks, and blank blocks BL are non-edge blocks. FIG. 15D shows an example of the edge run length information RLe. The edge run length information RLe includes six consecutive number information Le1 to Lc6. These consecutive number information Le1 to Lc6 are respectively one edge block B1, three consecutive non-edge blocks B2, one edge block B3, and two consecutive non-edge blocks B3 in the block group BGe of FIG. 15(C). consecutive non-edge blocks B4, two consecutive edge blocks B5, and two consecutive non-edge blocks B6.

S480では、CPU210は、注目網点候補領域について縦方向(図16の第2方向D2)のエッジランレングス情報RLeを生成する。縦方向のエッジランレングス情報RLeは、第2方向D2に沿って、エッジブロックの連続数と、非エッジブロックの連続数と、が記録された情報である。縦方向のエッジランレングス情報RLeは、注目網点候補領域(例えば、図16の複数個のブロックBA5から成る領域)について、上端から下端まで伸びる1列分のブロック群(例えば、図16のブロック群BG3)ごとに生成される。例えば、注目網点候補領域がL列分(Lは1以上の整数)のブロック群を含む場合には、L列のブロック群に対応するL個の縦方向のエッジランレングス情報RLeが生成される。 In S480, the CPU 210 generates edge run length information RLe in the vertical direction (the second direction D2 in FIG. 16) for the halftone dot candidate area of interest. The vertical edge run-length information RLe is information in which the number of consecutive edge blocks and the number of consecutive non-edge blocks are recorded along the second direction D2. The vertical edge run-length information RLe is a block group for one column extending from the top end to the bottom end of the halftone dot candidate area of interest (for example, the area consisting of a plurality of blocks BA5 in FIG. It is generated for each group BG3). For example, if the halftone dot candidate area of interest includes L columns of blocks (L is an integer equal to or greater than 1), L pieces of vertical edge run length information RLe corresponding to the L columns of blocks are generated. be.

S485では、CPU210は、注目網点候補領域における非エッジブロックの最大連続数Vmxを特定する。具体的には、横方向および縦方向のエッジランレングス情報RLeを参照して、非エッジブロックの横方向および縦方向の連続数のうちの最大値が、最大連続数Vmxとして特定される。 In S485, the CPU 210 specifies the maximum consecutive number Vmx of non-edge blocks in the halftone dot candidate area of interest. Specifically, horizontal and vertical edge run-length information RLe is referred to, and the maximum number of horizontal and vertical continuations of non-edge blocks is specified as maximum continuation number Vmx.

S490では、CPU210は、注目網点候補領域におけるエッジブロックが占める割合Erを算出する。割合Erは、注目網点候補領域におけるエッジブロックの個数を、注目網点候補領域の総ブロック数で除した値である。 In S490, the CPU 210 calculates the ratio Er of edge blocks in the halftone dot candidate area of interest. The ratio Er is a value obtained by dividing the number of edge blocks in the halftone dot candidate area of interest by the total number of blocks in the halftone dot candidate area of interest.

S495では、CPU210は、エッジブロックが占める割合Erが、所定の閾値TH2以上であるか否かを判断する。横線LN(図16)などの線(例えば、横線や縦線や斜めの線)に対応する網点候補領域では、ほとんどのブロックがエッジブロックに分類されると考えられる。このために、線に対応する網点候補領域では、エッジブロックが占める割合Erが、写真などに対応する網点候補領域と比較して高くなる。閾値TH2は、例えば、線に対応する網点候補領域と写真に対応する網点候補領域と、を判別できるように、サンプル画像を用いて予め実験的に決定される。閾値TH2は、例えば、80%である。 In S495, the CPU 210 determines whether or not the ratio Er occupied by edge blocks is greater than or equal to a predetermined threshold TH2. In halftone dot candidate regions corresponding to lines such as the horizontal line LN (FIG. 16) (for example, horizontal lines, vertical lines, and diagonal lines), most blocks are considered to be classified as edge blocks. For this reason, in halftone dot candidate areas corresponding to lines, the proportion Er occupied by edge blocks is higher than in halftone dot candidate areas corresponding to photographs and the like. The threshold TH2 is experimentally determined in advance using a sample image so that, for example, halftone dot candidate regions corresponding to lines and halftone dot candidate regions corresponding to photographs can be discriminated. The threshold TH2 is, for example, 80%.

エッジブロックが占める割合Erが所定の閾値TH2以上である場合には(S495:YES)、S505にて、CPU210は、注目網点候補領域を構成する全てのブロックBLを、文字ブロックに決定する。これによって、線に対応するブロックBL(例えば、図16の複数個のブロックBA3)は、最終的に、文字ブロックとして特定される。エッジブロックが占める割合Erが所定の閾値TH2未満である場合には(S495:NO)、CPU210は、S500に処理を進める。 If the ratio Er of edge blocks is greater than or equal to the predetermined threshold TH2 (S495: YES), in S505 the CPU 210 determines all blocks BL forming the target halftone dot candidate area as character blocks. As a result, blocks BL corresponding to lines (for example, a plurality of blocks BA3 in FIG. 16) are finally identified as character blocks. When the ratio Er occupied by edge blocks is less than the predetermined threshold TH2 (S495: NO), the CPU 210 advances the process to S500.

S500では、CPU210は、非エッジブロックの最大連続数Vmxは、所定の閾値TH3以上であるか否かを判断する。大きな文字BTは、一般的に、ベタ塗りのオブジェクトである。このために、大きな文字BTの外縁にはエッジが存在するが、内部にはエッジはほとんど存在しない。これに対して写真PCでは、外縁だけでなく、内部にも分散してエッジが存在する。このために、大きな文字BTに対応する網点候補領域では、非エッジブロックの最大連続数Vmxが、写真などに対応する網点候補領域と比較して大きくなる。閾値TH3は、例えば、大きな文字BTに対応する網点候補領域と写真に対応する網点候補領域と、を判別できるように、サンプル画像を用いて予め実験的に決定される。 In S500, the CPU 210 determines whether or not the maximum consecutive number Vmx of non-edge blocks is greater than or equal to a predetermined threshold TH3. Large letters BT are generally solid objects. For this reason, edges exist on the outer edge of the large character BT, but few edges exist on the interior. In Photo PC, on the other hand, edges exist not only on the outer edge but also on the inside. Therefore, in halftone dot candidate areas corresponding to large characters BT, the maximum consecutive number Vmx of non-edge blocks is larger than in halftone dot candidate areas corresponding to photographs and the like. The threshold TH3 is experimentally determined in advance using a sample image so that, for example, a halftone dot candidate area corresponding to large characters BT and a halftone dot candidate area corresponding to a photograph can be discriminated.

非エッジブロックの最大連続数Vmxが所定の閾値TH3以上である場合には(S500:YES)、S505にて、CPU210は、注目網点候補領域を構成する全てのブロックBLを、文字ブロックに決定する。これによって、大きな文字BTに対応するブロックBL(例えば、図16の複数個のブロックBA4)は、最終的に、文字ブロックとして特定される。非エッジブロックの最大連続数Vmxが所定の閾値TH3未満である場合には(S500:NO)、S510にて、CPU210は、注目網点候補領域を構成する全てのブロックBLを、網点ブロックに決定する。これによって、写真PCに対応するブロックBL(例えば、図16の複数個のブロックBA5)は、最終的に、網点ブロックとして特定される。 If the maximum consecutive number Vmx of non-edge blocks is equal to or greater than the predetermined threshold TH3 (S500: YES), in S505 the CPU 210 determines all blocks BL forming the target halftone dot candidate area as character blocks. do. Blocks BL corresponding to large characters BT (for example, a plurality of blocks BA4 in FIG. 16) are finally identified as character blocks. If the maximum consecutive number Vmx of non-edge blocks is less than the predetermined threshold TH3 (S500: NO), in S510 the CPU 210 converts all blocks BL forming the target halftone dot candidate area into halftone dot blocks. decide. As a result, the blocks BL corresponding to the photograph PC (for example, the plurality of blocks BA5 in FIG. 16) are finally identified as halftone dot blocks.

S515では、CPU210は、スキャン画像SI内の全ての網点候補領域を注目網点候補領域として処理したか否かを判断する。未処理の網点候補領域がある場合には(S515:NO)、CPU210は、S465に処理を戻す。全ての網点候補領域が処理された場合には(S515:YES)、CPU210は、S520に処理を進める。 In S515, the CPU 210 determines whether or not all halftone dot candidate areas in the scan image SI have been processed as the target halftone dot candidate area. If there is an unprocessed halftone dot candidate area (S515: NO), the CPU 210 returns the process to S465. If all halftone dot candidate areas have been processed (S515: YES), the CPU 210 advances the process to S520.

S520の時点で、スキャン画像SI内の全てのブロックBLは、文字ブロックと、網点ブロックと、背景ブロックと、のいずれかに分類されている。S520では、CPU210は、文字ブロックと、非文字ブロック(網点ブロックまたは背景ブロック)と、を示す二値画像データを、ブロック判定データとして生成する。 At the time of S520, all blocks BL in the scanned image SI are classified into character blocks, halftone dot blocks, or background blocks. In S520, the CPU 210 generates binary image data indicating character blocks and non-character blocks (dotted blocks or background blocks) as block determination data.

以上説明した本実施例によれば、画像取得部としてのCPU210は、印刷物を読み取ることによって生成されるスキャンデータを対象画像データとして取得する(図2のS10)。第1の特定部としてのCPU210は、スキャンデータを用いてスキャン画像SI内の複数個の画素の中から複数個の文字候補画素を特定する(図2のS22~S26)。連続数特定部としてのCPU210は、スキャン画像SI上に配置される複数個のブロックBLのうちの非背景ブロックの連続数を特定する(図12のS420)。第2の特定部としてのCPU210は、該連続数に基づいて複数個のブロックBLから文字ブロックを特定する(図12、図13のS430~S515)。第3の特定部としてのCPU210は、文字候補画素の特定結果と、文字ブロックの特定結果と、に基づいて、スキャン画像SI内の複数個の文字画素を特定する(図2のS29)。 According to the present embodiment described above, the CPU 210 as the image acquisition unit acquires scan data generated by reading a printed matter as target image data (S10 in FIG. 2). The CPU 210 as a first specifying unit specifies a plurality of character candidate pixels out of a plurality of pixels in the scan image SI using the scan data (S22-S26 in FIG. 2). The CPU 210 as a continuation number identifying unit identifies the number of continuations of non-background blocks among the plurality of blocks BL arranged on the scan image SI (S420 in FIG. 12). The CPU 210 as a second identifying unit identifies character blocks from a plurality of blocks BL based on the number of continuations (S430 to S515 in FIGS. 12 and 13). The CPU 210 as a third identifying unit identifies a plurality of character pixels in the scan image SI based on the character candidate pixel identification result and the character block identification result (S29 in FIG. 2).

背景とは異なるオブジェクトは、文字や写真などの種類に応じて特徴の連続性が異なる。例えば、上述のように、文字を含む領域では、背景と細線とが交互に現れるため非背景ブロックの連続数は写真PCの領域よりも小さくなりやすい。本実施例によれば、非背景ブロックの連続数に基づいて文字ブロックが特定されるので、上述した特徴の連続性を考慮して適切に文字ブロックを特定できる。したがって、文字候補画素の特定結果と文字ブロックの特定結果とに基づいて、スキャン画像SI内の文字画素を精度良く特定できる。例えば、写真PC内のオブジェクトのエッジや網点のエッジを、文字画素として誤って特定する不都合を低減できる。 Objects that are different from the background have different feature continuity depending on the type, such as characters or photographs. For example, as described above, in an area containing characters, the background and thin lines appear alternately, so the number of consecutive non-background blocks tends to be smaller than in the area of the photo PC. According to this embodiment, character blocks are identified based on the number of consecutive non-background blocks, so character blocks can be appropriately identified in consideration of the continuity of the features described above. Therefore, the character pixels in the scan image SI can be accurately identified based on the character candidate pixel identification results and the character block identification results. For example, it is possible to reduce the inconvenience of erroneously identifying edges of objects and edges of halftone dots in the photo PC as character pixels.

さらに、本実施例によれば、第3の特定部としてのCPU210は、特定された複数個の文字候補画素のうち、特定された文字ブロック内に位置する画素を、文字画素として特定する(図2のS29)。この結果、複数個の文字候補画素の中から、精度良く文字画素を特定できる。 Furthermore, according to the present embodiment, the CPU 210 as the third specifying unit specifies, among the plurality of specified character candidate pixels, pixels located in the specified character block as character pixels (see FIG. 2 S29). As a result, character pixels can be specified with high accuracy from among a plurality of character candidate pixels.

さらに、本実施例によれば、各ブロックBLの特徴値としてとして、複数個のブロックの色に関する値、具体的には、各ブロックBLの代表色(8個の値(C、M、Y、K、R、G、B、W)のいずれか)が用いられる。そして、非背景ブロックは、スキャン画像SIの背景色(W)とは異なる色を有するブロックである。背景色とは異なる色を有するオブジェクトは、文字や写真などの種類に応じて色の連続性が異なる。例えば、文字を含む領域では、背景と細線とが交互に現れることに対応して、背景色とは異なる色(文字色)の領域と背景色の領域とが交互に現れる。これに対して写真PCの領域では、背景色とは異なる色の領域が連続しやすい。このために、文字を含む領域では、背景色とは異なる色を有する非背景ブロックの連続数が、写真PCの領域よりも小さくなりやすい。本実施例によれば、このような文字と写真との間の色に関する特徴の違いを利用して、精度良く文字ブロックを特定できる。 Furthermore, according to the present embodiment, as the characteristic value of each block BL, values relating to the colors of a plurality of blocks, specifically, representative colors of each block BL (eight values (C, M, Y, K, R, G, B, W)) is used. A non-background block is a block having a color different from the background color (W) of the scan image SI. An object having a color different from the background color has different color continuity depending on the type, such as a character or a photograph. For example, in an area containing characters, areas of a color different from the background color (character color) and areas of the background color alternately appear corresponding to the alternating appearance of the background and thin lines. On the other hand, in the Photo PC area, areas with a color different from the background color tend to be continuous. For this reason, the number of consecutive non-background blocks having a color different from the background color is likely to be smaller in the area containing the characters than in the area of the photo PC. According to this embodiment, character blocks can be specified with high accuracy by utilizing the difference in color characteristics between characters and photographs.

さらに、本実施例によれば、第2の特定部としてのCPU210は、連続する一組の非背景ブロックの連続数が所定の閾値TH1(第1の基準とも呼ぶ)未満である場合に(図12のS435にてYES)、該一組の非背景ブロックを文字ブロックとして特定する(図12のS445)。上述したように、文字は背景上に配置された細線で構成されるので、文字に対応する非背景ブロック(文字を構成する線に対応する)の連続数は比較的小さくなる可能性が高い。本実施例では、このような特性を利用して精度良く文字ブロックを特定できる。 Furthermore, according to the present embodiment, the CPU 210 as the second specifying unit determines (see FIG. 12, YES at S435), the pair of non-background blocks are identified as character blocks (S445 in FIG. 12). As described above, since characters are composed of thin lines arranged on the background, the number of consecutive non-background blocks corresponding to characters (corresponding to lines forming characters) is likely to be relatively small. In this embodiment, such characteristics can be used to specify character blocks with high accuracy.

本実施例によれば、第2の特定部としてのCPU210は、連続する一組の非背景ブロックの連続数が閾値TH1以上である場合に(図12のS435にてNO)、該一組の非背景ブロック(網点候補領域を構成するブロックBL)のそれぞれについて、非背景ブロックに含まれる文字候補画素(例えば、第1のエッジ画素)に関する指標値(例えば、最大連続数Vmxや割合Er)を算出し、該指標値が特定条件を満たす場合に、該一組の非背景ブロックを前記文字ブロックとして特定する(図13のS460~S515)。 According to this embodiment, when the number of continuous non-background blocks in a set of continuous non-background blocks is equal to or greater than the threshold TH1 (NO in S435 of FIG. 12), the CPU 210 as the second specifying unit For each non-background block (block BL forming a halftone dot candidate area), an index value (for example, maximum consecutive number Vmx or ratio Er) for character candidate pixels (for example, first edge pixels) included in the non-background block is calculated, and if the index value satisfies a specific condition, the set of non-background blocks is specified as the character blocks (S460 to S515 in FIG. 13).

一組の非背景ブロックの連続数が閾値TH1以上であっても、その非背景ブロックに含まれる文字候補画素に関する分布等によっては、これらのブロックBLに対応するオブジェクトは、写真PCではなく、大きな文字BTもしくは文字と同様の画像処理を施すべき線(例えば、横線LN)である可能性がある。本実施例によれば、このような場合であっても非背景ブロックに含まれる文字候補画素に関する指標値を用いて、精度良く文字ブロックを特定できる。 Even if the consecutive number of a set of non-background blocks is equal to or greater than the threshold TH1, depending on the distribution of character candidate pixels included in the non-background blocks, the object corresponding to these blocks BL may not be a photograph PC but a large It may be a character BT or a line (for example, a horizontal line LN) to which image processing similar to that of the character should be applied. According to the present embodiment, even in such a case, the character block can be specified with high accuracy using the index values for the character candidate pixels included in the non-background block.

より具体的には、第2の特定部としてのCPU210は、連続数が閾値TH1以上である一組の非背景ブロック、すなわち、網点候補領域を構成する複数個のブロックBLのそれぞれについて、閾値THe(基準個数とも呼ぶ)以上の個数の第1のエッジ画素(文字候補画素の一部である)を含むエッジブロックであるか否かを判断し(図13のS470)、一組の非背景ブロックに占めるエッジブロックの割合Erを指標値として算出する(図13のS490)。CPU210は、エッジブロックの割合Erが所定の閾値TH2(基準割合とも呼ぶ)以上である場合に(図13のS495にてYES)、一組の非背景ブロックを文字ブロックとして特定する(図13のS505)。上述のように、線に対応する非背景ブロックでは、該線のエッジに対応するエッジブロックの割合が比較的高くなる。本実施例では、このような特性を利用して、線に対応する非背景ブロックを文字ブロックとして精度良く特定することができる。 More specifically, the CPU 210 as the second specifying unit determines the threshold value for each of a set of non-background blocks whose number of continuations is equal to or greater than the threshold value TH1, that is, a plurality of blocks BL forming the halftone dot candidate region. It is determined whether the edge block includes THe (also referred to as a reference number) or more of the first edge pixels (which are part of the character candidate pixels) (S470 in FIG. 13), and a set of non-background A ratio Er of edge blocks to blocks is calculated as an index value (S490 in FIG. 13). When the ratio Er of edge blocks is equal to or greater than a predetermined threshold TH2 (also referred to as a reference ratio) (YES in S495 of FIG. 13), the CPU 210 identifies a set of non-background blocks as character blocks ( S505). As mentioned above, non-background blocks corresponding to lines have a relatively high proportion of edge blocks corresponding to edges of the line. In this embodiment, by using such characteristics, it is possible to accurately identify non-background blocks corresponding to lines as character blocks.

さらに、第2の特定部としてのCPU210は、連続数が閾値TH1以上である一組の非背景ブロック、すなわち、網点候補領域を構成する複数個のブロックBLのそれぞれについて、閾値THe未満の個数の第1のエッジ画素(文字候補画素の一部である)を含む非エッジブロックであるか否かを判断し(図13のS470)、一組の非背景ブロック(網点候補領域)において非エッジブロックが横方向または縦方向に連続する最大連続数Vmxを指標値として算出する(図13のS485)。CPU210は、最大連続数Vmxが所定の閾値TH3(第3の基準とも呼ぶ)以上である場合に(図13の500にてYES)、一組の非背景ブロックを文字ブロックとして特定する(図13のS505)。上述のように、大きな文字BTに対応する非背景ブロックでは、最大連続数Vmxが、写真PCなどに対応する非背景ブロックよりも大きくなる。本実施例では、このような特性を利用して、大きな文字BTに対応する一組の非背景ブロックを文字ブロックとして精度良く特定することができる。 Furthermore, the CPU 210 as a second specifying unit determines the number of consecutive non-background blocks equal to or greater than the threshold TH1, that is, the plurality of blocks BL constituting the halftone dot candidate region, each of which is less than the threshold THe. 13 (S470 in FIG. 13). The maximum consecutive number Vmx of consecutive edge blocks in the horizontal direction or the vertical direction is calculated as an index value (S485 in FIG. 13). CPU 210 identifies a set of non-background blocks as character blocks when the maximum consecutive number Vmx is equal to or greater than a predetermined threshold TH3 (also referred to as a third criterion) (YES at 500 in FIG. 13). S505). As described above, non-background blocks corresponding to large characters BT have a larger maximum consecutive number Vmx than non-background blocks corresponding to photographs PC and the like. In this embodiment, using such characteristics, a set of non-background blocks corresponding to the large character BT can be specified as character blocks with high accuracy.

B.第2実施例
第2実施例では、図2のS28のブロック判定処理の内容が第1実施例とは異なる。第2実施例のその他の処理および構成は、第1実施例と同一である。図17は、第2実施例のブロック判定処理のフローチャートである。図17のブロック判定処理では、図13のS460~S515の処理は実行されない。その代わりに、図17のブロック判定処理では、S435の後にS440Bの処理が追加されている。
B. Second Embodiment In the second embodiment, the contents of the block determination processing in S28 of FIG. 2 are different from those in the first embodiment. Other processing and configuration of the second embodiment are the same as those of the first embodiment. FIG. 17 is a flow chart of block determination processing of the second embodiment. In the block determination process of FIG. 17, the processes of S460 to S515 of FIG. 13 are not executed. Instead, in the block determination process of FIG. 17, the process of S440B is added after S435.

図17のブロック判定処理のS400~S420の処理は、図12のS400~S420の処理と同一である。S430では、図12のS430と同様に、CPU210は、注目非背景ブロックを選択する。S435では、図12のS435と同様に、CPU210は、カラーランレングス情報RLcを参照して、注目非背景ブロックの連続数は、閾値TH1未満であるか否かを判断する。 The processing of S400 to S420 of the block determination processing of FIG. 17 is the same as the processing of S400 to S420 of FIG. In S430, the CPU 210 selects a non-background block of interest as in S430 of FIG. In S435, as in S435 of FIG. 12, the CPU 210 refers to the color run length information RLc to determine whether or not the number of consecutive non-background blocks of interest is less than the threshold TH1.

注目非背景ブロックの連続数が閾値TH1未満である場合には(S435:YES)、S445にて、図12のS445と同様に、CPU210は、注目非背景ブロックを、文字ブロックに決定する。注目非背景ブロックの連続数が閾値TH1以上である場合には(S435:NO)、S440Bにて、CPU210は、注目非背景ブロックの色数は所定の閾値THc未満であるか否かを判断する。注目非背景ブロックは、閾値TH1以上の個数のブロックBLで構成されており、これらの各ブロックの代表色は、C、M、Y、K、R、G、Bのいずれかに決定されている(S410)。注目非背景ブロックを構成する閾値TH1以上の個数のブロックBLに含まれる代表色の数が色数として特定される。該色数が所定の閾値THc未満であるか否かが判断される。 If the number of consecutive non-background blocks of interest is less than the threshold TH1 (S435: YES), in S445, the CPU 210 determines the non-background block of interest to be a character block, as in S445 of FIG. If the number of consecutive non-background blocks of interest is equal to or greater than the threshold TH1 (S435: NO), in S440B the CPU 210 determines whether the number of colors of the non-background blocks of interest is less than a predetermined threshold THc. . The non-background block of interest is composed of blocks BL whose number is equal to or greater than the threshold TH1, and the representative color of each of these blocks is determined to be one of C, M, Y, K, R, G, and B. (S410). The number of representative colors included in the number of blocks BL constituting the non-background block of interest that is equal to or greater than the threshold TH1 is specified as the number of colors. It is determined whether or not the number of colors is less than a predetermined threshold THc.

一般的に、大きな文字BTや横線LNなどの線は、一色でベタ塗りされていることが多い。これに対して、写真PCは、様々な色を含むことが多い。このために、注目非背景ブロックが大きな文字BTや横線LNなどの線に対応する場合には、注目非背景色ブロックの色数は、注目非背景ブロックが写真PCに対応する場合よりも少なくなる。閾値THcは、例えば、大きな文字や線に対応する非背景ブロックと、写真などが配置された非背景ブロックと、を判別できるように、サンプル画像を用いて予め実験的に決定される。閾値THcは、例えば、1である。 In general, lines such as large letters BT and horizontal lines LN are often solidly painted in one color. Photo PCs, on the other hand, often contain a variety of colors. For this reason, when the non-background block of interest corresponds to a large character BT or a line such as a horizontal line LN, the number of colors of the non-background color block of interest is smaller than when the non-background block of interest corresponds to the photograph PC. . The threshold THc is experimentally determined in advance using a sample image so that, for example, non-background blocks corresponding to large characters and lines can be distinguished from non-background blocks in which photographs and the like are arranged. The threshold THc is 1, for example.

注目非背景ブロックの色数が所定の閾値THc未満である場合には(S440B:YES)、S445にて、CPU210は、注目非背景ブロックを構成する全てのブロックBLを、文字ブロックに決定する。これによって、線に対応するブロックBLおよび大きな文字に対応するブロックBLは、文字ブロックとして特定される。注目非背景ブロックの色数が所定の閾値THc以上である場合には(S440B:NO)、S450Bにて、CPU210は、注目非背景ブロックを構成する全てのブロックBLを、網点ブロックに決定する。これによって、写真PCに対応するブロックBLは、網点ブロックとして特定される。 When the number of colors of the target non-background block is less than the predetermined threshold value THc (S440B: YES), in S445, the CPU 210 determines all blocks BL forming the target non-background block as character blocks. Blocks BL corresponding to lines and blocks BL corresponding to large characters are thereby identified as character blocks. If the number of colors of the target non-background block is equal to or greater than the predetermined threshold value THc (S440B: NO), in S450B the CPU 210 determines all blocks BL forming the target non-background block as halftone dot blocks. . As a result, the block BL corresponding to the photo PC is identified as a halftone dot block.

S455では、CPU210は、スキャン画像SI内の全ての非背景ブロックを注目ブロックとして処理したか否かを判断する。未処理の非背景ブロックがある場合には(S455:NO)、CPU210は、S430に処理を戻す。全ての非背景ブロックが処理された場合には(S455:YES)、CPU210は、S520に処理を進める。 In S455, the CPU 210 determines whether or not all non-background blocks in the scan image SI have been processed as blocks of interest. If there is an unprocessed non-background block (S455: NO), the CPU 210 returns the process to S430. If all non-background blocks have been processed (S455: YES), the CPU 210 advances the process to S520.

S520の時点で、スキャン画像SI内の複数個のブロックBLは、背景ブロックと、文字ブロックと、網点ブロックと、のいずれかに分類されている。S520では、図13のS520と同様に、CPU210は、文字ブロックと、非文字ブロック(網点ブロックまたは背景ブロック)と、を示す二値画像データを、ブロック判定データとして生成する。 At the time of S520, the plurality of blocks BL in the scan image SI are classified into any of background blocks, character blocks, and halftone dot blocks. In S520, similarly to S520 in FIG. 13, the CPU 210 generates binary image data indicating character blocks and non-character blocks (halftone blocks or background blocks) as block determination data.

以上説明した第2実施例によれば、第2の特定部としてのCPU210は、連続する一組の非背景ブロック(注目非背景ブロック)の連続数が閾値TH1(第1の基準とも呼ぶ)以上であり(図16のS435にてNO)、かつ、一組の非背景ブロックの色数が閾値THc(第2の基準とも呼ぶ)未満である場合に(図16のS440BにてYES)、該一組の非背景ブロックを文字ブロックとして特定する(図16のS445)。 According to the second embodiment described above, the CPU 210 as the second specifying unit determines that the continuous number of a set of continuous non-background blocks (non-background blocks of interest) is equal to or greater than the threshold TH1 (also referred to as the first criterion). (NO in S435 of FIG. 16) and the number of colors of a set of non-background blocks is less than a threshold THc (also referred to as a second criterion) (YES in S440B of FIG. 16), A set of non-background blocks are identified as character blocks (S445 in FIG. 16).

一組の非背景ブロックの連続数が閾値TH1以上であっても色数が少ない場合には、これらのブロックBL内のオブジェクトは、写真ではなく、大きな文字BTもしくは文字と同様の画像処理を施すべき線(例えば、横線LN)である可能性が高い。本実施例によれば、このような色数の特性を利用して、大きな文字BTや線に対応する非背景ブロックを文字ブロックとして精度良く特定することができる。 Even if the number of consecutive non-background blocks is equal to or greater than the threshold TH1, if the number of colors is small, the object in these blocks BL is not a photograph but is subjected to large characters BT or image processing similar to characters. It is likely to be a power line (eg, horizontal line LN). According to the present embodiment, it is possible to accurately identify a non-background block corresponding to a large character BT or a line as a character block by using such a characteristic of the number of colors.

C.変形例:
(1)上記実施例では、ブロックBLの特徴値として代表色を示す値(CMYKRGBWの8値のいずれか)が採用され、代表色が白(W)であるブロックBLが背景ブロックとして特定され、代表色が白以外の色であるブロックBLが非背景ブロックとして特定される(図12のS404~S420)。これに限らず、例えば、白以外の用紙の原稿が用いられる場合には、当該用紙の色を示す特徴値(例えば、平均色値)を有するブロックBLが背景ブロックとして特定され、当該用紙の色とは異なる色を示す特徴値を有するブロックBLが非背景ブロックとして特定されても良い。
C. Variant:
(1) In the above embodiment, a value indicating a representative color (one of the 8 values of CMYKRGBW) is adopted as the feature value of the block BL, and the block BL whose representative color is white (W) is specified as a background block, A block BL whose representative color is a color other than white is specified as a non-background block (S404 to S420 in FIG. 12). Not limited to this, for example, when a document made of paper other than white is used, a block BL having a characteristic value (e.g., average color value) indicating the color of the paper is specified as a background block, and the color of the paper is specified. A block BL having a feature value indicating a color different from that may be identified as a non-background block.

また、ブロックBLの特徴値として平均明度や平均輝度や画素値のバラツキなどが採用されても良い。例えば、平均明度や平均輝度が基準以上であるブロックBLが背景ブロックとして特定され、平均明度や平均輝度が基準未満であるブロックBLが非背景ブロックとして特定されても良い。また、画素値のバラツキが基準未満であるブロックBLが背景ブロックとして特定され、画素値のバラツキが基準以上であるブロックBLが非背景ブロックとして特定されても良い。 Further, as the characteristic value of the block BL, the average lightness, the average luminance, the variation of the pixel values, etc. may be employed. For example, a block BL whose average brightness or average brightness is equal to or higher than a standard may be specified as a background block, and a block BL whose average brightness or average brightness is less than a standard may be specified as a non-background block. Alternatively, a block BL whose pixel value variation is less than a reference may be identified as a background block, and a block BL whose pixel value variation is greater than or equal to the reference may be identified as a non-background block.

(2)上記実施例では、図2のS26にて特定された複数個の文字候補画素のうち、図2のS28にて特定された文字ブロック内に位置する画素を、文字画素として特定している(図2のS29)。これに限らず、文字候補画素の特定結果と、文字ブロックの特定結果と、に基づく他の手法で、最終的に文字画素が特定されても良い。例えば、文字ブロックに含まれる文字候補画素は、文字である可能性がある比較的広い範囲の色(例えば、黒、赤、青、黄など)を有していれば、文字画素として特定され、非文字ブロックに含まれる文字候補画素は、文字である可能性が高い色(例えば、黒のみ)を有する場合に限り、文字画素として特定されても良い。 (2) In the above embodiment, among the plurality of character candidate pixels identified in S26 of FIG. 2, pixels located in the character block identified in S28 of FIG. 2 are identified as character pixels. (S29 in FIG. 2). The character pixels may be finally identified by other methods based on the character candidate pixel identification result and the character block identification result. For example, a character candidate pixel included in a character block is identified as a character pixel if it has a relatively wide range of colors that can be characters (e.g., black, red, blue, yellow, etc.), A character candidate pixel contained in a non-character block may be identified as a character pixel only if it has a color that is likely to be a character (eg, only black).

(3)上記実施例では、一組の非背景ブロックの連続数が閾値TH1未満である場合には、一組の非背景ブロックを文字ブロックとして特定している。これに代えて、例えば、設定されるブロックBLのサイズが、特定すべき文字のサイズの下限と比較して、大幅に小さい場合には、一組の非背景ブロックの連続数が、所定の下限値以上、かつ、所定の上限値未満である場合に限り、該一組の非背景ブロックを文字ブロックとして特定しても良い。 (3) In the above embodiment, when the number of consecutive non-background blocks in a set is less than the threshold TH1, the set of non-background blocks is specified as a character block. Alternatively, for example, if the size of the block BL to be set is significantly smaller than the lower limit of the character size to be specified, the number of consecutive non-background blocks set may exceed the predetermined lower limit. The set of non-background blocks may be specified as character blocks only when they are equal to or greater than the value and less than a predetermined upper limit.

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

(5)上記実施例の第2の二値画像データ生成処理(図9)では、単成分画像データとして、最小成分データが用いられる(S300)。これに代えて、最大成分データや反転最小成分データが用いられても良い。 (5) In the second binary image data generation process (FIG. 9) of the above embodiment, minimum component data is used as single component image data (S300). Alternatively, 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, each of the plurality of values being the maximum component value Vmax of the corresponding pixels 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 values of the corresponding pixel of the scan data.

反転最小成分データは、以下のように、取得される。先ず、スキャンデータに含まれる複数個の画素の値(RGB値)のそれぞれについて、複数個の成分値(R値、G値、B値)が反転された反転済みの色値が生成される。反転前のRGB値を(Rin、Gin、Bin)とすると、反転済みのRGB値(Rout、Gout、Bout)は、以下の式(1)~(3)で表される。 Inverted minimum component data is obtained as follows. First, an inverted color value is generated by inverting a plurality of component values (R value, G value, B value) for each of a plurality of pixel values (RGB values) included in scan data. Assuming that the RGB values before inversion are (Rin, Gin, Bin), the inverted RGB values (Rout, Gout, Bout) are represented 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 possible values of the R value, G value, and B value, respectively, and Rmax=Gmax=Bmax=255 in this embodiment. Image data having these inverted RGB values as the values of a plurality of pixels is generated as inverted image data. Then, using the inverted image data, inverted minimum component data is generated. Specifically, the inverted minimum component value VRmin is acquired from each of the plurality of inverted RGB values included in the inverted image data. The inverted 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 values. The inverted minimum component data is image data having these inverted minimum component values VRmin as values of a plurality of pixels.

反転最小成分値VRminは、最大成分値の反転値であり、VRmin=(255-Vmax)の関係が成り立つ。このために、最大成分データと反転最小成分データとは、両方とも、スキャンデータの各画素の値に含まれる複数個の成分値のうちの最大値に基づく値(最大値の反転値、あるいは、最大値そのもの)を、画素の値とする画像データである、と言うことができる。 The inverted minimum component value VRmin is an inverted 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 values based on the maximum value among a plurality of component values included in the value of each pixel of the scan data (the inverted value of the maximum value, or The maximum value itself) can be said to be image data having 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 except for black (K). Therefore, in the maximum component data and the inverted minimum component data, one of the five types of elements forming the halftone dot area, that is, each dot of C, M, Y, and K, and the background color of the paper (white) Differences in values between pixels representing the four types of elements (C, M, Y dots and paper ground color (white)) are suppressed. As a result, when using the maximum component data or the inverted minimum component data, it is possible to suppress the edge pixels caused by halftone dots from being identified, as in the case of using the minimum component data.

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

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

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

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

(10)上記実施例では、第1の二値画像データと、第2の二値画像データと、の論理和を取ることによって、エッジ特定データが生成される(図2のS26)。これに代えて、第1の二値画像データと、第2の二値画像データと、第3の二値画像データと、の論理和を取ることによって、エッジ特定データが生成されても良い。第3の二値画像データには、例えば、上述した最大成分データを用いて生成される二値画像データが用いられても良い。これによって、文字などのエッジの特定漏れをさらに抑制することができる。 (10) In the above embodiment, the edge identification data is generated by ORing the first binary image data and the second binary image data (S26 in FIG. 2). Alternatively, the edge identification data may be generated by ORing the first binary image data, the second binary image data, and the third binary image data. For 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 omissions in identifying edges such as characters.

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

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

(13)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。例えば、図2のS26の論理和合成処理やS29の論理積合成処理は、ASICなどの専用のハードウェアによって、実行されても良い。 (13) In each of the above embodiments, part of the configuration implemented by hardware may be replaced with software, or conversely, part or all of the configuration implemented by software may be replaced with hardware. You may do so. For example, the logical sum synthesis processing of S26 and the logical product synthesis processing of S29 of FIG. 2 may be executed by dedicated hardware such as ASIC.

以上、実施例、変形例に基づき本発明について説明してきたが、上記した発明の実施の形態は、本発明の理解を容易にするためのものであり、本発明を限定するものではない。本発明は、その趣旨並びに特許請求の範囲を逸脱することなく、変更、改良され得ると共に、本発明にはその等価物が含まれる。 Although the present invention has been described above based on examples and modifications, the above-described embodiments of the present invention are intended to facilitate understanding of the present invention, and are not intended to limit the present invention. The present invention may be modified and modified without departing from the spirit and scope of the claims, and the present invention includes equivalents thereof.

100…端末装置、200…複合機、210…CPU、220…揮発性記憶装置、230…不揮発性記憶装置、240…表示部、250…操作部、S270…通信IF、280…印刷実行部、290…読取実行部、PG…コンピュータプログラム、SI…スキャン画像、TI…文字特定画像、GI…平滑化画像、FI…処理済み画像、EI…エッジ特定画像、BI…ブロック判定画像、YI…輝度画像、BL…ブロック DESCRIPTION OF SYMBOLS 100... Terminal device, 200... MFP, 210... CPU, 220... Volatile memory device, 230... Non-volatile memory device, 240... Display part, 250... Operation part, S270... Communication IF, 280... Print execution part, 290 ... reading execution part, PG ... computer program, SI ... scanned image, TI ... character identification image, GI ... smoothed image, FI ... processed image, EI ... edge identification image, BI ... block determination image, YI ... brightness image, BL...Block

Claims (12)

画像処理装置であって、
イメージセンサを用いて印刷物を読み取ることによって生成される対象画像データを取得する画像取得部と、
前記対象画像データを用いて、前記対象画像データによって示される対象画像内の複数個の画素の中から文字画素の候補である複数個の候補画素を特定する第1の特定部であって、前記対象画像内のエッジを構成する複数個のエッジ画素を前記候補画素として特定する処理を含む、前記第1の特定部と、
前記対象画像内に複数個のブロックを配置する配置部であって、前記複数個のブロックは、背景の特徴を示す特定の特徴値を有する複数の背景ブロックと、前記特定の特徴値とは異なる特徴値を有する非背景ブロックと、を含む、前記配置部と、
前記対象画像データを用いて、前記対象画像に配置される複数個のブロックのうちの非背景ブロックが連続する個数である連続数を特定する連続数特定部と
前記連続数に基づいて前記複数個のブロックから文字ブロックを特定する第2の特定部と、
前記候補画素の特定結果と、前記文字ブロックの特定結果と、に基づいて、前記対象画像内の複数個の前記文字画素を特定する第3の特定部と、
を備える画像処理装置。
An image processing device,
an image acquisition unit that acquires target image data generated by reading printed matter using an image sensor;
A first identifying unit that uses the target image data to specify a plurality of candidate pixels that are candidates for character pixels from among a plurality of pixels in the target image indicated by the target image data , the first identification unit including a process of identifying a plurality of edge pixels forming an edge in the target image as the candidate pixels;
An arrangement unit for arranging a plurality of blocks in the target image, wherein the plurality of blocks are different from a plurality of background blocks having specific feature values indicating characteristics of the background and the specific feature values. a non-background block having feature values;
a continuation number identifying unit that identifies a continuation number, which is the number of continuations of non-background blocks among a plurality of blocks arranged in the target image, using the target image data;
a second identifying unit that identifies a character block from the plurality of blocks based on the number of continuations;
a third identifying unit that identifies the plurality of character pixels in the target image based on the result of identifying the candidate pixel and the result of identifying the character block;
An image processing device comprising:
請求項1に記載の画像処理装置であって、
前記第3の特定部は、特定された前記複数個の候補画素のうち、特定された前記文字ブロック内に位置する画素を、前記文字画素として特定する、画像処理装置。
The image processing device according to claim 1,
The image processing device, wherein the third specifying unit specifies, as the character pixel, a pixel located in the specified character block among the plurality of specified candidate pixels.
請求項1または2に記載の画像処理装置であって、
前記特定の特徴値は、前記背景のを示す値であり、
前記非背景ブロックは、前記背景の色とは異なる色を示す特徴値を有するブロックである、画像処理装置。
The image processing device according to claim 1 or 2,
The specific feature value is a value indicating the color of the background ,
The image processing device, wherein the non-background block is a block having a feature value indicating a color different from the color of the background .
請求項1~3のいずれかに記載の画像処理装置であって、
前記第2の特定部は、連続する一組の前記非背景ブロックの前記連続数が第1の基準未満である場合に、前記連続する一組の前記非背景ブロックを前記文字ブロックとして特定する、画像処理装置。
The image processing device according to any one of claims 1 to 3,
the second identifying unit identifies the set of consecutive non-background blocks as the character block when the number of consecutive sets of the non-background blocks is less than a first reference; Image processing device.
請求項1~4のいずれかに記載の画像処理装置であって、
前記第2の特定部は、
連続する一組の前記非背景ブロックの前記連続数が第1の基準以上であり、かつ、前記連続する一組の前記非背景ブロックの色数が第2の基準未満である場合に、前記連続する一組の前記非背景ブロックを前記文字ブロックとして特定する、画像処理装置。
The image processing device according to any one of claims 1 to 4,
The second specifying unit
the number of consecutive non-background blocks is equal to or greater than a first criterion and the number of colors of the consecutive non-background blocks is less than a second criterion; The image processing device that specifies the set of non-background blocks to be the character blocks as the character blocks.
請求項1~4のいずれかに記載の画像処理装置であって、
前記第2の特定部は、
連続する一組の前記非背景ブロックの前記連続数が第1の基準以上である場合に、前記連続する一組の前記非背景ブロックのそれぞれについて、前記非背景ブロックに含まれる前記候補画素に関する指標値を算出し、
前記指標値が特定条件を満たす場合に、前記連続する一組の前記非背景ブロックを前記文字ブロックとして特定する、画像処理装置。
The image processing device according to any one of claims 1 to 4,
The second specifying unit
an index relating to the candidate pixels included in the non-background blocks for each of the set of consecutive non-background blocks when the number of consecutive ones of the set of consecutive non-background blocks is equal to or greater than a first criterion; Calculate the value of
An image processing device that specifies the set of continuous non-background blocks as the character blocks when the index value satisfies a specific condition.
請求項6に記載の画像処理装置であって、
前記第2の特定部は、
前記連続する一組の前記非背景ブロックのそれぞれについて、基準個数以上の前記候補画素を含む候補ブロックであるか否かを判断し、
前記連続する一組の前記非背景ブロックに占める前記候補ブロックの割合を前記指標値として算出し、
前記候補ブロックの割合が基準割合以上である場合に、前記連続する一組の前記非背景ブロックを前記文字ブロックとして特定する、画像処理装置。
The image processing device according to claim 6,
The second specifying unit
determining whether each of the continuous set of non-background blocks is a candidate block containing a reference number or more of the candidate pixels;
calculating, as the index value, the ratio of the candidate blocks in the set of consecutive non-background blocks ;
The image processing device, wherein when the ratio of the candidate blocks is equal to or greater than a reference ratio, the set of continuous non-background blocks is specified as the character blocks.
請求項6に記載の画像処理装置であって、
前記第2の特定部は、
前記連続する一組の前記非背景ブロックのそれぞれについて、基準個数以上の前記候補画素を含む候補ブロックであるか前記基準個数未満の前記候補画素を含む非候補ブロックであるか否かを判断し、
前記連続する一組の前記非背景ブロックにおいて前記非候補ブロックが所定方向に連続する最大連続数を前記指標値として算出し、
前記最大連続数が第3の基準以上である場合に、前記連続する一組の前記非背景ブロックを前記文字ブロックとして特定する、画像処理装置。
The image processing device according to claim 6,
The second specifying unit
determining whether each of the continuous set of non-background blocks is a candidate block containing the candidate pixels equal to or greater than a reference number or a non-candidate block containing the candidate pixels less than the reference number;
calculating, as the index value, a maximum consecutive number of consecutive non-candidate blocks in a predetermined direction in the set of consecutive non-background blocks ;
The image processing device, wherein the set of consecutive non-background blocks is specified as the character block when the maximum consecutive number is equal to or greater than a third criterion.
請求項1~8のいずれかに記載の画像処理装置であって、
前記第1の特定部は、
前記対象画像データを用いて、前記対象画像データに含まれる前記複数個の画素の値に対応する複数個の第1の値であって、前記対象画像データの対応する画素の値に基づいて第1処理によって算出される前記複数個の第1の値を含む第1の画像データを生成し、
前記第1の画像データによって示される第1の画像内のエッジを示す複数個の第1のエッジ画素を特定し、
前記対象画像データを用いて、前記対象画像データに含まれる前記複数個の画素の値に対応する複数個の第2の値であって、前記対象画像データの対応する画素の値に基づいて第1処理とは異なる第2処理によって算出される前記複数個の第2の値を含む第2の画像データを生成し、
前記第2の画像データによって示される第2の画像内のエッジを示す複数個の第2のエッジ画素を特定し、
前記対象画像内の複数個の画素のうち、前記複数個の第1のエッジ画素に対応する複数個の画素と、前記複数個の第2のエッジ画素に対応する複数個の画素と、を含む画素群であって、前記複数個の第1のエッジ画素とも前記複数個の第2のエッジ画素とも対応しない複数個の画素を含まない、前記画素群を、前記複数個の候補画素として特定する、画像処理装置。
The image processing device according to any one of claims 1 to 8,
The first specifying unit
using the target image data to generate a plurality of first values corresponding to the values of the plurality of pixels included in the target image data, based on the values of the corresponding pixels of the target image data; generating first image data including the plurality of first values calculated by the first process ;
identifying a plurality of first edge pixels indicative of edges in a first image represented by the first image data;
using the target image data to generate a plurality of second values corresponding to the values of the plurality of pixels included in the target image data, based on the values of the corresponding pixels of the target image data; generating second image data including the plurality of second values calculated by a second process different from the first process ;
identifying a plurality of second edge pixels indicative of edges in a second image represented by the second image data;
including a plurality of pixels corresponding to the plurality of first edge pixels and a plurality of pixels corresponding to the plurality of second edge pixels among the plurality of pixels in the target image; A group of pixels that does not include a plurality of pixels corresponding to neither the plurality of first edge pixels nor the plurality of second edge pixels is specified as the plurality of candidate pixels. , image processor.
請求項1~9のいずれかに記載の画像処理装置であって、さらに、
前記対象画像データのうち、特定済みの前記文字画素の値に対して第1の画像処理を実行し、前記文字画素とは異なる画素の値に対して前記第1の画像処理とは異なる第2の画像処理を実行して、画像処理済みの前記対象画像データを生成する画像処理部を備える、画像処理装置。
The image processing device according to any one of claims 1 to 9, further comprising:
performing a first image process on the values of the specified character pixels in the target image data, and performing a second image process different from the first image process on the values of the pixels different from the character pixels; and an image processing unit configured to generate the image-processed target image data.
請求項10に記載の画像処理装置であって、さらに、
前記画像処理済みの前記対象画像データを用いて、印刷データを生成する印刷データ生成部を備える、画像処理装置。
The image processing device according to claim 10, further comprising:
An image processing apparatus comprising a print data generation unit that generates print data using the image-processed target image data.
コンピュータプログラムであって、
イメージセンサを用いて印刷物を読み取ることによって生成される対象画像データを取得する画像取得機能と、
前記対象画像データを用いて、前記対象画像データによって示される対象画像内の複数個の画素の中から文字画素の候補である複数個の候補画素を特定する第1の特定機能であって、前記対象画像内のエッジを構成する複数個のエッジ画素を前記候補画素として特定する処理を含む、前記第1の特定機能と、
前記対象画像内に複数個のブロックを配置する配置機能であって、前記複数個のブロックは、背景の特徴を示す特定の特徴値を有する複数の背景ブロックと、前記特定の特徴値とは異なる特徴値を有する非背景ブロックと、を含む、前記配置機能と、
前記対象画像データを用いて、前記対象画像に配置される複数個のブロックのうちの非背景ブロックが連続する個数である連続数を特定する連続数特定機能と
前記連続数に基づいて前記複数個のブロックから文字ブロックを特定する第2の特定機能と、
前記候補画素の特定結果と、前記文字ブロックの特定結果と、に基づいて、前記対象画像内の複数個の前記文字画素を特定する第3の特定機能と、
をコンピュータに実現させるコンピュータプログラム。
A computer program,
an image acquisition function for acquiring target image data generated by reading printed matter using an image sensor;
A first specifying function of specifying a plurality of candidate pixels, which are candidates for character pixels, from among a plurality of pixels in a target image indicated by the target image data, using the target image data, the first specifying function including a process of specifying a plurality of edge pixels forming an edge in the target image as the candidate pixels;
An arrangement function for arranging a plurality of blocks in the target image, wherein the plurality of blocks are a plurality of background blocks having a specific feature value that indicates a feature of the background, and a plurality of background blocks that differ from the specific feature value. a non-background block having feature values;
a continuation number identification function that identifies a continuation number, which is the number of continuations of non-background blocks among a plurality of blocks arranged in the target image, using the target image data;
a second specifying function for specifying a character block from the plurality of blocks based on the number of continuations;
a third specifying function of specifying a plurality of the character pixels in the target image based on the result of specifying the candidate pixel and the result of specifying the character block;
A computer program that makes a computer realize
JP2018229489A 2018-12-06 2018-12-06 Image processing device and computer program Active JP7205689B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018229489A JP7205689B2 (en) 2018-12-06 2018-12-06 Image processing device and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018229489A JP7205689B2 (en) 2018-12-06 2018-12-06 Image processing device and computer program

Publications (2)

Publication Number Publication Date
JP2020092363A JP2020092363A (en) 2020-06-11
JP7205689B2 true JP7205689B2 (en) 2023-01-17

Family

ID=71013168

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018229489A Active JP7205689B2 (en) 2018-12-06 2018-12-06 Image processing device and computer program

Country Status (1)

Country Link
JP (1) JP7205689B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008099149A (en) 2006-10-13 2008-04-24 Konica Minolta Business Technologies Inc Image processor, image processing method and image processing program
JP2012222581A (en) 2011-04-08 2012-11-12 Canon Inc Image processing device, image processing method, program, and storage medium
JP2013211772A (en) 2012-03-30 2013-10-10 Brother Ind Ltd Image processing device and program
JP2018166277A (en) 2017-03-28 2018-10-25 ブラザー工業株式会社 Image processing system, and computer program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0722330B2 (en) * 1990-01-10 1995-03-08 富士ゼロックス株式会社 Image region identification method for image processing apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008099149A (en) 2006-10-13 2008-04-24 Konica Minolta Business Technologies Inc Image processor, image processing method and image processing program
JP2012222581A (en) 2011-04-08 2012-11-12 Canon Inc Image processing device, image processing method, program, and storage medium
JP2013211772A (en) 2012-03-30 2013-10-10 Brother Ind Ltd Image processing device and program
JP2018166277A (en) 2017-03-28 2018-10-25 ブラザー工業株式会社 Image processing system, and computer program

Also Published As

Publication number Publication date
JP2020092363A (en) 2020-06-11

Similar Documents

Publication Publication Date Title
EP2670125B1 (en) Image processing device correcting color of border region between object and background in image
JP6781406B2 (en) Image processing equipment and computer programs
US9253368B2 (en) Image processing device setting binary value without using dither matrix when prescribed condition is satisfied
US10373030B2 (en) Image processing apparatus that executes halftone process on target image data including edge pixel
JP7248943B2 (en) Image processing device and computer program
JP6841075B2 (en) Image processing equipment and computer programs
US10565465B2 (en) Image processing apparatus that identifies character pixel in target image using first and second candidate character pixels
JP6944127B2 (en) Image processing equipment, computer programs, and image processing methods
US10339636B2 (en) Image processing apparatus that specifies edge pixel in target image by calculating edge strength
JP7205689B2 (en) Image processing device and computer 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
JP7248944B2 (en) Image processing device and computer program
JP6879465B2 (en) Image processing equipment and computer programs
JP6867609B2 (en) Image processing equipment and computer programs
JP7205693B2 (en) Image processing device and computer program
US9098768B2 (en) Character detection apparatus, character detection method, and computer-readable storage medium
JP4165599B2 (en) Image processing device
JP7248942B2 (en) Image processing device and computer program
JP6781398B2 (en) Image processing equipment and computer programs
JP4032735B2 (en) Image processing apparatus and image processing method
JP6645143B2 (en) Image analysis device
JP4032734B2 (en) Image processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211119

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220713

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220715

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220817

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20221213

R150 Certificate of patent or registration of utility model

Ref document number: 7205689

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150