JP6841254B2 - Image processing equipment and computer programs - Google Patents
Image processing equipment and computer programs Download PDFInfo
- Publication number
- JP6841254B2 JP6841254B2 JP2018045433A JP2018045433A JP6841254B2 JP 6841254 B2 JP6841254 B2 JP 6841254B2 JP 2018045433 A JP2018045433 A JP 2018045433A JP 2018045433 A JP2018045433 A JP 2018045433A JP 6841254 B2 JP6841254 B2 JP 6841254B2
- Authority
- JP
- Japan
- Prior art keywords
- block
- pixels
- character
- pixel
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Image Analysis (AREA)
- Facsimile Image Signal Circuits (AREA)
Description
本明細書は、イメージセンサを用いて印刷物を読み取ることによって生成される画像データに対する画像処理に関し、特に、画像内の文字画素を特定するための画像処理に関する。 The present specification relates to image processing for image data generated by reading a printed matter using an image sensor, and more particularly to image processing for identifying character pixels in an image.
特許文献1に開示された画像処理装置は、画素ごとにエッジであるか否かを判定するエッジ判定と、画素ごとに網点であるかを判定する網点判定と、を実行する。画像処理装置は、エッジであり、かつ、網点ではない画素を、文字を示す画素として特定する。
The image processing apparatus disclosed in
イメージセンサを用いて印刷物を読み取ることによって生成される画像データでは、該画像データによって示される画像内に、印刷物に含まれる網点が現れる。このような網点を構成する画素は、画像内の文字画素を特定する際に、文字画素として誤って特定されやすい。 In the image data generated by reading the printed matter using the image sensor, halftone dots included in the printed matter appear in the image indicated by the image data. Pixels constituting such halftone dots are likely to be erroneously specified as character pixels when specifying character pixels in an image.
このように、網点を含む画像であっても、例えば、網点に起因して文字のない領域において文字画素が誤って特定されることを抑制して、文字画素を精度良く特定できる技術が求められていた。 In this way, even for an image containing halftone dots, for example, there is a technique that can accurately identify character pixels by suppressing erroneous identification of character pixels in an area without characters due to halftone dots. I was asked.
本明細書は、網点を含む画像であっても、対象画像内の文字画素を精度良く特定できる技術を開示する。 The present specification discloses a technique capable of accurately identifying character pixels in a target image even if the image includes halftone dots.
本明細書に開示された技術は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の適用例として実現することが可能である。 The techniques disclosed in the present specification have been made to solve at least a part of the above-mentioned problems, and can be realized as the following application examples.
[適用例1]画像処理装置であって、対象画像を示す対象画像データを取得する画像取得部であって、前記対象画像データは、イメージセンサを用いて印刷物を読み取ることによって生成される、前記画像取得部と、前記対象画像内の複数個の画素から、文字を示す文字画素を特定する文字特定部と、を備え、前記文字特定部は、前記対象画像データを用いて、前記対象画像内の複数個の画素のそれぞれが、対象画像内のエッジを構成するエッジ画素であるか否かを画素ごとに判断することによって、前記エッジ画素であると判断される複数個の第1の候補画素を決定し、前記対象画像データを用いて、前記対象画像上に配置される複数個のブロックのそれぞれについて、前記ブロック内の複数個の画素の分布を示すヒストグラムデータを生成し、前記ヒストグラムデータを用いて、前記複数個のブロックのそれぞれが、文字を示す文字ブロックであるか否かをブロックごとに判断することによって、前記文字ブロックであると判断されるブロック内の複数個の第2の候補画素を決定し、前記対象画像内の複数個の画素のうち、前記第1の候補画素であると決定され、かつ、前記第2の候補画素であると決定される画素を、前記文字画素として特定する、画像処理装置。 [Application Example 1] The image processing apparatus, which is an image acquisition unit that acquires target image data indicating a target image, and the target image data is generated by reading a printed matter using an image sensor. An image acquisition unit and a character identification unit that identifies a character pixel indicating a character from a plurality of pixels in the target image are provided, and the character identification unit uses the target image data in the target image. A plurality of first candidate pixels determined to be the edge pixels by determining for each pixel whether or not each of the plurality of pixels of the above is an edge pixel constituting an edge in the target image. Is determined, and using the target image data, histogram data showing the distribution of a plurality of pixels in the block is generated for each of the plurality of blocks arranged on the target image, and the histogram data is generated. By using each block to determine whether or not each of the plurality of blocks is a character block indicating a character, a plurality of second candidates in the block determined to be the character block are used. Pixels are determined, and among the plurality of pixels in the target image, the pixel determined to be the first candidate pixel and the second candidate pixel is defined as the character pixel. An image processing device to identify.
上記構成によれば、画素ごとの判断によって、複数個の第1の文字候補画素が決定され、ヒストグラムデータを用いたブロックごとの判断によって、複数個の第2の文字候補画素が決定される。そして、第1の文字候補画素であると決定され、かつ、第2の文字候補画素であると決定される画素が、文字画素として特定される。この結果、例えば、画素ごとの判断によって、網点を構成する画素が第1の文字候補画素であると誤って決定されたとしても、ブロックごとの判断によって、網点を構成する画素が第2の文字候補画素であると決定されない場合には、網点を構成する画素が文字画素であると誤って特定されることがない。ブロックごとの判断にヒストグラムデータを用いることにより、文字候補画素の特定に煩雑な処理を要することなく第2の文字候補画素を決定できる。したがって、例えば、網点を含む画像であっても、対象画像内の文字画素を精度良く特定できる。 According to the above configuration, a plurality of first character candidate pixels are determined by the determination for each pixel, and a plurality of second character candidate pixels are determined by the determination for each block using the histogram data. Then, the pixel determined to be the first character candidate pixel and determined to be the second character candidate pixel is specified as the character pixel. As a result, for example, even if the pixel constituting the halftone dot is erroneously determined to be the first character candidate pixel by the determination for each pixel, the pixel constituting the halftone dot is the second pixel by the determination for each block. If it is not determined to be a character candidate pixel of, the pixel constituting the halftone dot is not erroneously specified as a character pixel. By using the histogram data for the determination for each block, the second character candidate pixel can be determined without requiring complicated processing for specifying the character candidate pixel. Therefore, for example, even in an image including halftone dots, character pixels in the target image can be specified with high accuracy.
なお、本明細書に開示される技術は、種々の形態で実現することが可能であり、例えば、複合機、スキャナ、プリンタ、画像処理方法、これら装置の機能または上記方法を実現するためのコンピュータプログラム、そのコンピュータプログラムを記録した記録媒体、等の形態で実現することができる。 The techniques disclosed in the present specification can be realized in various forms, for example, a multifunction device, a scanner, a printer, an image processing method, a function of these devices, or a computer for realizing the above method. It can be realized in the form of a program, a recording medium on which the computer program is recorded, or the like.
A.実施例:
A−1:複合機200の構成
実施の形態を実施例に基づき説明する。図1は、画像処理装置の一例である複合機200の構成を示すブロック図である。複合機200は、画像処理装置を制御するプロセッサであるCPU210と、DRAMなどの揮発性記憶装置220と、フラッシュメモリやハードディスクドライブなどの不揮発性記憶装置230と、液晶ディスプレイなどの表示部240と、液晶ディスプレイと重畳されたタッチパネルやボタンを含む操作部250と、ユーザの端末装置100などの外部装置と通信を行うためのインタフェース(通信IF)270と、印刷実行部280と、読取実行部290と、を備えている。
A. Example:
A-1: Configuration of the
読取実行部290は、CPU210の制御に従って、一次元イメージセンサを用いて原稿を光学的に読み取ることによってスキャンデータを生成する。印刷実行部280は、CPU210の制御に従って、複数種類のトナー、具体的には、シアン(C)、マゼンタ(M)、イエロ(Y)、ブラック(K)のトナーを、色材として用いて、レーザ方式で用紙などの印刷媒体に画像を印刷する。具体的には、印刷実行部280は、感光ドラムを露光して静電潜像を形成し、該静電潜像にトナーを付着させてトナー像を形成する。印刷実行部280は、感光ドラム上に形成されたトナー像を用紙に転写する。なお、変形例では、印刷実行部280は、色材としてのインクを吐出して、用紙上に画像を形成するインクジェット方式の印刷実行部であっても良い。
The
揮発性記憶装置220は、CPU210が処理を行う際に生成される種々の中間データを一時的に格納するバッファ領域を提供する。不揮発性記憶装置230には、コンピュータプログラムPGが格納されている。コンピュータプログラムPGは、CPU210に複合機200の制御を実現させる制御プログラムである。本実施例では、コンピュータプログラムPGは、複合機200の製造時に、不揮発性記憶装置230に予め格納される形態で提供される。これに代えて、コンピュータプログラムPGは、サーバからダウンロードされる形態で提供されても良く、DVD−ROMなどに格納される形態で提供されてもよい。CPU210は、コンピュータプログラムPGを実行することにより、後述する画像処理を実行することができる。
The
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 the document on the platen of the
S10では、CPU210は、ユーザが原稿台に設置した原稿を、読取実行部290を用いて読み取ることによって、対象画像データとしてのスキャンデータを生成する。原稿は、例えば、複合機200、あるいは、図示しないプリンタによって画像が印刷された印刷物である。生成されたスキャンデータは、揮発性記憶装置220(図1)のバッファ領域に格納される。スキャンデータは、複数個の画素の値を含み、複数個の画素の値のそれぞれは、画素の色をRGB表色系の色値(RGB値とも呼ぶ)で表す。すなわち、スキャンデータは、RGB画像データである。1個の画素のRGB値は、例えば、赤色(R)と緑色(G)と青色(B)との3個の色成分の値(以下、R値、G値、B値とも呼ぶ)を含んでいる。本実施例では、各成分値の階調数は、256階調である。
In S10, the
RGB画像データであるスキャンデータは、RGB表色系を構成する3個の色成分に対応する3個の成分画像データ(R成分画像データ、G成分画像データ、B成分画像データ)を含んでいると言うことができる。各成分画像データは、1種類の色成分の値を、画素の値とする画像データである。 The scan data, which is RGB image data, includes three component image data (R component image data, G component image data, B component image data) corresponding to the three color components constituting the RGB color system. Can be said. Each component image data is image data in which the value of one type of color component is used as the pixel value.
S15では、CPU210は、スキャンデータに対して、スキャンデータによって示されるスキャン画像を、拡大率Lrで拡大する拡大処理を実行して、拡大処理済みのスキャンデータを生成する。拡大率Lrは、例えば、ユーザによって、コピーの実行指示とともに入力される。拡大率Lrは、例えば、0.1〜6(10%〜600%)の範囲の値であり、1未満の拡大率Lrでの拡大処理は、スキャン画像のサイズを小さくする処理であり、1より大きな拡大率Lrでの拡大処理は、スキャン画像のサイズを大きくする処理である。スキャン画像のサイズは、具体的には、縦方向および横方向の画素数で定義される。なお、拡大処理前のスキャンデータを元画像データとも呼び、拡大処理済みのスキャンデータを対象画像データとも呼ぶ。以下では、単にスキャンデータと呼ぶとき、拡大処理済みのスキャンデータを意味する。
In S15, the
図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 the scanned image SI represented by the scan data. The scanned image SI includes a plurality of pixels. The plurality of pixels are arranged in a matrix along a first direction D1 and a second direction D2 orthogonal to the first direction D1.
図3(A)のスキャン画像SIは、原稿の用紙の地色を示す白色の背景Bg1と、3個の文字とは異なるオブジェクトOb1〜Ob3と、4個の文字Ob4〜Ob7と、4個の文字Ob4〜Ob7の背景Bg2と、を含んでいる。文字とは異なるオブジェクトは、例えば、写真である。背景Bg2は、白色とは異なる色を有する均一な画像である。 The scanned image SI of FIG. 3A shows a white background Bg1 indicating the background color of the paper of the original, objects Ob1 to Ob3 different from the three characters, four characters Ob4 to Ob7, and four characters. The background Bg2 of the characters Ob4 to Ob7 and the like are included. Objects that are different from text are, for example, photographs. The background Bg2 is a uniform image having a color different from white.
S20では、CPU210は、スキャンデータに対して、文字特定処理を実行する。文字特定処理は、スキャン画像SI内の複数個の画素を、文字を示す複数個の文字画素と、文字を示さない複数個の非文字画素と、に分類することによって、文字画素を特定する処理である。
In S20, the
文字特定処理によって、例えば、文字画素の値が「1」とされ、非文字画素の値が「0」とされた二値画像データ(文字特定データとも呼ぶ)が生成される。図3(B)には、文字特定データによって示される文字特定画像TIの一例が示されている。この文字特定画像TIには、スキャン画像SI内の4個の文字Ob4〜Ob7のエッジを構成する複数個の画素が、文字画素Tp4〜Tp7として、特定されている。なお、比較的大きな文字については、文字のエッジを構成する画素が文字画素として特定され、比較的小さな文字については、文字を構成する画素の全体が文字画素として特定される。文字特定処理の詳細は、後述する。 By the character identification process, for example, binary image data (also referred to as character identification data) in which the value of the character pixel is set to "1" and the value of the non-character pixel is set to "0" is generated. 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 constituting the edges of the four characters Ob4 to Ob7 in the scanned image SI are specified as character pixels Tp4 to Tp7. For relatively large characters, the pixels constituting the edges of the characters are specified as character pixels, and for relatively small characters, the entire pixels constituting the characters are specified as character pixels. The details of the character identification process will be described later.
S30では、CPU210は、スキャンデータに対して、網点平滑化処理を実行して、平滑化画像を示す平滑化画像データを生成する。具体的には、CPU210は、スキャンデータに含まれる複数個の非文字画素の値のそれぞれに対して、ガウスフィルタなどの平滑化フィルタを用いた平滑化処理を実行して、平滑化処理済みの複数個の非文字画素の値を算出する。平滑化処理の対象となる非文字画素は、S20の分類処理によって生成された文字特定データを参照して特定される。CPU210は、スキャンデータに含まれる複数個の文字画素の値と、平滑化処理済みの複数個の非文字画素の値と、を含む平滑化画像データを生成する。
In S30, the
図3(C)には、平滑化画像データによって示される平滑化画像GIが示されている。平滑化画像GIは、白色の背景Bg1gと、スキャン画像SI内のオブジェクトOb1〜Ob7、背景Bg2が平滑化されたオブジェクトOb1g〜Ob7g、背景Bg2gを含んでいる。これらのオブジェクトOb1g〜Ob7g、背景Bg2gのうち、文字Ob4g〜Ob7g以外の部分(非文字部分とも呼ぶ)は、スキャン画像SIと比較して、平滑化されている。 FIG. 3C shows a smoothed image GI represented by the smoothed image data. The smoothed image GI contains 1 g of a white background Bg, objects Ob1 to Ob7 in the scanned image SI, objects Ob1g to Ob7g in which the background Bg2 is smoothed, and 2 g of a background Bg. Of these objects Ob1g to Ob7g and background Bg2g, parts other than the characters Ob4g to Ob7g (also referred to as non-character parts) are smoothed as compared with the scanned image SI.
S40では、CPU210は、平滑化画像データに対して、文字鮮鋭化処理を実行して、処理済み画像データを生成する。具体的には、CPU210は、平滑化画像データに含まれる複数個の文字画素の値のそれぞれに対して、アンシャープマスク処理や鮮鋭化フィルタを適用する処理などの鮮鋭化処理を実行して、鮮鋭化処理済みの複数個の文字画素の値を算出する。鮮鋭化処理の対象となる文字画素は、S20の分類処理によって生成された文字特定データを参照して特定される。そして、CPU210は、平滑化画像データに含まれる複数個の非文字画素の値(平滑化処理済みの複数個の非文字画素の値)と、鮮鋭化処理済みの複数個の文字画素の値と、を含む処理済み画像データを生成する。平滑化画像データに含まれる複数個の文字画素の値は、平滑化処理の対象ではないので、スキャンデータに含まれる複数個の文字画素の値と同じである。したがって、本ステップの文字鮮鋭化処理は、スキャンデータに含まれる複数個の文字画素の値に対して実行される、とも言うことができる。
In S40, the
図3(D)には、処理済み画像データによって示される処理済み画像FIが示されている。処理済み画像FIは、白色の背景Bg1fと、スキャン画像SI内のオブジェクトOb1〜Ob7、背景Bg2に対応するオブジェクトOb1f〜Ob7f、背景Bg2fを含んでいる。これらのオブジェクトOb1f〜Ob7f、背景Bg2fのうち、文字Ob4f〜Ob7fのエッジは、スキャン画像SI内の文字Ob4〜Ob7や、平滑化画像GI内の文字Ob4g〜Ob7gと比較して、鮮鋭化されている。また、文字以外のオブジェクトOb1f〜Ob3f、背景Bg2fのエッジは、鮮鋭化されていない。 FIG. 3D shows the processed image FI represented by the processed image data. The processed image FI includes a white background Bg1f, objects Ob1 to Ob7 in the scanned image SI, objects Ob1f to Ob7f corresponding to the background Bg2, and a background Bg2f. Of these objects Ob1f to Ob7f and the background Bg2f, the edges of the characters Ob4f to Ob7f are sharpened as compared with the characters Ob4 to Ob7 in the scanned image SI and the characters Ob4g to Ob7g in the smoothed image GI. There is. Further, the edges of the objects Ob1f to Ob3f and the background Bg2f other than the characters are not sharpened.
以上の説明から解るように、処理済み画像FI内のオブジェクトOb1f〜Ob7f、背景Bg2fは、鮮鋭化された文字と、平滑化された非文字を含む。 As can be seen from the above description, the objects Ob1f to Ob7f 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
S60では、CPU210は、印刷処理を実行して、画像処理を終了する。具体的には、CPU210は、印刷データを印刷実行部280に供給して、印刷実行部280に処理済み画像を印刷させる。
In S60, the
以上説明した画像処理によれば、スキャンデータのうち、特定済みの複数個の文字画素の値に対して第1の画像処理(具体的には、エッジ鮮鋭化処理)が実行され(S40)、複数個の非文字画素の値に対して第1の画像処理とは異なる第2の画像処理(具体的には、網点平滑化処理)が実行され(S30)、処理済み画像データが生成される。この結果、文字画素の値と、文字画素とは異なる画素の値と、に対して、互いに異なる画像処理が実行されるので、スキャンデータに対する適切な画像処理を実現できる。なお、変形例では、S40の文字鮮鋭化処理が先に実行され、その後に、S30の網点平滑化処理が実行されても良い。 According to the image processing described above, the first image processing (specifically, the edge sharpening process) is executed for the values of the plurality of specified character pixels in the scan data (S40). A second image process (specifically, halftone dot smoothing process) different from the first image process is executed for the values of the plurality of non-character pixels (S30), and the processed image data is generated. To. As a result, different image processing is executed for the value of the character pixel and the value of the pixel different from the character pixel, so that appropriate image processing for the scan data can be realized. In the modified example, the character sharpening process of S40 may be executed first, and then the halftone dot smoothing process of S30 may be executed.
より具体的には、鮮鋭化処理済みの複数個の文字画素の値と、平滑化処理済みの複数個の非文字画素の値と、を含む処理済み画像データが生成される(S30、S40)。この結果、見栄えの良い処理済み画像FIを示す処理済み画像データを生成することができる。 More specifically, processed image data including the values of the plurality of character pixels that have been sharpened and the values of the plurality of non-character pixels that have been smoothed is generated (S30, S40). .. As a result, it is possible to generate processed image data showing the processed image FI that looks good.
例えば、図3(D)の処理済み画像FIに示すように、処理済み画像データでは、文字画素の値には、鮮鋭化処理済みの値が用いられている。この結果、処理済み画像FIの文字がシャープに見えるので、例えば、印刷される処理済み画像FIの見栄えを向上することができる。 For example, as shown in the processed image FI of FIG. 3D, in the processed image data, the sharpening-processed value is used as the value of the character pixel. As a result, the characters of the processed image FI look sharp, so that the appearance of the processed image FI to be printed can be improved, for example.
また、処理済み画像データでは、処理済み画像FI内の背景Bg2fや、写真などの文字とは異なるオブジェクトを構成する非文字画素の値には、平滑化処理済みの値が用いられている。この結果、処理済み画像FIの文字とは異なる部分に、例えば、モアレの原因となる網点が表れることを抑制できるので、印刷される処理済み画像FIにモアレなどの不具合が発生することを抑制できる。この結果、印刷される処理済み画像FIの見栄えを向上することができる。また、写真内のエッジが過度に強調されることが抑制されるので、画像FIの見栄えを向上することができる。 Further, in the processed image data, the smoothed values are used as the values of the background Bg2f in the processed image FI and the non-character pixels constituting an object different from the characters such as a photograph. As a result, for example, it is possible to suppress the appearance of halftone dots that cause moire in a portion different from the characters of the processed image FI, so that it is possible to prevent problems such as moire from occurring in the printed processed image FI. it can. As a result, the appearance of the processed image FI to be printed can be improved. In addition, since the edges in the photograph are suppressed from being excessively emphasized, the appearance of the image FI can be improved.
例えば、スキャンデータの生成に用いられた原稿は、画像が印刷された印刷物である。このため、例えば、原稿内の白とは異なる色を有する背景Bg2などの均一な部分は、画像を形成するドットレベルでみると、網点を形成している。網点は、複数個のドットと、ドットが配置されていない部分(原稿の地色を示す部分)と、を含む。このために、スキャン画像SI内の背景Bg2を示す領域には、画素レベルでみると、網点が示されている。網点内のドットは、原稿の印刷時に用いられるディザマトリクスなどの影響によって、周期性を持って並んでいる。このためにスキャンデータを用いて印刷を行うと、ハーフトーン処理前の元画像(スキャン画像SI)内に存在している網点のドットの周期成分と、印刷画像を構成する網点のドットの周期成分と、が干渉して、モアレが表れやすい。本実施例の処理済み画像FIでは、平滑化処理によって、元画像(スキャン画像SI)内のエッジとは異なる部分のドットの周期成分が低減される。この結果、処理済み画像データを用いて、処理済み画像FIを印刷する場合に、例えば、印刷される処理済み画像FIにモアレが発生することを抑制できる。 For example, the original used to generate the scan data is a printed matter on which an image is printed. Therefore, for example, a uniform portion such as a background Bg2 having a color different from white in a document forms halftone dots when viewed at the dot level forming an image. The halftone dots include a plurality of dots and a portion where the dots are not arranged (a portion indicating the ground color of the document). For this reason, halftone dots are shown in the region showing the background Bg2 in the scanned image SI when viewed at the pixel level. The dots in the halftone dots are arranged with periodicity due to the influence of the dither matrix used when printing the original. For this reason, when printing is performed using scan data, the periodic components of halftone dot dots existing in the original image (scan image SI) before halftone processing and the dots of halftone dots that make up the printed image Moire is likely to appear due to interference with the periodic component. In the processed image FI of this embodiment, the smoothing process reduces the periodic component of dots in a portion different from the edge in the original image (scanned image SI). As a result, when the processed image FI is printed using the processed image data, for example, it is possible to suppress the occurrence of moire in the printed processed image FI.
特に、上記画像処理では、処理済み画像データを用いて、印刷データが生成される(S50)ので、例えば、印刷される処理済み画像FIに発生しやすいモアレを抑制可能な適切な印刷データを生成することができる。 In particular, in the above image processing, print data is generated using the processed image data (S50). Therefore, for example, appropriate print data capable of suppressing moire that tends to occur in the processed image FI to be printed is generated. can do.
A−3:文字特定処理
図2のS20の文字特定処理について説明する。S22では、CPU210は、スキャンデータを用いて、第1の二値画像データ生成処理を実行して、第1の二値画像データを生成する。第1の二値画像データは、エッジ画素と非エッジ画素とを示す二値データである。ここで、第1の二値画像データによって示されるエッジ画素を第1のエッジ画素とも呼び、第1の二値画像データによって示される非エッジ画素を第1の非エッジ画素とも呼ぶ。第1の二値画像データ生成処理の詳細は、後述する。
A-3: Character identification process The character identification process of S20 in FIG. 2 will be described. In S22, the
S24では、CPU210は、スキャンデータを用いて、第2の二値画像データ生成処理を実行して、第2の二値画像データを生成する。第2の二値画像データは、第1の二値画像データと同様に、エッジ画素と非エッジ画素とを示す二値データである。第2の二値画像データは、第1の二値画像データとは異なる処理によって生成され、第1の二値画像データとは異なるデータである。ここで、第2の二値画像データによって示されるエッジ画素を第2のエッジ画素とも呼び、第2の二値画像データによって示される非エッジ画素を第2の非エッジ画素とも呼ぶ。第2の二値画像データ生成処理の詳細は、後述する。
In S24, the
S26では、CPU210は、S22にて生成された第1の二値画像データと、S24にて生成された第2の二値画像データと、を合成する論理和合成処理を実行して、最終的に特定されるエッジ画素と非エッジ画素とを示す二値画像データ(エッジ特定データとも呼ぶ)を生成する。具体的には、CPU210は、第1の二値画像データと、第2の二値画像データと、の各画素の論理和を取ることによって、エッジ特定データとしての二値画像データを生成する。換言すれば、CPU210は、第1の二値画像データによって特定される複数個の第1のエッジ画素と、第2の二値画像データによって特定される複数個の第2のエッジ画素と、を含む画素群であって、第1のエッジ画素とも第2のエッジ画素とも異なる画素を含まない画素群を、最終的に、複数個のエッジ画素として特定する。この結果、第1の二値画像データと第2の二値画像データとを用いて、対象画像内の画素がエッジ画素であるか否かを精度良く判断することができる。例えば、スキャン画像SI内のエッジ画素の特定漏れを効果的に低減できる。
In S26, the
エッジ特定データによって特定されるエッジ画素は、文字画素の候補となる画素であり、第1の文字候補画素とも呼ぶ。例えば、エッジ特定データは、第1の文字候補画素(本実施例ではエッジ画素)の値が「1」とされ、第1の文字候補画素ではない画素(本実施例では、非エッジ画素)の値が「0」とされた二値画像データである。 The edge pixel specified by the edge specific data is a pixel that is a candidate for a character pixel, and is also called a first character candidate pixel. For example, in the edge identification data, the value of the first character candidate pixel (edge pixel in this embodiment) is set to "1", and the value of the pixel that is not the first character candidate pixel (non-edge pixel in this embodiment). It is binary image data whose value is set to "0".
図4は、文字特定処理で用いられる画像の一例を示す図である。図4(A)には、エッジ特定データによって示されるエッジ特定画像EIの一例が示されている。このエッジ特定画像EIには、スキャン画像SI内のオブジェクトOb1〜Ob7のエッジEg1〜Eg7を構成する複数個のエッジ画素と、背景Bg1と背景Bg2との境界のエッジEg8を構成する複数個のエッジ画素とが、第1の文字候補画素として特定されている。このように、第1の文字候補画素によって示されるエッジは、文字のエッジを含む。また、該エッジは、文字とは異なるオブジェクト(例えば、写真)に含まれる細線などのエッジを含む。 FIG. 4 is a diagram showing an example of an image used in the character identification process. FIG. 4A shows an example of the edge-specific image EI represented by the edge-specific data. The edge specific image EI includes a plurality of edge pixels constituting the edges Eg1 to Eg7 of the objects Ob1 to Ob7 in the scanned image SI, and a plurality of edges forming the edge Eg8 at the boundary between the background Bg1 and the background Bg2. The pixel is specified as the first character candidate pixel. As described above, the edge indicated by the first character candidate pixel includes the character edge. Further, the edge includes an edge such as a thin line contained in an object (for example, a photograph) different from the character.
S28では、CPU210は、スキャンデータに対して、ブロック判定処理を実行して、文字画素の候補である第2の文字候補画素と、第2の文字候補画素ではない画素と、を示す二値画像データ(ブロック判定データとも呼ぶ)を生成する。ブロック判定処理は、スキャンデータを用いて、スキャン画像SI内に配置される複数個のブロックのそれぞれが、文字を示す文字ブロックであるか否かをブロックごとに判断する処理である。1個のブロックは、N個(Nは2以上の整数)の画素を含む矩形の領域である。詳細は後述するが、ブロックごとの判断結果に基づいて、スキャン画像SI内の複数個の画素は、第2の文字候補画素か否かが決定される。ブロック判定データは、第2の文字候補画素の値が「1」とされ、第2の文字候補画素ではない画素の値が「0」とされた二値画像データである。
In S28, the
図4(B)には、ブロック判定データによって示されるブロック判定画像BIの一例が示されている。このブロック判定画像BIには、スキャン画像SI内の文字Ob4〜Ob7が配置された領域を示す第2の文字候補画素Bk4〜Bk7g1が特定されている。このように、第2の文字候補画素によって示される領域は、文字を含む文字領域を含み、文字とは異なるオブジェクト(例えば、写真)を含む領域を含まない。 FIG. 4B shows an example of the block determination image BI shown by the block determination data. In this block determination image BI, second character candidate pixels Bk4 to Bk7g1 indicating an area in which characters Ob4 to Ob7 are arranged in the scan image SI are specified. As described above, the area indicated by the second character candidate pixel includes the character area including the character and does not include the area including the object (for example, a photograph) different from the character.
S29では、CPU210は、S26にて生成されたエッジ特定データと、S28にて生成されたブロック判定データと、を合成する論理積合成処理を実行して、文字画素と非文字画素とを示す上述した文字特定データ(図3(B)参照)を生成する。具体的には、CPU210は、エッジ特定データと、ブロック判定データと、の各画素の論理積を取ることによって、文字特定データとしての二値画像データを生成する。換言すれば、CPU210は、スキャン画像SI内の複数個の画素のうち、S22〜S26において第1の文字候補画素であると決定され、かつ、S28において第2の文字候補画素であると決定される画素を、文字画素として特定する。CPU210は、スキャン画像SI内の複数個の画素のうち、第1の文字候補画素ではないと決定される画素と、第2の文字候補画素ではないと決定される画素とを、非文字画素として特定する。文字特定データが生成されると、文字特定処理は、終了される。
In S29, the
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 process The first binary image data generation process in S22 of FIG. 2 will be described. FIG. 5 is a flowchart of the first binary image data generation process. In S100, the
平滑化処理は、処理対象の成分画像データによって示される成分画像を平滑化する処理である。本実施例の平滑化処理は、処理対象の成分画像データの各画素の値に対して、所定の平滑化フィルタを適用して、平滑化済みの各画素の値を算出する処理である。平滑化フィルタには、例えば、縦7画素×横7画素のサイズのガウスフィルタが用いられる。 The smoothing process is a process for smoothing a 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 pixel that has been smoothed. As the smoothing filter, for example, a Gaussian filter having a size of 7 pixels in the vertical direction and 7 pixels in the horizontal direction is used.
S110では、3個の平滑化済みの成分画像データのそれぞれに対して、エッジ強調処理を実行して、3個のエッジ強調済みの成分画像データ、すなわち、エッジ強調済みのR成分画像データ、エッジ強調済みのG成分画像データ、エッジ強調済みのB成分画像データを生成する。 In S110, edge enhancement processing is executed for each of the three smoothed component image data, and the three edge-enhanced component image data, that is, the edge-enhanced R component image data and the edge. The emphasized G component image data and the edge emphasized B component image data are generated.
図6は、エッジ強調処理のフローチャートである。ここでは、平滑化済みのR成分画像データが処理対象であるとして説明する。平滑化済みのG成分画像データおよび平滑化済みのB成分画像データに対しても同様の処理が行われる。 FIG. 6 is a flowchart of edge enhancement processing. Here, it will be described that the smoothed R component image data is the processing target. The same processing is performed on the smoothed G component image data and the smoothed B component image data.
S200では、CPU210は、エッジ強調済みのR成分画像データを生成するためのキャンバスデータをメモリ(具体的には、揮発性記憶装置220のバッファ領域)に準備する。キャンバスデータによって示されるキャンバス(初期画像)は、スキャン画像SIと同じサイズの画像、すなわち、同じ画素数の画像である。キャンバスデータの各画素の値は、所定の初期値(例えば、0)である。
In S200, the
S205では、CPU210は、平滑化済みのR成分画像データによって示される平滑化済みのR成分画像内の複数個の画素から1個の注目画素を選択する。
In S205, the
S210では、CPU210は、注目画素に対応するマスク値MVを算出する。マスク値MVは、注目画素の値TVと、注目画素に対して上下左右に隣接する4個の画素を含む所定個数の周辺画素の値と、を用いて、注目画素の値TVを平滑化する処理によって算出される。このために、マスク値MVを、平滑値とも呼ぶ。具体的には、注目画素を中心とする縦10画素×横10画素の矩形の範囲内の100個の画素の値の平均値が、注目画素に対応するマスク値MVとして算出される。
In S210, the
S220では、CPU210は、注目画素の値TVと、注目画素に対応するマスク値MVと、の差分ΔVを算出する(ΔV=(TV−MV))。
In S220, the
S230では、CPU210は、差分ΔVは、基準以上であるか否かを判断する。具体的には、差分ΔVが、予め定められた閾値TH以上であるか否かが判断される。閾値THは、成分値が、0〜255の範囲の256階調の値である場合に、例えば、20〜30程度の値である。
In S230, the
差分ΔVが基準以上である場合には(S230:YES)、S240にて、CPU210は、注目画素の値TVと、注目画素に対応する差分ΔVと、の和(TV+ΔV)を、処理済みの値として算出する。差分ΔVが基準未満である場合には(S230:NO)、CPU210は、S240をスキップする。
When the difference ΔV is equal to or greater than the reference value (S230: YES), in S240, the
S245では、CPU210は、注目画素の値を、S200にて準備されたキャンバスデータに記録する。S240が実行された場合には、S240にて算出された注目画素の値TVと、注目画素に対応する差分ΔVと、の和が、処理済みの値としてキャンバスデータに記録される。S240がスキップされた場合には、平滑化済みのR成分画像データの注目画素の値が、そのまま、キャンバスデータに記録される。
In S245, the
S250では、CPU210は、R成分画像内の全ての画素を注目画素として処理したか否かを判断する。未処理の画素がある場合には(S250:NO)、CPU210は、S205に戻って、未処理の画素を注目画素として選択する。全ての画素が処理された場合には(S250:YES)、CPU210は、エッジ強調処理を終了する。この時点でエッジ強調済みのR成分画像データが生成されている。
In S250, the
図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 the smoothed R component image data and the edge-enhanced R component image data. FIG. 7A shows a graph conceptually showing the R component image data of S100 of FIG. 5 before the smoothing process. 7 (B) and 7 (C) show graphs conceptually showing the smoothed R component image data and the edge-enhanced R component image data, respectively. In each graph, the left part conceptually shows a halftone dot area indicating a halftone dot, and the right part conceptually shows an edge area indicating an edge of an object such as a character. The vertical axis of each graph indicates the value of the R component, and the horizontal axis indicates the position in a predetermined direction (for example, the first direction D1 in FIG. 3).
平滑化処理前のR成分画像データには、例えば、網点領域において、複数個の網点と、該網点間の複数個の隙間と、に対応する複数個の谷部C1〜C3と、複数個の山部P1、P2と、が現れる(図7(A))。このような谷部C1〜C3と、複数個の山部P1、P2と、の間のR成分の値の差が大きいまま残存していると、後述するS150の二値化処理において、該R成分の値の差に起因して、網点を示すエッジ画素が特定されやすい。網点領域は、画素レベルの視点(網点を認識できる程度のミクロの視点)でみれば、網点を含むが、観察者の視点(網点を認識できない程度のマクロの視点)でみれば、均一な領域である。このため、本実施例では、網点領域内において、網点に起因するエッジ画素は、特定されるべきではない。網点領域は、図2のS30で平滑化されることが好ましく、S40にて、鮮鋭化されるべきではないからである。仮に、網点のエッジが鮮鋭化されると、網点の周期性が目立つために、該画像を印刷する場合に、モアレが目立ちやすくなるからである。例えば、スキャン画像SI内の背景Bg2などの均一な部分や、オブジェクトのエッジとは異なる部分において、エッジ画素は、特定されるべきではない。 The R component image data before the smoothing process includes, for example, a plurality of halftone dots C1 to C3 corresponding to a plurality of halftone dots and a plurality of gaps between the halftone dots in the halftone dot region. A plurality of mountain portions P1 and P2 appear (FIG. 7 (A)). If the difference in the value of the R component between the valleys C1 to C3 and the plurality of peaks P1 and P2 remains large, the R is found in the binarization process of S150 described later. Due to the difference in the value of the component, the edge pixel indicating the halftone dot is easily identified. The halftone dot region includes halftone dots from a pixel-level viewpoint (a micro viewpoint that can recognize halftone dots), but from an observer's viewpoint (a macro viewpoint that cannot recognize halftone dots). , A uniform area. Therefore, in this embodiment, the edge pixels caused by the halftone dots should not be specified in the halftone dot region. This is because the halftone dot region is preferably smoothed in S30 of FIG. 2 and should not be sharpened in S40. If the edges of the halftone dots are sharpened, the periodicity of the halftone dots becomes conspicuous, so that moire becomes conspicuous when printing the image. For example, edge pixels should not be specified in a uniform part such as the background Bg2 in the scanned image SI or a part different from the edge of the object.
平滑化済みのR成分画像データでは、平滑化処理によって、例えば、網点領域において、複数個の谷部C1a〜C3aと、複数個の山部P1a、P2aと、のR成分の値の差が、平滑化処理前のR成分画像データと比較して十分に小さくなっている(図7(B))。 In the smoothed R component image data, due to the smoothing process, for example, in the halftone dot region, the difference between the R component values of the plurality of valley portions C1a to C3a and the plurality of peak portions P1a and P2a is increased. , It is sufficiently smaller than the R component image data before the smoothing process (FIG. 7 (B)).
ここで、本実施例のエッジ強調処理では、注目画素の値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 process of this embodiment, the larger the difference ΔV between the value TV of the pixel of interest and the mask value MV corresponding to the pixel of interest, the greater the effect of edge enhancement. Therefore, the effect of edge enhancement becomes small in a region where the difference in the values of the R components is relatively small and flat, such as the halftone dot region of FIG. 7B. Further, in the edge enhancement process of this embodiment, when the difference ΔV is less than the reference value, the edge enhancement is not performed and the pixel value of the smoothed R component image data is adopted as it is (FIG. 6). S230). As a result, in the edge-enhanced R component image data, for example, in the halftone dot region, a plurality of valley portions C1b to C3b and a plurality of mountain portions P1b, despite the edge enhancement processing being performed. The difference between the R component values of P2b and that of P2b is not larger than that of the smoothed R component image data (FIG. 7 (C)). That is, similarly to the smoothed R component image data, in the edge-enhanced 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 The difference is sufficiently smaller than the R component image data (FIG. 7 (A)) before the smoothing process (FIG. 7 (C)).
平滑化処理前のR成分画像データには、例えば、文字などのオブジェクトのエッジを示すエッジ領域において、該エッジに対応してR成分の値が急激に変化する変動部E1が現れる(図7(A))。このような変動部E1において、値の変化が大きいほど、後述するS150の二値化処理において、該R成分の値の差に起因して、オブジェクトのエッジを示すエッジ画素が特定されやすい。 In the R component image data before the smoothing process, for example, in an edge region indicating an edge of an object such as a character, a variable portion E1 in which the value of the R component suddenly changes corresponding to the edge appears (FIG. 7 (FIG. 7). A)). In such a variable portion E1, the larger the change in the value, the easier it is to identify the edge pixel indicating the edge of the object due to the difference in the value of the R component in the binarization process of S150 described later.
平滑化済みのR成分画像データでは、平滑化処理によって、例えば、エッジ領域において、変動部E1aにおける値の変化が、平滑化処理前のR成分画像データと比較して小さくなっている(緩やかになっている)(図7(B))。 In the smoothed R component image data, for example, in the edge region, the change in the value in the variable portion E1a is smaller (gradually) than the R component image data before the smoothing process due to the smoothing process. (Fig. 7 (B)).
しかしながら、文字などのオブジェクトのエッジに対応する変動部E1aにおける値の変化は、網点領域における値の変化よりは十分に大きいので、エッジ強調処理によって、再度、急激な変化に戻される。この結果、エッジ強調済みのR成分画像データでは、エッジ領域において、変動部E1bのR成分の値の変化は、平滑化処理済みのR成分画像データと比較して大きくなっている(図7(C))。このため、エッジ強調済みのR成分画像データでは、エッジ領域において、変動部E1bにおける値の変化が、平滑化処理前のR成分画像データと比較して、同程度、もしくは、急激になっている(図7(C))。 However, since the change in the value in the variable portion E1a corresponding to the edge of the object such as a character is sufficiently larger than the change in the value in the halftone dot region, the edge enhancement process returns to the sudden change again. As a result, in the edge-enhanced R component image data, the change in the value of the R component of the variable portion E1b in the edge region is larger than that in the smoothed R component image data (FIG. 7 (FIG. 7). C)). Therefore, in the edge-enhanced R component image data, the change in the value in the variable portion E1b in the edge region is about the same as or abrupt as compared with 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 executed in this order for each component image data, so that the edges of the halftone dots are formed. It is possible to suppress the identification of the indicated edge pixel, and it is possible to promote the identification of the edge pixel indicating the edge of an object such as a character. 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 enhanced component image data corresponding to the three color components of R, G, and B are generated, in 120 of FIG. 5, the three enhanced component image data are used. , Generates luminance image data. The luminance image data is data indicating the luminance of a plurality of pixels in the enhanced image indicated by the three enhanced component image data. Specifically, the
S130では、CPU210は、生成された輝度画像データに対して、当該輝度画像データによって示される輝度画像内のエッジを抽出するエッジ抽出処理を実行して、エッジ抽出データを生成する。具体的には、CPU210は、輝度画像データの各画素の値に、公知のエッジ抽出フィルタ、例えば、ソーベルフィルタ(Sobel filter)を適用して、各画素のエッジ強度を算出する。CPU210は、これらのエッジ強度を、複数個の画素の値とするエッジ抽出データを生成する。
In S130, the
S140では、CPU210は、エッジ抽出データに対して、レベル補正処理を実行して、補正処理済みのエッジ抽出データを生成する。レベル補正処理は、エッジ抽出データの画素の値が取り得る階調値の範囲(本実施例では、0〜255の範囲)内の特定範囲を拡大する補正処理である。
In S140, the
図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
S150では、CPU210は、補正処理済みのエッジ抽出データに対して、二値化処理を実行して、二値画像データを生成する。例えば、CPU210は、エッジ画像データにおいて、画素の値(すなわち、エッジ強度)が閾値(例えば、128)以上である画素を、エッジ画素に分類し、画素の値が閾値未満である画素を、非エッジ画素に分類する。二値画像データでは、上述したように、エッジ画素の値は、「1」とされ、非エッジ画素の値は、「0」とされる。
In S150, the
以上説明した第1の二値画像データ生成処理によれば、図7を参照して説明したように、複数個の成分画像データのそれぞれに対して平滑化処理を実行することで、スキャン画像SI内に現れる網点の特徴を低減できる。さらに、図7を参照して説明したように、複数個の平滑化済みの成分画像データのそれぞれに対して、エッジ強調処理を実行することで、平滑化処理によって平滑化されたスキャン画像SI内のエッジを適切に強調できる。この結果、網点に起因するエッジ画素が特定されることを抑制しつつ、スキャン画像SI内のエッジ画素の適切に特定できる。 According to the first binary image data generation process described above, as described with reference to FIG. 7, by executing the smoothing process for each of the plurality of component image data, the scanned image SI The characteristics of halftone dots appearing inside can be reduced. Further, as described with reference to FIG. 7, by performing edge enhancement processing on each of the plurality of smoothed component image data, the inside of the scanned image SI smoothed by the smoothing process is performed. Can properly emphasize the edges of. As a result, the edge pixels in the scanned image SI can be appropriately specified while suppressing the identification of the edge pixels caused by the halftone dots.
さらに、単成分画像データとして、輝度画像データが用いられるので、スキャン画像SI内の複数個のエッジ画素をより適切に特定できる。例えば、網点は、印刷に用いられるC、M、Yの原色を有することが多いが、このような複数種の原色間の差は、R、G、Bの各成分画像データにおいて比較的大きくなるが、輝度画像データでは、比較的小さくなる。このために、輝度画像データを用いることで、網点に起因するエッジ画素が特定されることを適切に抑制できる。また、文字の読みやすさのために、文字の色と背景の色とは、輝度に比較的大きな差があることが多い。このために、輝度画像データを用いることで、文字をはじめとするオブジェクトのエッジを示すエッジ画素を適切に特定できる。 Further, 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 scanned image SI. For example, halftone dots often have the primary colors C, M, and Y used for printing, but such a difference between a plurality of primary colors is relatively large in each component image data of R, G, and B. However, it is relatively small in the luminance image data. Therefore, by using the luminance image data, it is possible to appropriately suppress the identification of edge pixels caused by halftone dots. Further, for the sake of readability of characters, there is often a relatively large difference in brightness between the color of characters and the color of the background. Therefore, by using the luminance image data, it is possible to appropriately identify the edge pixels indicating the edges of the object such as characters.
さらに、図6のエッジ強調処理では、注目画素に対応するマスク値(平滑値とも呼ぶ)の算出(S210)と、注目画素の値TVと注目画素に対応するマスク値との差分ΔVの算出(S220)と、注目画素の値TVと対応する差分ΔVとの和(TV+ΔV)の算出(S240)と、を含むいわゆるアンシャープマスク処理が実行される。この結果、スキャン画像SIのエッジを適切に強調できるので、特定すべきエッジ画素の特定漏れを抑制できる。この結果、スキャン画像SI内のエッジ画素をより適切に特定できる。 Further, in the edge enhancement process of FIG. 6, the calculation of the mask value (also referred to as the smooth value) corresponding to the pixel of interest (S210) and the calculation of the difference ΔV between the value TV of the pixel of interest and the mask value corresponding to the pixel of interest (S210). The so-called unsharp mask processing including the calculation (S240) of the sum (TV + ΔV) of S220) and the value TV of the pixel of interest and the corresponding difference ΔV is executed. As a result, since the edge of the scanned image SI can be appropriately emphasized, it is possible to suppress the specification omission of the edge pixel to be specified. As a result, the 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 processing of FIG. 6, among the plurality of pixels in the scanned image SI, the pixels whose corresponding difference ΔV is equal to or more than the reference are subject to the unsharp mask processing, and the difference ΔV is less than the reference. Pixels that are are not subject to unsharp mask processing (S230, 240). As a result, as described with reference to FIG. 7, it is possible to further suppress the emphasis of the difference in values between the pixels due to the halftone dots of the scanned image SI, so that the edge pixels due to the halftone dots can be specified. It can be further suppressed. Then, the edges of objects such as characters can be appropriately emphasized. Therefore, the edge pixels in the scanned image SI can be more appropriately specified.
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 process The second binary image data generation process of S24 of FIG. 2 will be described. FIG. 9 is a flowchart of the second binary image data generation process. In S300, the
図10は、スキャンデータの最小成分値と最大成分値の説明図である。図10(A)〜図10(E)には、RGB値の一例として、シアン(C)、マゼンタ(M)、イエロ(Y)、黒(K)、白(W)のRGB値が、棒グラフで図示されている。図10に示すように、C、M、Y、K、WのRGB値(R、G、B)は、それぞれ、(0、255、255)、(255、0、255)(255、255、0)、(0、0、0)、(255、255、255)である。 FIG. 10 is an explanatory diagram of the minimum component value and the maximum component value of the scan data. 10 (A) to 10 (E) show a bar graph showing RGB values of cyan (C), magenta (M), yellow (Y), black (K), and white (W) as an example of RGB values. Is illustrated in. 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, respectively). 0), (0, 0, 0), (255, 255, 255).
これらのRGB値の輝度値Yは、上述したように、例えば、Y=0.299×R+0.587×G+0.114×Bの式を用いて算出できる。C、M、Y、K、Wの輝度(0〜255の値で表す)は、約186、113、226、0、255であり、それぞれに異なる値となる(図10)。これに対して、C、M、Y、K、Wの最小成分値Vminは、図10に示すように、0、0、0、0、255となり、白(W)を除いて同じ値となる。 As described above, the luminance value Y of these RGB values can be calculated using, for example, the formula Y = 0.299 × R + 0.587 × G + 0.114 × B. The brightness of C, M, Y, K, and W (represented by a value of 0 to 255) is about 186, 113, 226, 0, 255, and each has a different value (FIG. 10). On the other hand, the minimum component values Vmin of C, M, Y, K, and W are 0, 0, 0, 0, 255 as shown in FIG. 10, and are the same values except for white (W). ..
図11は、画像処理に用いられる画像の一例を示す第2の図である。図11(A)は、スキャン画像SIのうち、上述した網点領域の拡大図である。例えば、図11(A)の例では、スキャン画像SI内の網点領域は、複数個のMドットMDと、複数個のYドットYDと、を含んでいる。ここでは、説明のために、MドットMDを示す画像は、マゼンタの原色を有する均一な画像であり、YドットYDを示す画像は、イエロの原色を有する均一な画像であるとする。 FIG. 11 is a second diagram showing an example of an image used for image processing. FIG. 11A is an enlarged view of the halftone dot region described above in the scanned image SI. For example, in the example of FIG. 11A, the halftone dot region in the scanned image SI includes a plurality of M dot MDs and a plurality of Y dots YD. Here, for the sake of explanation, it is assumed that the image showing the M dot MD is a uniform image having the primary color of magenta, and the image showing the Y dot 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 represented 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 region MDb corresponding to the Y dot MD of the scanned image SI and the values of the pixels in the region YDb corresponding to the Y dot YD are the same as each other. As a comparative example, FIG. 11C shows 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 of FIG. 11 (A). In the luminance image YI, unlike the minimum component image MNI, the values of the pixels in the region MDd corresponding to the M dot MD of the scan image SI and the values of the pixels in the region YDd corresponding to the Y dot YD are different from each other. ..
以上の説明から解るように、最小成分画像MNIでは、スキャン画像SIにおいて、原稿内のC、M、Y、Kドットが形成された部分に対応する複数個の画素の値の間の差が、輝度画像YIよりも小さくなる。そして、最小成分画像MNIでは、スキャン画像SIにおいて、原稿内の地色(用紙の白色)を示す領域に対応する地色領域の画素の値が、ドットが形成された部分に対応する画素の値よりも大きくなる。 As can be seen from the above description, in the minimum component image MNI, in the scanned image SI, the difference between the values of the plurality of pixels corresponding to the portions where the C, M, Y, and K dots are formed in the document is large. It is smaller than the luminance image YI. Then, in the minimum component image MNI, in the scanned image SI, the pixel value of the ground color region corresponding to the region indicating the ground color (white of the paper) in the document is the pixel value corresponding to the portion where the dots are formed. Will be larger than.
S310では、CPU210は、生成された最小成分データに対して、該最小成分データによって示される最小成分画像MNIを平滑化する平滑化処理を実行して、平滑化済みの最小成分データを生成する。具体的には、CPU210は、最小成分データの各画素の値に、所定の平滑化フィルタ、本実施例では、縦5画素×横5画素のガウスフィルタを適用することによって、平滑化済みの各画素の値を算出する。平滑化済みの最小成分データは、スキャンデータの対応する画素の値(RGB値)に基づいて上述した処理で生成された平滑化済みの値を画素ごとに含んでいる。平滑化済みの最小成分データは、第2の画像データの例である。
In S310, the
S320では、CPU210は、平滑化済みの最小成分データに対して、当該平滑化済みの最小成分データによって示される平滑化済みの最小成分画像MNI内のエッジを抽出するエッジ抽出処理を実行して、エッジ抽出データを生成する。具体的には、CPU210は、平滑化済みの最小成分データの各画素の値に、図5のS130の処理と同一のソーベルフィルタを適用して、エッジ強度を算出する。CPU210は、これらのエッジ強度を、複数個の画素の値とするエッジ抽出データを生成する。
In S320, the
S330では、CPU210は、エッジ抽出データに対して、レベル補正処理を実行して、補正処理済みのエッジ抽出データを生成する。レベル補正処理は、図5のS140の処理と同一である。S340では、CPU210は、補正処理済みのエッジ抽出データに対して、図5のS150の処理と同様の二値化処理を実行して、二値画像データを生成する。二値画像データでは、上述したように、エッジ画素の値は、「1」とされ、非エッジ画素の値は、「0」とされる。
In S330, the
以上説明した第2の二値画像データ生成処理によれば、最小成分データに対してエッジ抽出処理が実行され、エッジ抽出データが生成される(S320)。そして、該エッジ抽出データを二値化する処理(S340)を含むエッジ画素特定処理が実行することによって、スキャン画像SIの複数個のエッジ画素が特定される(S330、S340、図2のS26)。最小成分データでは、図11を参照して説明したように、網点領域において、画素間の値の差を抑制できるので、その後に、エッジ画素を特定する際に、網点に起因するエッジ画素が特定されることを抑制できる。したがって、スキャン画像SI内のエッジ画素を適切に特定できる。 According to the second binary image data generation process described above, the edge extraction process is executed for the minimum component data, and the edge extraction data is generated (S320). Then, by executing the edge pixel identification process including the process of binarizing the edge extraction data (S340), a plurality of edge pixels of the scanned image SI are specified (S330, S340, S26 in FIG. 2). .. In the minimum component data, as described with reference to FIG. 11, since the difference in the values between the pixels can be suppressed in the halftone dot region, the edge pixels caused by the halftone dots are subsequently identified when the edge pixels are specified. Can be suppressed from being identified. Therefore, the edge pixels in the scanned image SI can be appropriately specified.
より具体的に説明すると、網点領域を構成する要素は、C、M、Y、Kの各ドットと、用紙の地色(白)と、の5種類である。最小成分データでは、これらの要素のうち、4種類の要素を示す画素の間の値の差を抑制できる。この結果、最小成分データを用いる場合には、網点のエッジを示すエッジ画素が特定されることを抑制することができる。 More specifically, there are five types of elements constituting the halftone dot region: dots C, M, Y, and K, and the background color (white) of the paper. In the minimum component data, it is possible to suppress the difference in value between the pixels indicating the four types of elements among these elements. As a result, when the minimum component data is used, it is possible to suppress the identification of edge pixels indicating the edges of halftone dots.
一方で、文字の色と背景の色とは、一方が、濃い色を有し、他方が薄い色を有する場合が多い。このために、文字と背景のうち、一方は、用紙の地色(白)を示す部分を比較的多く含み、他方は、C、M、Y、Kのドットを示す部分を比較的多く含む場合が多い。図10に示すように、最小成分データでは、C、M、Y、Kのドットを示す部分の画素の値と、用紙の地色(白)を示す部分の画素の値と、の間で、大きな差がある。このために、最小成分データを用いて、エッジ画素を特定すると、文字のエッジを構成するエッジ画素は、適切に特定できる可能性が高い。特に、イエロ(Y)は、C、M、Kと比較して濃度が低い(輝度が高い)。このために、用紙の地色(白)の背景に、イエロの文字がある場合には、輝度画像データを二値化しても、該イエロの文字のエッジを構成するエッジ画素を、適切に特定できない場合がある。本実施例では、このような場合でも該イエロの文字のエッジを構成するエッジ画素を、適切に特定できる。このために、輝度画像データを用いたエッジ画素の特定に加えて、最小成分データを用いたエッジ画素の特定を実行することで、輝度画像データだけでは、特定できない文字などのエッジ画素を特定し得る。この結果、スキャン画像SI内のエッジ画素の特定精度を向上できる。 On the other hand, in many cases, one of the character color and the background color has a dark color and the other has a light color. For this reason, one of the characters and the background contains a relatively large amount of the background color (white) of the paper, and the other contains a relatively large amount of C, M, Y, and K dots. There are many. As shown in FIG. 10, in the minimum component data, between the pixel value of the portion indicating the dots of C, M, Y, and K and the pixel value of the portion indicating the ground color (white) of the paper, There is a big difference. Therefore, when the edge pixels are specified using the minimum component data, there is a high possibility that the edge pixels constituting the edges of the character can be appropriately specified. In particular, yellow (Y) has a lower concentration (higher brightness) than C, M, and K. For this reason, when there are yellow characters on the background of the background color (white) of the paper, even if the luminance image data is binarized, the edge pixels constituting the edges of the yellow characters are appropriately specified. It may not be possible. In this embodiment, even in such a case, the edge pixels constituting the edge of the yellow character can be appropriately specified. For this purpose, in addition to the identification of the edge pixel using the luminance image data, the edge pixel identification using the minimum component data is executed to identify the edge pixel such as a character that cannot be identified only by the luminance image data. obtain. As a result, the accuracy of identifying the 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内のエッジ画素の特定精度を向上できる。
Further, a smoothing process is executed for the minimum component data before the edge extraction process (S310). As a result, the smoothing process can further suppress the difference in values between pixels in the halftone dot region in the minimum component image MNI. For example, in the halftone dot region in the scanned image SI, the portion indicating the dots is not necessarily C, M, Y due to the overlap of dots of C, M, Y, and K and the blurring during reading by the reading
以上説明したように、上記実施例では、2種類の単成分画像データ、すなわち、輝度画像データと、最小成分データと、を用いて、最終的にエッジ画素が特定される(図2のS22〜S26)。このように互いに異なる処理を用いて生成される2種類の単成分画像データを用いて、スキャン画像SI内の複数個のエッジ画素が特定されるので、スキャン画像SI内の複数個のエッジ画素の特定漏れを抑制できる。例えば、白の背景にイエロの文字がある場合には、白とイエロの輝度の差は比較的小さいので、輝度画像データを用いて、該文字のエッジを構成するエッジ画素を特定することは困難である。これに対して、図10(C)、(E)から解るように、最小成分データでは、白とイエロとの差が大きく現れるので、白の背景にイエロの文字がある場合には、最小成分データを用いて、該文字のエッジを構成するエッジ画素を特定することは容易である。また、例えば、マゼンタの背景にイエロの文字がある場合には、最小成分データには、マゼンタとイエロとの差が現れないので、最小成分データを用いて、該文字のエッジを構成するエッジ画素を特定することは困難である。これに対して、マゼンタの背景にイエロの文字がある場合には、マゼンタとイエロの輝度の差は、比較的大きいので、輝度画像データを用いて、該文字のエッジを構成するエッジ画素を特定することは容易である。 As described above, in the above embodiment, the edge pixels are finally specified by using two types of single component image data, that is, the luminance image data and the minimum component data (S22 to S22 in FIG. 2). S26). Since a plurality of edge pixels in the scan image SI are specified by using the two types of single component image data generated by using different processes in this way, the plurality of edge pixels in the scan image SI can be identified. Specific leakage can be suppressed. 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 identify the edge pixels that make up the edge of the character using the brightness image data. Is. On the other hand, as can be seen from FIGS. 10 (C) and 10 (E), in the minimum component data, a large difference between white and yellow appears. Therefore, when there are yellow characters on a white background, the minimum component It is easy to identify the edge pixels that make up the edge of the character using the data. Further, for example, when there is a yellow character in the background of magenta, the difference between magenta and yellow does not appear in the minimum component data, so the edge pixels constituting the edge of the character are used using the minimum component data. Is difficult to identify. On the other hand, when there is a yellow character in the background of magenta, the difference in brightness between magenta and yellow is relatively large, so the edge pixels constituting the edge of the character are specified using the brightness image data. It's easy to do.
また、輝度画像データに加えて用いられる単成分画像データは、最小成分データであるので、上述の通り、スキャン画像SI内の網点に起因するエッジ画素が特定されることは、抑制できる。 Further, since the single component image data used in addition to the luminance image data is the minimum component data, it is possible to suppress the identification of edge pixels caused by halftone dots in the scanned image SI as described above.
A−6:ブロック判定処理
図2のS28のブロック判定処理について説明する。図12は、ブロック判定処理のフローチャートである。図13は、スキャン画像SI上に配置される複数個のブロックBLの説明図である。ブロック判定処理は、上述したように、文字画素の候補である第2の文字候補画素と第2の文字候補画素ではない画素とを示すブロック判定データを、スキャン画像SI内に配置される複数個のブロックBLのそれぞれが文字を示す文字ブロックであるか否かをブロックBLごとに判断することによって生成する処理である。
A-6: Block determination process The block determination process of S28 in FIG. 2 will be described. FIG. 12 is a flowchart of the block determination process. FIG. 13 is an explanatory diagram of a plurality of blocks BL arranged on the scanned image SI. As described above, in the block determination process, a plurality of block determination data indicating a second character candidate pixel that is a candidate for a character pixel and a pixel that is not a second character candidate pixel are arranged in the scan image SI. This is a process generated by determining for each block BL whether or not each of the block BLs of the above is a character block indicating a character.
S400では、CPU210は、ブロック判定データを生成するためのキャンバスデータをメモリ(具体的には、揮発性記憶装置220のバッファ領域)に準備する。キャンバスデータによって示されるキャンバス(初期画像)は、スキャン画像SIと同じサイズの画像、すなわち、同じ画素数の画像である。キャンバスデータの各画素の値は、所定の初期値(例えば、0)である。
In S400, the
S405では、CPU210は、スキャン画像SIに、注目ブロックを設定する。最初の注目ブロックは、本実施例では、図13の左上のブロックBL(1)である。1個のブロックは、N個(Nは2以上の整数)の画素を含む矩形の領域である。ここで、図13において、スキャン画像SI上にマトリクス状に配置された破線で示される複数個の升目は、サブブロックSBを示している。1個のサブブロックSBは、k個(kは、1≦k<Nをを満たす整数)の画素を含む矩形の領域である。本実施例では、サブブロックSBは、縦M画素×横M画素(Mは、1以上の整数)の領域である(k=(M×M))。例えば、1個のブロックBLは、本実施例では、縦L個×横L個(Lは、2以上の整数)のサブブロックSBを含む領域である。すなわち、本実施例の各ブロックBLは、縦(L×M)画素×横(L×M)画素の領域である。本実施例では、M=5、L=5であるので、各ブロックBLは、縦25画素×横25画素の領域である(N=625)。
In S405, the
S410では、CPU210は、スキャンデータ(RGB画像データ)のうち、注目ブロック内の画像を示す部分画像データ、注目ブロック内の複数個の画素の値の分布を示すヒストグラムデータを生成する。ヒストグラムデータは、R、G、Bの1画素あたり3個の成分値のそれぞれを、当該成分値に応じた複数個のクラスに分類することによって生成される。本実施例では、R、G、Bの各成分の値が取り得る256階調の値のそれぞれを1個のクラスとして、ヒストグラムデータが生成される。これにより、文字が有彩色で表現されたカラー画像に対しても、ブロックBLが文字ブロックであるか否かを精度良く判断できる。
In S410, the
図14は、ヒストグラムデータによって示されるヒストグラムの一例を示す図である。図14(A)のヒストグラムHGaは、文字Ob7(図3(A))のエッジ部分に位置するブロックBLaのヒストグラムである。図14(B)のヒストグラムHGbは、写真Ob3(図3(A))内のエッジ部分に位置するブロックBLbのヒストグラムである。 FIG. 14 is a diagram showing an example of the histogram shown by the histogram data. The histogram HGa in FIG. 14 (A) is a histogram of the block BLa located at the edge portion of the character Ob7 (FIG. 3 (A)). The histogram HGb in FIG. 14 (B) is a histogram of the block BLb located at the edge portion in the photograph Ob3 (FIG. 3 (A)).
S413では、CPU210は、生成されたヒストグラムデータを用いて、注目ブロック内の複数個の画素の値の標準偏差σを算出する。標準偏差σは、以下の式(1)を用いて算出される。
In S413, the
ここで、Viは、注目ブロック内の(3×N)個の成分値である。成分値の個数は、N個の画素のそれぞれが、3個の成分値を含むために、合計で(3×N)個である。Vaveは、注目ブロック内の(3×N)個の成分値の平均値である。標準偏差σは、注目ブロック内の画素の値のばらつきの程度を示す指標値であり、標準偏差σが大きいほど、注目ブロック内の画素の値のばらつきが大きい。
Here, Vi is (3 × N) component values in the block of interest. The number of component values is (3 × N) in total because each of the N pixels includes three component values. Wave is the average value of (3 × N) component values in the block of interest. The standard deviation σ is an index value indicating the degree of variation in the values of the pixels in the block of interest, and the larger the standard deviation σ is, the greater the variation in the values of the pixels in the block of interest.
ここで、文字の読みやすさのために、一般的に、文字の色と、文字の背景の色とは、明るさが大きく異なる場合が多い。例えば、文字の色が、比較的暗い色(例えば、黒)にされる場合には、文字の背景の色は、比較的明るい色(例えば、白)にされやすい。また、文字の色が、比較的明るい色にされる場合には、文字の背景の色は、比較的暗い色にされやすい。また、文字のエッジ部分では、エッジ強度が比較的高いために、画素の値が急激に変化する。このために、縦25画素×横25画素程度の小さなブロックが設定される場合であっても、文字のエッジ部分に位置するブロックBLaのヒストグラムHGaには、比較的離れた位置に2個のピークVa、Vbが現れる(図14(A))。この結果、文字のエッジ部分に位置するブロックBLaの標準偏差σt(図14(A))は、比較的大きくなる。 Here, in order to make the characters easier to read, in general, the color of the characters and the color of the background of the characters are often significantly different in brightness. For example, when the color of the characters is relatively dark (for example, black), the background color of the characters is likely to be relatively light (for example, white). Further, when the color of the character is made relatively light, the background color of the character is likely to be made relatively dark. Further, at the edge portion of the character, since the edge strength is relatively high, the pixel value changes abruptly. For this reason, even when a small block of about 25 pixels vertically × 25 pixels horizontally is set, the histogram HGa of the block BLa located at the edge portion of the character has two peaks at relatively distant positions. Va and Vb appear (FIG. 14 (A)). As a result, the standard deviation σt (FIG. 14 (A)) of the block BLa located at the edge portion of the character becomes relatively large.
一方、写真内のエッジ(例えば、写真内の網点やオブジェクトのエッジ)では、必ずしも、エッジの両側で明るさ等が大きく異なるとは限らない。また、写真内のエッジでは、文字と比較するとエッジ強度が一般的に低いために、画素の値がなだらかに変化する。このために、縦25画素×横25画素程度の小さなブロックが設定される場合には、写真内のエッジ部分に位置するブロックBLbに含まれる画素の値の分布範囲は、比較的狭くなる。このために、写真内のエッジ部分に位置するブロックBLbのヒストグラムHGbには、比較的近い位置に2個のピークVb、Vdが現れる。この結果、写真内のエッジ部分に位置するブロックBLbの標準偏差σp(図14(B))は、比較的小さくなる。 On the other hand, the brightness and the like of the edges in the photograph (for example, halftone dots in the photograph and the edges of objects) are not always significantly different on both sides of the edges. Further, at the edge in the photograph, the edge strength is generally lower than that of the character, so that the pixel value changes gently. Therefore, when a small block of about 25 pixels vertically × 25 pixels horizontally is set, the distribution range of the pixel values included in the block BLb located at the edge portion in the photograph becomes relatively narrow. For this reason, two peaks Vb and Vd appear at relatively close positions in the histogram HGb of the block BLb located at the edge portion in the photograph. As a result, the standard deviation σp (FIG. 14 (B)) of the block BLb located at the edge portion in the photograph becomes relatively small.
このような標準偏差σの傾向を利用して、CPU210は、後述するS415〜S430に示すように、標準偏差σに基づいて、注目ブロックが、文字を示す文字ブロック、文字を示さない非文字ブロック、文字を示すか不明である不明ブロックのいずれであるかを判断する。CPU210は、標準偏差σが、TH1≦σである場合には、注目ブロックは、文字ブロックであると判断する。CPU210は、標準偏差σが、TH2≦σ<TH1である場合には、注目ブロックは、不明ブロックであると判断する。CPU210は、標準偏差σが、σ<TH2である場合には、注目ブロックは、非文字ブロックであると判断する。閾値TH1、TH2は、例えば、複数個の文字や写真を含む画像データを解析することによって、経験的に、予め定められる。
Utilizing such a tendency of the standard deviation σ, the
ここで、文字が比較的大きなサイズである場合には、文字のエッジだけではなく、文字の内部に注目ブロックが設定され得る。この場合には、文字は一般的に単色であるので、標準偏差σは、小さな値となる。したがって、この場合には、文字を構成する画素を含む注目ブロックが、非文字ブロックであると判断されてしまう。しかしながら、本実施例では、文字画素に対して鮮鋭化処理が行われて文字のエッジが鮮鋭化されるとともに、非文字画素に対して平滑化処理が行われて写真などの非文字画像が平滑化される。このために、文字のエッジ部分の画素を含むブロックが、精度良く文字ブロックであると判断されれば良く、文字の内部の画素のみを含むブロックは、非文字ブロックと判断されても構わない。 Here, when the character has a relatively large size, the attention block can be set not only at the edge of the character but also inside the character. In this case, the standard deviation σ is a small value because the characters are generally monochromatic. Therefore, in this case, the attention block including the pixels constituting the character is determined to be a non-character block. However, in this embodiment, character pixels are sharpened to sharpen the edges of characters, and non-character pixels are smoothed to smooth non-character images such as photographs. Be transformed. Therefore, the block including the pixels of the edge portion of the character may be determined to be a character block with high accuracy, and the block containing only the pixels inside the character may be determined to be a non-character block.
なお、1個の注目ブロック内に、小さな文字の全体が含まれる場合には、エッジと内部の区別なく、小さな文字の全体が文字画素として特定される。この場合には、注目ブロック内に、文字画素と、文字の背景を構成する画素と、の両方が含まれるので、注目ブロックの標準偏差σは、比較的大きくなる。この場合には、文字の全体を含む注目ブロックは、文字ブロックと精度良く判断される。 When the entire small character is included in one block of interest, the entire small character is specified as a character pixel without distinguishing between the edge and the inside. In this case, since both the character pixels and the pixels constituting the background of the characters are included in the attention block, the standard deviation σ of the attention block is relatively large. In this case, the attention block including the entire character is accurately determined as the character block.
また、写真内のエッジではなく、写真の外縁と、写真の外側部分と、の間のエッジ部分に注目ブロックが設定され得る(例えば、図14(B)のブロックBLx)。この場合には、写真の外縁と、写真の外側部分と、の間のエッジでは、エッジの両側で明るさ等が大きく異なり得る。また、該エッジでは、エッジ強度が比較的高い場合がある。したがって、この場合には、写真の外縁を含む注目ブロックが、文字ブロックであると判断されてしまう。しかしながら、写真の外縁のエッジ部分に鮮鋭化処理が行われて、写真の外縁が強調されても、画質上の問題はない。このために、エッジ強調されると画質上の問題がある写真内のエッジ(例えば、網点やオブジェクトのエッジ)を含むブロックが、精度良く非文字ブロックであると判断されれば良く、写真の外縁のエッジを含むブロックは、文字ブロックと判断されても構わない。 Further, the attention block may be set not at the edge in the photograph but at the edge portion between the outer edge of the photograph and the outer portion of the photograph (for example, the block BLx in FIG. 14B). In this case, at the edge between the outer edge of the photograph and the outer portion of the photograph, the brightness and the like may be significantly different on both sides of the edge. Further, at the edge, the edge strength may be relatively high. Therefore, in this case, the block of interest including the outer edge of the photograph is determined to be the character block. However, even if the edge portion of the outer edge of the photograph is sharpened to emphasize the outer edge of the photograph, there is no problem in image quality. For this reason, a block containing an edge (for example, a halftone dot or an object edge) in a photo that has a problem in image quality when the edge is emphasized may be accurately determined to be a non-character block, and the photo A block including an outer edge may be determined as a character block.
図15は、ブロックBLごとの判断の一例を示す図である。例えば、図15(A)のブロックBL(1)や図15(B)のブロックBL(2)が注目ブロックである場合には、注目ブロック内の比較的広い範囲を文字が占めているので、注目ブロックは、文字ブロックであると判断される。例えば、図15(C)のブロックBL(3)が注目ブロックである場合には、注目ブロック内に文字が含まれているものの、文字が占める範囲は比較的狭いので、注目ブロックは、不明ブロックであると判断される。例えば、図15(D)のブロックBL(4)が注目ブロックである場合には、注目ブロック内に文字が含まれていないので、注目ブロックは、非文字ブロックであると判断される。以下、S415〜S430の処理を具体的に説明する。 FIG. 15 is a diagram showing an example of determination for each block BL. For example, when the block BL (1) of FIG. 15 (A) and the block BL (2) of FIG. 15 (B) are attention blocks, the characters occupy a relatively wide range in the attention block, so that the characters occupy a relatively wide range. The attention block is determined to be a character block. For example, when the block BL (3) of FIG. 15 (C) is the attention block, the character is included in the attention block, but the range occupied by the character is relatively narrow, so that the attention block is an unknown block. Is judged to be. For example, when the block BL (4) of FIG. 15 (D) is the attention block, the attention block is determined to be a non-character block because no character is included in the attention block. Hereinafter, the processes of S415 to S430 will be specifically described.
S415では、CPU210は、S410にて算出された標準偏差σが閾値TH1以上であるか否かを判断する。標準偏差σが閾値TH1以上である場合には(S415:YES)、注目ブロックは文字ブロックであると判断される。このために、この場合には、S420にて、CPU210は、注目ブロック内の全画素の値を、文字を示す値に設定する。標準偏差σが閾値TH1未満である場合には(S415:NO)、S420はスキップされる。
In S415, the
図16は、ブロック判定データにおける画素の値の設定の一例を示す図である。図16(A)〜(D)には、ブロック判定データによって示されるブロック判定画像BIが概念的に示されている。図15(A)のブロックBL(1)や図15(B)のブロックBL(2)が注目ブロックである場合には、注目ブロックは文字ブロックであると判断されるので、ブロック判定画像BIにおいても、図16(A)、(B)に示すように、ブロックBL(1)、BL(2)内の全ての画素の値が、文字を示す値「1」に設定される。 FIG. 16 is a diagram showing an example of setting a pixel value in the block determination data. 16 (A) to 16 (D) conceptually show the block determination image BI represented by the block determination data. When the block BL (1) of FIG. 15 (A) and the block BL (2) of FIG. 15 (B) are attention blocks, it is determined that the attention block is a character block. Also, as shown in FIGS. 16A and 16B, the values of all the pixels in the blocks BL (1) and BL (2) are set to the value "1" indicating the character.
S425では、CPU210は、標準偏差σが閾値TH2未満であるか否かを判断する。標準偏差σが閾値TH2未満である場合には(S425:YES)、注目ブロックは非文字ブロックであると判断される。このために、この場合には、S430にて、CPU210は、注目ブロック内の全画素の値を非文字を示す値に設定する。標準偏差σが閾値TH2以上である場合には(S425:NO)、S430はスキップされる。
In S425, the
図15(D)のブロックBL(4)が注目ブロックである場合には、注目ブロックは非文字ブロックであると判断されるので、ブロック判定画像BIにおいても、図16(D)に示すように、ブロックBL(4)内の全ての画素の値が、非文字を示す値「2」に設定される。 When the block BL (4) of FIG. 15 (D) is the block of interest, it is determined that the block of interest is a non-character block. Therefore, also in the block determination image BI, as shown in FIG. 16 (D). , The values of all the pixels in the block BL (4) are set to the value "2" indicating non-characters.
なお、標準偏差σが閾値TH2以上であり、かつ、閾値TH1未満である場合には(S415:NO、かつ、S425:NO)、注目ブロックは、不明ブロックであると判断される。このために、この場合には、注目ブロック内の全ての画素の値は変更されない。すなわち、この時点で、文字を示す値「1」を有する画素は、文字を示す値のまま維持され、非文字を示す値「2」を有する画素は、非文字を示す値のまま維持され、不明を示す値「0」を有する画素は、不明を示す値のまま維持される。 If the standard deviation σ is equal to or greater than the threshold value TH2 and less than the threshold value TH1 (S415: NO and S425: NO), the block of interest is determined to be an unknown block. Therefore, in this case, the values of all the pixels in the block of interest are not changed. That is, at this point, the pixel having the value "1" indicating the character is maintained as the value indicating the character, and the pixel having the value "2" indicating the non-character is maintained as the value indicating the non-character. Pixels having a value "0" indicating unknown are maintained at the value indicating unknown.
図15(C)のブロックBL(3)が注目ブロックである場合には、注目ブロックは不明ブロックであると判断されるので、ブロック判定画像BIにおいて、図16(C)に示すように、ブロックBL(4)内の全ての画素の値は、変更されることなく、維持される。 When the block BL (3) of FIG. 15 (C) is the block of interest, it is determined that the block of interest is an unknown block. Therefore, in the block determination image BI, as shown in FIG. 16 (C), the block is blocked. The values of all the pixels in BL (4) are maintained unchanged.
S435では、CPU210は、注目ブロックを右方向にM画素だけ移動する。すなわち、注目ブロックは、右方向に1個のサブブロックSB分だけ移動される。例えば、図13のブロックBL(1)が注目ブロックである場合には、ブロックBL(2)が新たな注目ブロックに設定される。図13のブロックBL(q−1)が注目ブロックである場合には、ブロックBL(q)が新たな注目ブロックに設定される。
In S435, the
S440では、CPU210は、注目ブロックを右方向にM画素だけ移動した結果、注目ブロックの右端は、スキャン画像SIの右端よりも右側に移動したか否かを判断する。すなわち、移動後の新たな注目ブロックが、スキャン画像SIの右側にはみ出したか否かを判断する。例えば、新たな注目ブロックが、図13のブロックBL(q)やブロックBL(e)である場合には、注目ブロックの右端は、スキャン画像SIの右端よりも右側に移動したと判断される。
In S440, the
注目ブロックの右端が、スキャン画像SIの右端よりも右側に移動していない場合には(S440:NO)、CPU210は、S410に戻る。このように、例えば、注目ブロックを右方向にM画素ずつずらしながら、順次に、ブロックごとの判断(S410〜S430)が行われる。図13の例では、ブロックBL(1)、BL(2)、BL(3)の順に、各ブロックBLが、文字ブロック、非文字ブロック、不明ブロックのいずれであるかが判断される。
When the right end of the attention block has not moved to the right side of the right end of the scanned image SI (S440: NO), the
注目ブロックの右端が、スキャン画像SIの右端よりも右側に移動した場合には(S440:YES)、S445にて、CPU210は、注目ブロックをスキャン画像SIの左端に移動し、S450にて、注目ブロックを下方向にM画素だけ移動する。
When the right end of the attention block is moved to the right side of the right end of the scan image SI (S440: YES), in S445, the
S455では、CPU210は、注目ブロックを下方向にM画素だけ移動した結果、注目ブロックの下端は、スキャン画像SIの下端よりも下側に移動したか否かを判断する。すなわち、移動後の新たな注目ブロックが、スキャン画像SIの下側にはみ出したか否かを判断する。例えば、新たな注目ブロックが、図13のブロックBL(e+1)である場合には、注目ブロックの下端は、スキャン画像SIの下端よりも下側に移動したと判断される。例えば、移動後の新たな注目ブロックが、図13のブロックBL(e+1)である場合には、注目ブロックの下端は、スキャン画像SIの下端よりも下側に移動したと判断される。
In S455, the
注目ブロックの下端が、スキャン画像SIの下端よりも下側に移動していない場合には(S455:NO)、CPU210は、S410に戻る。このように、例えば、注目ブロックを下方向にM画素ずつずらしながら、順次に、左端から右端までの1行分のブロックBLの判断が、一行ずつ行われる。例えば、図13の右端のブロックBL(q−1)の次に、判断の対象となる注目ブロックは、M画素だけ下側の行の左端のブロックBL(q+1)である。
If the lower end of the attention block has not moved below the lower end of the scanned image SI (S455: NO), the
注目ブロックの下端が、スキャン画像SIの下端よりも下側に移動した場合には(S455:YES)、全てのブロックBLの判断が終了したので、CPU210は、S460に処理を進める。
When the lower end of the block of interest moves below the lower end of the scanned image SI (S455: YES), the determination of all the blocks BL is completed, so the
S460では、CPU210は、ブロック判定データに、不明を示す値「0」が残っているか否かを判断する。不明を示す値が残っている場合には、S465にて、CPU210は、不明を示す値を、文字を示す値「1」に設定する。この結果、ブロック判定データの各画素の値は、文字を示す値「1」と非文字を示す値「2」とのいずれかとなる。
In S460, the
S470では、CPU210は、非文字を示す値「2」を「0」に変更して、ブロック判定データを「1」と「0」のいずれかの値をとる二値データに変換する。この結果、文字を値、すなわち、上述した第2の文字候補画素であることを示す値「1」と、非文字を示す値、すなわち、上述した第2の文字候補画素でないことを示す値「0」と、のいずれかの値を画素ごとに有するブロック判定データが生成される。
In S470, the
以上説明した本実施例の文字特定処理(図2のS20)では、図2のS22〜S26にて、CPU210は、スキャン画像SI内のエッジを構成するエッジ画素であるか否かを画素ごとに判断することによって、複数個の第1の候補画素を決定する。図2のS28にて、CPU210は、スキャン画像SI上に配置される複数個のブロックBLのそれぞれが、文字を示す文字ブロックであるか否かをブロックごとに判断することによって、複数個の第2の文字候補画素を決定する。ブロックごとの判断では、CPU210は、ブロックBLのそれぞれについて、ブロックBL内の複数個の画素の分布を示すヒストグラムデータを生成し(図12のS410)、ヒストグラムデータを用いて、複数個のブロックBLのそれぞれが、文字ブロックであるか否かを判定する(図12のS413〜S430)。図2のS29にて、CPU210は、スキャン画像SI内の複数個の画素のうち、第1の文字候補画素であると決定され、かつ、第2の文字候補画素であると決定される画素を、文字画素として特定する。この結果、例えば、画素ごとの判断によって、網点(例えば、写真内の網点)を構成する画素が第1の文字候補画素であると誤って決定されたとしても、ブロックごとの判断によって、網点を構成する画素が第2の文字候補画素であると決定されない場合には、網点を構成する画素が文字画素であると誤って特定されることがない。ブロックBLごとの判断にヒストグラムデータを用いることにより、煩雑な処理を要することなく第2の文字候補画素を決定できる。したがって、例えば、スキャン画像SIが網点を含む画像であっても、スキャン画像SI内の文字画素を精度良く特定できる。
In the character identification process of the present embodiment described above (S20 in FIG. 2), in S22 to S26 of FIG. 2, the
図17は、実施例の効果について説明する図である。図17(A)〜(D)には、スキャンデータによって示されるスキャン画像SI、エッジ特定データによって示されるエッジ特定画像EI、ブロック判定データによって示されるブロック判定画像BI、文字特定データによって示される文字特定画像TIが、それぞれ概念的に示されている。これらの画像SI、EI、BI、TI内の破線で示す升目は、それぞれ、画素Pxを示している。 FIG. 17 is a diagram illustrating the effect of the embodiment. 17 (A) to 17 (D) show a scan image SI indicated by scan data, an edge identification image EI indicated by edge identification data, a block determination image BI indicated by block determination data, and characters indicated by character identification data. Each specific image TI is conceptually shown. The squares shown by the broken lines in these images SI, EI, BI, and TI each indicate the pixel Px.
図17(A)に示すスキャン画像SIのように、スキャン画像SIには、文字Txとともに、文字以外のオブジェクト(例えば、写真)を構成する網点DTが含まれ得る。これは、上述したように、スキャンデータが、印刷物を読み取ることによって生成されたデータであるためである。本実施例のS22〜S26のエッジ画素(第1の文字候補画素)の特定処理では、上述したように、網点が第1の文字候補画素として誤って特定されることを抑制するための様々な工夫が成されているが、文字のエッジを示す第1の文字候補画素の特定漏れを抑制することを重視すれば、網点が第1の文字候補画素として誤って特定されることを十分に抑制することは困難である。このために、例えば、図17(B)のエッジ特定画像EIに示すように、エッジ特定データにおいて、文字Txに対応するエッジ画素Egtだけでなく、網点DTに対応するエッジ画素Egdも第1の文字候補画素として特定されてしまい得る。 Like the scanned image SI shown in FIG. 17A, the scanned image SI may include the characters Tx as well as halftone dot DTs that form objects other than the characters (for example, a photograph). This is because, as described above, the scan data is the data generated by reading the printed matter. In the process of specifying the edge pixels (first character candidate pixels) of S22 to S26 of this embodiment, as described above, various halftone dots are used to prevent the halftone dots from being erroneously specified as the first character candidate pixels. However, if emphasis is placed on suppressing the omission of identification of the first character candidate pixel indicating the edge of the character, it is sufficient that the halftone dot is erroneously specified as the first character candidate pixel. It is difficult to suppress it. For this purpose, for example, as shown in the edge specific image EI of FIG. 17B, not only the edge pixel Egt corresponding to the character Tx but also the edge pixel Egd corresponding to the halftone dot DT is the first in the edge specific data. Can be identified as a character candidate pixel of.
本実施例のS28のブロック判定処理では、ブロックBLごとに、ブロック内のN個の画素の位置とN個の画素の値とに応じて、文字ブロックか否かを含む判断が行われるので、画素ごとの判断と比較して、空間的な分解能は粗くなるものの、判断の誤りは比較的少なくなる。より具体的には、本実施例では、文字を含むブロックBLと非文字(特に写真)を含むブロックBLとでは、画素の値の分布特性が異なる(図13)ことを利用して、ブロックBL内の画素の分布を示すヒストグラムデータを用いて、ブロックBLごとに文字ブロックか否かが判断される。このために、例えば、図17(C)のブロック判定画像BIでは、例えば、大まかではあるが、文字Txを含む領域内の画素は、第2の文字候補画素として特定され、網点DTを含む領域内の画素は、第2の文字候補画素として特定されない。 In the block determination process of S28 of this embodiment, for each block BL, determination including whether or not it is a character block is performed according to the positions of N pixels in the block and the values of N pixels. Although the spatial resolution is coarser than the judgment for each pixel, the judgment error is relatively small. More specifically, in this embodiment, the block BL containing characters and the block BL containing non-characters (particularly photographs) have different pixel value distribution characteristics (FIG. 13). Using the histogram data showing the distribution of the pixels in the block BL, it is determined whether or not the block BL is a character block. For this reason, for example, in the block determination image BI of FIG. 17C, for example, although roughly, the pixels in the region containing the character Tx are specified as the second character candidate pixels and include the halftone dot DT. Pixels in the region are not specified as second character candidate pixels.
この結果、エッジ特定データと、ブロック判定データと、の論理積を取って文字特定データを生成すれば、図17(D)の文字特定画像TIに示すように、文字Txを示す画素を文字画素として適切に特定し、かつ、網点DTを示す画素を非文字画素として適切に特定することができる。 As a result, if the character identification data is generated by taking the logical product of the edge identification data and the block determination data, the pixel indicating the character Tx can be converted into a character pixel as shown in the character identification image TI of FIG. 17 (D). And the pixel indicating the halftone dot DT can be appropriately specified as a non-character pixel.
この結果、例えば、網点DTを示すにも拘わらずに、誤って文字画素として特定された画素を除去するために、文字特定データに対して、孤立した文字画素を除去するノイズ除去処理を実行する必要もなくなる。このようなノイズ除去処理を実行すると、網点DTを示す文字画素だけでなく、例えば、ピリオド、カンマ、濁音などを示す孤立しがちな文字画素も除去されてしまう場合がある。ピリオド、カンマ、濁音などを示す文字画素は、除去されるべきではないので、誤って除去されると、文字の一部がぼけるなどの不都合が生じて、出力される画像の画質が劣化し得る。 As a result, for example, in order to remove a pixel erroneously specified as a character pixel even though the halftone dot DT is indicated, a noise removal process for removing an isolated character pixel is executed for the character identification data. You don't even have to. When such noise removal processing is executed, not only character pixels indicating halftone dot DT but also character pixels that tend to be isolated, such as periods, commas, and voiced sound, may be removed. Character pixels indicating periods, commas, voiced sounds, etc. should not be removed, so if they are removed by mistake, inconveniences such as blurring of part of the characters may occur and the image quality of the output image may deteriorate. ..
さらに、上記実施例では、CPU210は、ヒストグラムデータを用いて算出される標準偏差σがTH1以上であるか否かを判断し(図12のS415)、標準偏差σがTH1以上である場合に(図12のS415にてYES)、注目ブロックは文字ブロックであると判断し(図12のS420)、標準偏差σがTH1未満である場合である場合に(図12のS415にてNO)、注目ブロックは、非文字ブロックまたは不明ブロックであると判断する(図12のS425、S430)。換言すれば、CPU210は、ヒストグラムデータを用いて、注目ブロック内の複数個の画素の値のばらつきが基準以上であるか否かを判断し、注目ブロック内の複数個の画素の値のばらつきが基準以上である場合に、注目ブロックは文字ブロックであると判断し、注目ブロック内の複数個の画素の値のばらつきが基準未満である場合に、注目ブロックは文字ブロックでないと判断する。この結果、ブロックBL内の複数個の画素の値のばらつきに基づいて、ブロックBLが文字ブロックであるか否かを精度良く判断できる。
Further, in the above embodiment, the
さらに、上記実施例では、スキャンデータの複数個の画素の値のそれぞれは、複数個の成分値を含むRGB値であり、生成されるヒストグラムデータは、複数個の成分値のそれぞれを、その値に応じて分類して得られるデータである(図13)。この結果、例えば、文字が有彩色で表現されたカラー画像データ(本実施例ではRGB画像データ)についても、画像内のブロックBLが文字であるか否かを精度良く判断できる。 Further, in the above embodiment, each of the values of the plurality of pixels of the scan data is an RGB value including the plurality of component values, and the generated histogram data is the value of each of the plurality of component values. It is the data obtained by classifying according to (FIG. 13). As a result, for example, even for color image data in which characters are represented by chromatic colors (RGB image data in this embodiment), it is possible to accurately determine whether or not the block BL in the image is a character.
さらに、上記実施例によれば、例えば、図15、図16に示すように、ブロックBL(1)、ブロックBL(2)、ブロックBL(3)、ブロックBL(4)は、互いに一部が重なっている。CPU210は、これらのブロックの重複領域内のn個の画素(nは0<n<Nを満たす整数)が文字を示す画素(第2の文字候補画素)であるか否かを、互いに重複する複数個のブロックの判断結果の少なくとも一方に基づいて決定する。この結果、各ブロックBLよりも小さなサブブロックSBの単位で、第2の文字候補画素であるか否かを示すブロック判定データを生成できる。
Further, according to the above embodiment, for example, as shown in FIGS. 15 and 16, the block BL (1), the block BL (2), the block BL (3), and the block BL (4) are partially connected to each other. overlapping. The
例えば、本実施例では、S420、S430に示すように、注目ブロックが文字ブロックまたは非文字ブロックであると判断されると、ブロック判定データにおいて、注目ブロック内の全ての画素の値が、判断結果に応じて設定される。すなわち、第1のブロックと第2のブロックとの両方が、不明ブロック以外のブロック(すなわち、文字ブロックまたは非文字ブロック)であると判断されるとする。この場合には、第1のブロックと第2のブロックの重複領域については、第1のブロックと第2のブロックとのうち、判断の処理順序が後のブロックについての判断結果が優先される(図16(A)〜(D)参照)。 For example, in this embodiment, as shown in S420 and S430, when it is determined that the attention block is a character block or a non-character block, in the block determination data, the values of all the pixels in the attention block are the determination results. It is set according to. That is, it is assumed that both the first block and the second block are determined to be blocks other than the unknown block (that is, a character block or a non-character block). In this case, with respect to the overlapping area of the first block and the second block, the judgment result of the block whose judgment processing order is later than that of the first block and the second block has priority ( 16 (A)-(D)).
また、本実施例では、上述したように、注目ブロックが不明ブロックであると判断されると、注目ブロック内の全ての画素の値が変更されない。すなわち、第1のブロックと第2のブロックとのうちの一方が、不明ブロックであると判断され、他方が、文字ブロックおよび非文字ブロックのいずれかであると判断されるとする。この場合には、第1のブロックと第2のブロックの重複領域については、第1のブロックと第2のブロックとのうち、文字ブロックおよび非文字ブロックのいずれかであると判断されたブロックについての判断結果が優先される(図16(B)〜(D)参照)。換言すれば、第1のブロックが不明ブロックであると判断され、かつ、第2のブロックが文字ブロックであると判断される場合には、重複領域内の画素は、文字を示す画素(第2の文字候補画素)であると決定される。第1のブロックが不明ブロックであると判断され、かつ、第2のブロックが非文字ブロックであると判断される場合には、重複領域内の画素は、非文字を示す画素(第2の文字候補画素でない画素)であると決定される。さらに、第1のブロックが文字ブロックであると判断され、かつ、第2のブロックが不明ブロックであると判断される場合には、重複領域内の画素は、文字を示す画素であると決定される。第1のブロックが非文字ブロックであると判断され、かつ、第2のブロックが不明ブロックであると判断される場合には、重複領域内の画素は、非文字を示す画素であると決定される。この結果、文字ブロック、非文字ブロック、不明ブロックのいずれであるかを、ブロックごとに判断することによって、重複領域内の画素が文字を示す画素(第2の文字候補画素)であるか否かを適切に決定できる。 Further, in this embodiment, as described above, when it is determined that the attention block is an unknown block, the values of all the pixels in the attention block are not changed. That is, it is assumed that one of the first block and the second block is determined to be an unknown block, and the other is determined to be either a character block or a non-character block. In this case, regarding the overlapping area of the first block and the second block, the block determined to be either a character block or a non-character block among the first block and the second block. (See FIGS. 16B to 16D). In other words, if the first block is determined to be an unknown block and the second block is determined to be a character block, the pixels in the overlapping area are pixels indicating characters (second). Character candidate pixel). When the first block is determined to be an unknown block and the second block is determined to be a non-character block, the pixels in the overlapping area are pixels indicating non-characters (second character). It is determined that the pixel is not a candidate pixel). Further, when it is determined that the first block is a character block and the second block is an unknown block, the pixels in the overlapping region are determined to be characters indicating characters. To. When the first block is determined to be a non-character block and the second block is determined to be an unknown block, the pixels in the overlapping region are determined to be non-character pixels. To. As a result, by determining whether it is a character block, a non-character block, or an unknown block for each block, whether or not the pixel in the overlapping area is a pixel indicating a character (second character candidate pixel). Can be determined appropriately.
B.変形例: B. Modification example:
(1)上記実施例の図12のブロック判定処理では、標準偏差σを用いて、注目ブロックが、文字ブロックであるか否かを判断している。これに代えて、例えば、別の判断手法を用いて、注目ブロックが、文字ブロックであるか否かを判断しても良い。例えば、注目ブロック内の画素の複数個の画素のばらつきを示す指標値であって、標準偏差σとは異なる指標値を用いて、注目ブロックが、文字ブロックであるか否かを判断しても良い。注目ブロック内の画素の複数個の画素のばらつきを示す指標値は、例えば、ヒストグラムにおける複数個のピークのうち、最小の成分値に対応するピークと、最大の成分値に対応するピークと、の間の距離であっても良い。 (1) In the block determination process of FIG. 12 of the above embodiment, it is determined whether or not the block of interest is a character block by using the standard deviation σ. Instead of this, for example, another determination method may be used to determine whether or not the block of interest is a character block. For example, even if it is determined whether or not the attention block is a character block by using an index value indicating the variation of a plurality of pixels in the attention block and different from the standard deviation σ. good. The index value indicating the variation of a plurality of pixels in the block of interest is, for example, a peak corresponding to the smallest component value and a peak corresponding to the largest component value among the plurality of peaks in the histogram. It may be the distance between them.
また、CPU210は、ブロックBLのヒストグラムデータを用いて導かれる特徴であって、ブロックBL内の画素の複数個の画素のばらつきとは異なる特徴を用いて、注目ブロックが、文字ブロックであるか否かを判断しても良い。例えば、文字を示すブロックBLでは、ヒストグラムにおいて、背景に対応する比較的細く高いピークと、文字に対応する比較的細く高いピークと、が現れる。したがって、CPU210は、注目ブロックのヒストグラムにおいて、基準より細く、基準より高いピークが2個検出される場合には、当該注目ブロックは文字ブロックであると判断しても良い。
Further, the
(2)上記実施例のブロック判定処理では、縦(L×M)画素×横(L×M)画素の注目ブロックを、M画素ずつずらしながら、文字ブロックであるか否かを判断するので、スキャン画像SI上に配置される複数個のブロックは互いに重複している(図13)。これに代えて、複数個のブロックが互いに重複しないように、スキャン画像SI上に複数個のブロックが配置されても良い。 (2) In the block determination process of the above embodiment, it is determined whether or not the block is a character block while shifting the attention block of vertical (L × M) pixels × horizontal (L × M) pixels by M pixels. A plurality of blocks arranged on the scanned image SI overlap each other (FIG. 13). Instead of this, a plurality of blocks may be arranged on the scanned image SI so that the plurality of blocks do not overlap each other.
(3)上記実施例のブロック判定処理では、CPU210は、注目ブロックが、文字ブロック、非文字ブロック、不明ブロックのいずれであるかを判断している。これに代えて、CPU210は、注目ブロックが、文字ブロックと非文字ブロックとのいずれであるかを判断しても良い。この場合には、例えば、S415で用いる閾値TH1と、S425で用いる閾値TH2と、を同じ値にすれば良い。例えば、TH1=TH2=50%とすれば良い。
(3) In the block determination process of the above embodiment, the
(4)上記実施例の図2の画像処理において、S24の第2の二値画像データ生成処理およびS26の合成処理は省略されても良い。すなわち、第1の二値画像データ生成処理において特定される複数個のエッジ画素が、最終的なエッジ特定データであっても良い。 (4) In the image processing of FIG. 2 of the above embodiment, the second binary image data generation processing of S24 and the composition processing of S26 may be omitted. That is, the plurality of edge pixels specified in the first binary image data generation process may be the final edge identification data.
(5)上記実施例では、上述したように、図12のS420、S430に示すように、注目ブロックが文字ブロックまたは非文字ブロックであると判断されると、ブロック判定データにおいて、注目ブロック内の全ての画素の値が、判断結果に応じて設定される。これに代えて、ブロック判定データにおいて、注目ブロック内のN個の画素のうち、不明を示す値を有する画素の値だけが、判断結果に応じて設定されても良い。すなわち、互いに重複する第1のブロックと第2のブロックとの両方が、不明ブロック以外のブロック(すなわち、文字ブロックまたは非文字ブロック)であると判断されるとする。この場合には、第1のブロックと第2のブロックの重複領域については、第1のブロックと第2のブロックとのうち、判断の処理順序が先のブロックについての判断結果が優先されても良い。 (5) In the above embodiment, as described above, as shown in S420 and S430 of FIG. 12, when the attention block is determined to be a character block or a non-character block, in the block determination data, the attention block is contained. The values of all the pixels are set according to the judgment result. Instead of this, in the block determination data, of the N pixels in the block of interest, only the value of the pixel having a value indicating unknown may be set according to the determination result. That is, it is determined that both the first block and the second block that overlap each other are blocks other than the unknown block (that is, a character block or a non-character block). In this case, regarding the overlapping area of the first block and the second block, even if the judgment result of the block whose judgment processing order is earlier than that of the first block and the second block is prioritized. good.
(6)上記実施例の図12のブロック判定処理では、全てのブロックBLについての判断の後に、ブロック判定データに、不明を示す値が残っている場合には(S460:YES)、CPU210は、S465にて、不明を示す値を、文字を示す値に設定する。これは、文字画素の一部が、誤って非文字画素として特定されることを抑制して、文字の一部がぼけるなどの不都合を避けるためである。例えば、非文字画素の一部が、誤って文字画素として特定されることを抑制して、網点が目立つなどの不都合を避けることを重視する場合には、CPU210は、S465にて、不明を示す値を、非文字を示す値に設定しても良い。
(6) In the block determination process of FIG. 12 of the above embodiment, if a value indicating unknown remains in the block determination data after the determination for all the block BLs (S460: YES), the
(7)図5の第1の二値画像データ生成処理(図5)では、単成分画像データとして、輝度画像データが用いられる(S120)。これに代えて、スキャンデータの対応する画素のRGB値に含まれる3個の成分値(R値、G値、B値)の平均値を、各画素の値とする平均成分値画像データが用いられても良い。 (7) In the first binary image data generation process (FIG. 5) of FIG. 5, luminance image data is used as the single component image data (S120). Instead of this, the average component value image data in which the average value of the three component values (R value, G value, B value) included in the RGB values of the corresponding pixels of the scan data is used as the value of each pixel is used. May be done.
(8)上記実施例の第2の二値画像データ生成処理(図9)では、単成分画像データとして、最小成分データが用いられる(S300)。これに代えて、最大成分データや反転最小成分データが用いられても良い。 (8) In the second binary image data generation process (FIG. 9) of the above embodiment, the minimum component data is used as the single component image data (S300). Instead of this, the maximum component data or the inverted minimum component data may be used.
最大成分データは、スキャンデータに含まれる複数個の画素に対応する複数個の値を含み、該複数個の値のそれぞれは、スキャンデータの対応する画素の最大成分値Vmaxである。最大成分値Vmaxは、スキャンデータの対応する画素のRGB値に含まれる複数個の成分値(R値、G値、B値)のうちの最大値である。 The maximum component data includes a plurality of values corresponding to a plurality of pixels included in the scan data, and each of the plurality of values is the maximum component value Vmax of the corresponding pixel of the scan data. The maximum component value Vmax is the maximum value among a plurality of component values (R value, G value, B value) included in the RGB values of the corresponding pixels of the scan data.
反転最小成分データは、以下のように、取得される。先ず、スキャンデータに含まれる複数個の画素の値(RGB値)のそれぞれについて、複数個の成分値(R値、G値、B値)が反転された反転済みの色値が生成される。反転前のRGB値を(Rin、Gin、Bin)とすると、反転済みのRGB値(Rout、Gout、Bout)は、以下の式(1)〜(3)で表される。 The inversion minimum component data is acquired as follows. First, for each of the values (RGB values) of the plurality of pixels included in the scan data, the inverted color values in which the plurality of component values (R value, G value, B value) are inverted are generated. 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 values that the R value, G value, and B value can take, respectively, and in this embodiment, Rmax = Gmax = Bmax = 255. Image data in which these inverted RGB values are the values of a plurality of pixels is generated as inverted image data. Then, the inverted minimum component data is generated using the inverted image data. Specifically, the inverted minimum component value VRmin is 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 value. The inversion minimum component data is image data in which these inversion minimum component values VRmin are values of a plurality of pixels.
反転最小成分値VRminは、最大成分値の反転値であり、VRmin=(255−Vmax)の関係が成り立つ。このために、最大成分データと反転最小成分データとは、両方とも、スキャンデータの各画素の値に含まれる複数個の成分値のうちの最大値に基づく値(最大値の反転値、あるいは、最大値そのもの)を、画素の値とする画像データである、と言うことができる。 The inverted minimum component value VRmin is an inverted value of the maximum component value, and the relationship of VRmin = (255-Vmax) is established. Therefore, both the maximum component data and the inverted minimum component data are values based on the maximum value among the plurality of component values included in the value of each pixel of the scan data (the inverted value of the maximum value, or the inverted value of the maximum value, or It can be said that the maximum value itself) is the image data in which the pixel value is used.
図10に示すように、C、M、Y、K、Wの最大成分値Vmaxは、255、255、255、0、255となり、黒(K)を除いて同じ値となる。したがって、最大成分データや反転最小成分データにおいては、網点領域を構成する5種類の要素、すなわち、C、M、Y、Kの各ドットと、用紙の地色(白)と、のうちの4種類の要素(C、M、Yのドットと、用紙の地色(白))を示す画素間の値の差が抑制される。この結果、最大成分データや反転最小成分データを用いる場合には、最小成分データを用いる場合と同様に、網点に起因するエッジ画素が特定されることを抑制できる。 As shown in FIG. 10, the maximum component values Vmax of C, M, Y, K, and W are 255, 255, 255, 0, and 255, which are the same values except for black (K). Therefore, in the maximum component data and the inverted minimum component data, among the five types of elements constituting the halftone dot region, that is, the dots of C, M, Y, and K, and the background color (white) of the paper. The difference between the values indicating the four types of elements (dots C, M, Y and the background color (white) of the paper) is suppressed. As a result, when the maximum component data or the inverted minimum component data is used, it is possible to suppress the identification of edge pixels due to halftone dots, as in the case of using the minimum component data.
(9)上記各実施例では、文字画素に対して、文字鮮鋭化処理が実行され(図2のS40)、非文字画素に対して、網点平滑化処理が実行される(図2のS30)。これに代えて、文字画素に対しては、文字の見栄えを向上するためのアンチエイリアス処理が実行されても良い。また、非文字画素に対しては、例えば、印刷時の色材の使用量を減らすために、色を飛ばす処理(白に変換する処理)が実行されても良い。一般的には、文字画素と、非文字画素と、に互いに異なる画像処理が実行されることが好ましい。あるいは、文字画素と非文字画素のいずれか一方に対して、特定の画像処理が実行され、他方に対して、該特定の画像処理が実行されなくても良い。 (9) In each of the above embodiments, 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). ). Instead of this, antialiasing processing for improving the appearance of the character may be executed on the character pixel. Further, for non-character pixels, for example, in order to reduce the amount of color material used during printing, a process of skipping colors (a process of converting to white) may be executed. In general, it is preferable that character pixels and non-character pixels are subjected to different image processing. Alternatively, the specific image processing may be executed on either the character pixel or the non-character pixel, and the specific image processing may not be executed on the other.
(10)上記実施例では、図5のS130や図9のS320のエッジ抽出処理において、ソーベルフィルタ(Sobel filter)が用いられている。これに代えて、これらエッジ抽出処理では、ロバーツフィルタや、ラプラシアンフィルタなどの他のエッジ抽出フィルタが用いられても良い。 (10) In the above embodiment, a Sobel filter is used in the edge extraction process of S130 of FIG. 5 and S320 of FIG. Instead of this, in these edge extraction processes, other edge extraction filters such as a Roberts filter and a Laplacian filter may be used.
(11)上記実施例では、対象画像データは、スキャンデータであるが、これに限られない。対象画像データは、2次元イメージセンサを備えるデジタルカメラによって印刷物を読み取ることによって生成されても良い。 (11) In the above embodiment, the target image data is scan data, but is not limited to this. The target image data may be generated by reading the printed matter with a digital camera equipped with a two-dimensional image sensor.
(12)上記実施例では、第1の二値画像データと、第2の二値画像データと、の論理和を取ることによって、エッジ特定データが生成される(図2のS26)。これに代えて、第1の二値画像データと、第2の二値画像データと、第3の二値画像データと、の論理和を取ることによって、エッジ特定データが生成されても良い。第3の二値画像データには、例えば、上述した最大成分データを用いて生成される二値画像データが用いられても良い。これによって、文字などのエッジの特定漏れをさらに抑制することができる。 (12) In the above embodiment, edge specific data is generated by ORing the first binary image data and the second binary image data (S26 in FIG. 2). Instead of this, edge specific data may be generated by ORing the first binary image data, the second binary image data, and the third binary image data. As the third binary image data, for example, the binary image data generated by using the above-mentioned maximum component data may be used. As a result, it is possible to further suppress the omission of specific edges such as characters.
(13)上記実施例の第1の二値画像データ生成処理(図5)や第2の二値画像データ生成処理(図9)は、適宜に変更可能である。例えば、図5のS110、S110、S140の処理の全部または一部は、省略可能である。また、図9のS310、S330のうちの全部または一部は、省略可能である。 (13) The first binary image data generation process (FIG. 5) and the second binary image data generation process (FIG. 9) of the above embodiment can be appropriately changed. For example, all or part of the processing of S110, S110, and S140 in FIG. 5 can be omitted. Further, all or a part of S310 and S330 in FIG. 9 can be omitted.
(14)図2の画像処理を実現する画像処理装置は、複合機200に限らず、種々の装置であってよい。例えば、スキャナやデジタルカメラが、自身で生成された画像データを用いて、プリンタに供給するための印刷データを生成するために、図2の画像処理を実行しても良い。また、例えば、スキャナやプリンタと通信可能な接続される端末装置(例えば、端末装置100)やサーバ(図示省略)が、スキャナから取得したスキャンデータを用いて、図2の画像処理を実行して、印刷データを生成し、該印刷データをプリンタに供給しても良い。また、ネットワークを介して互いに通信可能な複数個のコンピュータ(例えば、クラウドサーバ)が、画像処理に要する機能を一部ずつ分担して、全体として、画像処理を実行してもよい。この場合、複数個のコンピュータの全体が、画像処理装置の例である。
(14) The image processing device that realizes the image processing of FIG. 2 is not limited to the
(15)上記各実施例において、ハードウェアによって実現されていた構成の一部をソフトウェアに置き換えるようにしてもよく、逆に、ソフトウェアによって実現されていた構成の一部あるいは全部をハードウェアに置き換えるようにしてもよい。例えば、図12のS410、S420のヒストグラムデータを生成し、該ヒストグラムデータを用いて標準偏差σを算出する処理は、ASICなどの専用のハードウェアによって、実行されても良い。 (15) In each of the above embodiments, a part of the configuration realized by the hardware may be replaced with software, and conversely, a part or all of the configuration realized by the software may be replaced with the hardware. You may do so. For example, the process of generating the histogram data of S410 and S420 of FIG. 12 and calculating the standard deviation σ using the histogram data 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 invention are for facilitating the understanding of the present invention and do not limit the present invention. The present invention may be modified or improved without departing from the spirit and claims, and the present invention includes an equivalent thereof.
100…端末装置、200…複合機、210…CPU、220…揮発性記憶装置、230…不揮発性記憶装置、240…表示部、250…操作部、270…通信IF、280…印刷実行部、290…読取実行部、PG…コンピュータプログラム、SI…スキャン画像、TI…文字特定画像、GI…平滑化画像、FI…処理済み画像、EI…エッジ特定画像、BI…ブロック判定画像、YI…輝度画像、SI…スキャン画像、BL…ブロック、DT…網点、SB…サブブロック、HGa、HGb…ヒストグラム 100 ... Terminal device, 200 ... Complex machine, 210 ... CPU, 220 ... Volatile storage device, 230 ... Non-volatile storage device, 240 ... Display unit, 250 ... Operation unit, 270 ... Communication IF, 280 ... Print execution unit, 290 ... Reading execution unit, PG ... Computer program, SI ... Scanned image, TI ... Character specific image, GI ... Smoothed image, FI ... Processed image, EI ... Edge specific image, BI ... Block judgment image, YI ... Brightness image, SI ... scan image, BL ... block, DT ... halftone dot, SB ... subblock, HGa, HGb ... histogram
Claims (9)
対象画像を示す対象画像データを取得する画像取得部であって、前記対象画像データは、イメージセンサを用いて印刷物を読み取ることによって生成される、前記画像取得部と、
前記対象画像内の複数個の画素から、文字を示す文字画素を特定する文字特定部と、
を備え、
前記文字特定部は、
前記対象画像データを用いて、前記対象画像内の複数個の画素のそれぞれが、対象画像内のエッジを構成するエッジ画素であるか否かを画素ごとに判断することによって、前記エッジ画素であると判断される複数個の第1の候補画素を決定し、
前記対象画像データを用いて、前記対象画像上に配置される複数個のブロックのそれぞれについて、前記ブロック内の複数個の画素の分布を示すヒストグラムデータを生成し、
前記ヒストグラムデータを用いて、前記複数個のブロックのそれぞれが、文字を示す文字ブロックであるか否かをブロックごとに判断することによって、前記文字ブロックであると判断されるブロック内の複数個の第2の候補画素を決定し、
前記対象画像内の複数個の画素のうち、前記第1の候補画素であると決定され、かつ、前記第2の候補画素であると決定される画素を、前記文字画素として特定する、画像処理装置。 It is an image processing device
An image acquisition unit that acquires target image data indicating a target image, and the target image data is generated by reading a printed matter using an image sensor.
A character identification unit that identifies a character pixel indicating a character from a plurality of pixels in the target image,
With
The character identification part is
By using the target image data to determine for each pixel whether or not each of the plurality of pixels in the target image is an edge pixel constituting an edge in the target image, the edge pixel is obtained. A plurality of first candidate pixels judged to be determined are determined, and
Using the target image data, histogram data showing the distribution of the plurality of pixels in the block is generated for each of the plurality of blocks arranged on the target image.
By using the histogram data to determine for each block whether or not each of the plurality of blocks is a character block indicating a character, a plurality of blocks in the block determined to be the character block. Determine the second candidate pixel,
Image processing that identifies the pixel determined to be the first candidate pixel and the pixel determined to be the second candidate pixel among the plurality of pixels in the target image as the character pixel. apparatus.
前記文字特定部は、
前記ヒストグラムデータを用いて前記ブロック内の複数個の画素の値のばらつきが基準以上であるか否かを判断し、
前記ブロック内の複数個の画素の値のばらつきが基準以上である場合に、前記ブロックは文字ブロックであると判断し、
前記ブロック内の複数個の画素の値のばらつきが基準未満である場合に、前記ブロックは文字ブロックでないと判断する、画像処理装置。 The image processing apparatus according to claim 1.
The character identification part is
Using the histogram data, it is determined whether or not the variation in the values of the plurality of pixels in the block is equal to or greater than the reference value.
When the variation in the values of the plurality of pixels in the block is equal to or greater than the reference, it is determined that the block is a character block, and the block is determined to be a character block.
An image processing device that determines that the block is not a character block when the variation in the values of the plurality of pixels in the block is less than the reference.
複数個の画素の値のそれぞれは、複数個の成分値を含む色値であり、
前記ヒストグラムデータは、前記複数個の成分値のそれぞれを、その値に応じて分類して得られるデータである、画像処理装置。 The image processing apparatus according to claim 1 or 2.
Each of the values of the plurality of pixels is a color value including a plurality of component values.
The histogram data is an image processing apparatus which is data obtained by classifying each of the plurality of component values according to the values.
前記文字特定部は、
前記対象画像データを用いて、前記対象画像データに含まれる前記複数個の画素に対応する複数個の第1の値を含む第1の画像データであって、前記複数個の第1の値のそれぞれは、対応する画素の値に基づく輝度値である、前記第1の画像データを生成し、
前記第1の画像データによって示される第1の画像内のエッジを示す複数個の第1のエッジ画素を特定し、
前記対象画像データを用いて、前記対象画像データに含まれる前記複数個の画素に対応する複数個の第2の値を含む第2の画像データであって、前記複数個の第2の値のそれぞれは、対応する画素の複数個の成分値のうち、最小の成分値または最大の成分値に基づく値である、前記第2の画像データを生成し、
前記第2の画像データによって示される第2の画像内のエッジを示す複数個の第2のエッジ画素を特定し、
前記対象画像内の複数個の画素のうち、前記複数個の第1のエッジ画素に対応する複数個の画素と、前記複数個の第2のエッジ画素に対応する複数個の画素と、を含む画素群であって、前記複数個の第1のエッジ画素とも前記複数個の第2のエッジ画素とも対応しない複数個の画素を含まない、前記画素群を、複数個の前記第1の候補画素であると決定する、画像処理装置。 The image processing apparatus according to any one of claims 1 to 3.
The character identification part is
Using the target image data, it is the first image data including a plurality of first values corresponding to the plurality of pixels included in the target image data, and is the first image data including the plurality of first values. Each generates the first image data, which is a brightness value based on the value of the corresponding pixel.
A plurality of first edge pixels indicating edges in the first image represented by the first image data are identified.
Using the target image data, it is the second image data including a plurality of second values corresponding to the plurality of pixels included in the target image data, and is the second image data of the plurality of second values. Each generates the second image data, which is a value based on the minimum component value or the maximum component value among the plurality of component values of the corresponding pixels.
A plurality of second edge pixels indicating the edges in the second image indicated by the second image data are identified.
Among the plurality of pixels in the target image, the plurality of pixels corresponding to the plurality of first edge pixels and the plurality of pixels corresponding to the plurality of second edge pixels are included. The pixel group is a plurality of the first candidate pixels that do not include a plurality of pixels that do not correspond to the plurality of first edge pixels and the plurality of second edge pixels. An image processing device that determines that.
前記複数個のブロックは、第1のブロックと、前記第1のブロックと一部が重なる第2のブロックと、を含み、
前記文字特定部は、
前記第1のブロックが前記文字ブロックであるか否かを判断し、
前記第2のブロックが前記文字ブロックであるか否かを判断し、
前記第1のブロックと前記第2のブロックとが重なる重複領域内のn個の画素(nは1以上の整数)が前記第2の候補画素であるか否かを、前記第1のブロックについての判断結果と前記第2のブロックについての判断結果との少なくとも一方に基づいて決定する、画像処理装置。 The image processing apparatus according to any one of claims 1 to 4.
The plurality of blocks include a first block and a second block that partially overlaps the first block.
The character identification part is
The first block is determined whether or not the character block,
Before Stories second block is judged whether or not the character block,
Whether or not the n pixels (n is an integer of 1 or more) in the overlapping region where the first block and the second block overlap are the second candidate pixels is determined for the first block. An image processing device that determines based on at least one of the determination result of the above and the determination result of the second block.
前記文字特定部は、
前記ヒストグラムデータを用いて、注目する前記ブロックが、前記文字ブロック、文字を示さない非文字ブロック、および、文字を示すか不明である不明ブロック、のいずれであるかを、ブロックごとに判断し、
前記第1のブロックが前記不明ブロックであると判断され、かつ、前記第2のブロックが前記文字ブロックであると判断される場合には、前記重複領域内のn個の画素は、前記第2の候補画素であると決定し、
前記第1のブロックが前記不明ブロックであると判断され、かつ、前記第2のブロックが前記非文字ブロックであると判断される場合には、前記重複領域内のn個の画素は、前記第2の候補画素でないと決定し、
前記第1のブロックが前記文字ブロックであると判断され、かつ、前記第2のブロックが前記不明ブロックであると判断される場合には、前記重複領域内のn個の画素は、前記第2の候補画素であると決定し、
前記第1のブロックが前記非文字ブロックであると判断され、かつ、前記第2のブロックが前記不明ブロックであると判断される場合には、前記重複領域内のn個の画素は、前記第2の候補画素でないと決定する、画像処理装置。 The image processing apparatus according to claim 5.
The character identification part is
Using the histogram data, it is determined for each block whether the block of interest is the character block, the non-character block that does not show characters, or the unknown block that shows characters or is unknown.
When the first block is determined to be the unknown block and the second block is determined to be the character block, the n pixels in the overlapping region are the second. Determined to be a candidate pixel for
When it is determined that the first block is the unknown block and the second block is determined to be the non-character block, the n pixels in the overlapping region are the first. Determined that it is not a candidate pixel of 2,
When the first block is determined to be the character block and the second block is determined to be the unknown block, the n pixels in the overlapping region are the second. Determined to be a candidate pixel for
When it is determined that the first block is the non-character block and the second block is determined to be the unknown block, the n pixels in the overlapping region are the first. An image processing device that determines that it is not a candidate pixel of 2.
前記対象画像データのうち、特定済みの前記文字画素の値に対して第1の画像処理を実行し、前記文字画素とは異なる画素の値に対して前記第1の画像処理とは異なる第2の画像処理を実行して、画像処理済みの前記対象画像データを生成する画像処理部を備える、画像処理装置。 The image processing apparatus according to any one of claims 1 to 6, further comprising.
Of the target image data, the first image processing is executed on the identified value of the character pixel, and the value of the pixel different from the character pixel is different from the first image processing. An image processing apparatus including an image processing unit that executes the image processing of the above and generates the target image data that has been image-processed.
前記画像処理済みの前記対象画像データを用いて、印刷データを生成する印刷データ生成部を備える、画像処理装置。 The image processing apparatus according to claim 7, further
An image processing apparatus including a print data generation unit that generates print data using the target image data that has been image-processed.
対象画像を示す対象画像データを取得する画像取得機能であって、前記対象画像データは、イメージセンサを用いて印刷物を読み取ることによって生成される、前記画像取得機能と、
前記対象画像内の複数個の画素から、文字を示す文字画素を特定する文字特定機能と、
をコンピュータに実現させ、
前記文字特定機能は、
前記対象画像データを用いて、前記対象画像内の複数個の画素のそれぞれが、対象画像内のエッジを構成するエッジ画素であるか否かを画素ごとに判断することによって、前記エッジ画素であると判断される複数個の第1の候補画素を決定し、
前記対象画像データを用いて、前記対象画像上に配置される複数個のブロックのそれぞれについて、前記ブロック内の複数個の画素の分布を示すヒストグラムデータを生成し、
前記ヒストグラムデータを用いて、前記複数個のブロックのそれぞれが、文字を示す文字ブロックであるか否かをブロックごとに判断することによって、前記文字ブロックであると判断されるブロック内の複数個の第2の候補画素を決定し、
前記対象画像内の複数個の画素のうち、前記第1の候補画素であると決定され、かつ、前記第2の候補画素であると決定される画素を、前記文字画素として特定する、コンピュータプログラム。 It ’s a computer program,
An image acquisition function for acquiring target image data indicating a target image, wherein the target image data is generated by reading a printed matter using an image sensor, and the image acquisition function.
A character identification function that identifies a character pixel indicating a character from a plurality of pixels in the target image, and
To the computer,
The character identification function is
By using the target image data to determine for each pixel whether or not each of the plurality of pixels in the target image is an edge pixel constituting an edge in the target image, the edge pixel is obtained. A plurality of first candidate pixels judged to be determined are determined, and
Using the target image data, histogram data showing the distribution of the plurality of pixels in the block is generated for each of the plurality of blocks arranged on the target image.
By using the histogram data to determine for each block whether or not each of the plurality of blocks is a character block indicating a character, a plurality of blocks in the block determined to be the character block. Determine the second candidate pixel,
A computer program that identifies a pixel determined to be the first candidate pixel and a pixel determined to be the second candidate pixel among a plurality of pixels in the target image as the character pixel. ..
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018045433A JP6841254B2 (en) | 2018-03-13 | 2018-03-13 | Image processing equipment and computer programs |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2018045433A JP6841254B2 (en) | 2018-03-13 | 2018-03-13 | Image processing equipment and computer programs |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019159783A JP2019159783A (en) | 2019-09-19 |
JP6841254B2 true JP6841254B2 (en) | 2021-03-10 |
Family
ID=67997040
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018045433A Active JP6841254B2 (en) | 2018-03-13 | 2018-03-13 | Image processing equipment and computer programs |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6841254B2 (en) |
-
2018
- 2018-03-13 JP JP2018045433A patent/JP6841254B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2019159783A (en) | 2019-09-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6781406B2 (en) | Image processing equipment and computer programs | |
JP4137890B2 (en) | Image processing apparatus, image forming apparatus, image reading processing apparatus, image processing method, image processing program, and computer-readable recording medium | |
JP4926568B2 (en) | Image processing apparatus, image processing method, and image processing program | |
JP2008011269A (en) | Image processor, image processing method, image processing program, and storage medium | |
JP4115999B2 (en) | Image processing apparatus, image forming apparatus, image reading processing apparatus, image processing method, image processing program, and computer-readable recording medium | |
JP2006203701A (en) | Image processor, image forming apparatus, image reader, image processing method, image processing program, and computer readable recording medium | |
JP4402090B2 (en) | Image forming apparatus, image forming method, program, and recording medium | |
JP2018056873A (en) | Image processing device and computer program | |
JP2016058879A (en) | Image processing apparatus and image processing method | |
JP2004336282A (en) | Image processor, image processing program and recording medium recorded with relevant 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 | |
JP6841254B2 (en) | Image processing equipment and computer programs | |
JP6879465B2 (en) | Image processing equipment and computer programs | |
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 | |
JP6867609B2 (en) | Image processing equipment and computer programs | |
JP7205689B2 (en) | Image processing device and computer program | |
JP7248944B2 (en) | Image processing device and computer program | |
JP4073877B2 (en) | Image processing method, image processing apparatus, image forming apparatus, and computer program | |
JP2023132586A (en) | Image processing device, image processing method, and program | |
US20180288282A1 (en) | Image processing apparatus specifying first and second pixels, and generating processed image data in which the first and second pixels have first and second colors respectively | |
JP4545134B2 (en) | Image processing method, image processing apparatus, image forming apparatus, computer program, and recording medium | |
JP2010191931A (en) | Image processing apparatus, image forming apparatus, computer program, recording medium and image processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200312 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20201110 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20201221 |
|
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: 20210119 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210201 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6841254 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |