JPH1021336A - Method and device for discriminating character string classification - Google Patents

Method and device for discriminating character string classification

Info

Publication number
JPH1021336A
JPH1021336A JP8173795A JP17379596A JPH1021336A JP H1021336 A JPH1021336 A JP H1021336A JP 8173795 A JP8173795 A JP 8173795A JP 17379596 A JP17379596 A JP 17379596A JP H1021336 A JPH1021336 A JP H1021336A
Authority
JP
Japan
Prior art keywords
character
line
image
character string
extracted
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.)
Withdrawn
Application number
JP8173795A
Other languages
Japanese (ja)
Inventor
Yukari Toda
ゆかり 戸田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP8173795A priority Critical patent/JPH1021336A/en
Publication of JPH1021336A publication Critical patent/JPH1021336A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Character Discrimination (AREA)

Abstract

PROBLEM TO BE SOLVED: To automatically discriminate whether a character string included in an optically read original image is the character string in language using alphabets or the character string in Japanese. SOLUTION: Area separation is operated to a bit map picture, and a character area is separated (step S101). Then, the extraction of a line is operated to the separated character area (step S104). Next, the number of spaces having width more than a prescribed value is counted for each extracted line (step S106). Then, a rate R of the number of spaces counted in the step S106 to the width of the extracted line is calculated, and whether the line is a line in Japanese or a line in language using alphabets (English in this case) is discriminated based on the value of the R (steps S107 and S108). Then, the character recognizing processing of the line is operated by using either an OCR(optical character recognition) for Japanese or the OCR for English according to this discriminated result (steps S109 and S110).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、OCR(光学的文
字認識)等の前処理として行うのに好適な文字列種別判
定装置及び方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a character string type determining apparatus and method suitable for performing as preprocessing such as OCR (optical character recognition).

【0002】[0002]

【従来の技術】情報が溢れる現代社会において情報管
理、検索が容易になる情報の電子化が早急に望まれてい
る。情報の電子化には、スキャナなどの入力装置で読み
取った画像である文字を文字コードに変換するOCR
(光学的文字認識)が必須であり、その認識精度はどん
どん向上してきている。
2. Description of the Related Art In a modern society full of information, digitization of information for easy information management and retrieval is urgently desired. To digitize information, OCR that converts characters, which are images read by input devices such as scanners, into character codes
(Optical character recognition) is indispensable, and the recognition accuracy is steadily improving.

【0003】この種のOCRにおいては、日本語(漢
字、ひらがな、カタカナ)と英語やその他のアルファベ
ット使用言語とにおけるパターン特性の違いのため、ア
ルファベット(特に小文字)を日本語OCRで認識する
のは困難である。このため、それぞれ別個の認識アルゴ
リズムを用いたり、アルゴリズムは同じでもパターン辞
書の切り替えを行なったりする。従って、アルファベッ
トと日本語を判別する技術の必要がある。
In this type of OCR, it is difficult to recognize alphabets (especially lowercase letters) in Japanese OCR due to the difference in pattern characteristics between Japanese (Kanji, Hiragana, Katakana) and English or other languages using alphabets. Have difficulty. Therefore, different recognition algorithms are used, or the pattern dictionary is switched even if the algorithms are the same. Therefore, there is a need for a technique for distinguishing between alphabets and Japanese.

【0004】従来、アルファベット使用言語と日本語を
判別する方法はなかったため、ユーザがオペレーション
パネルなどを使用して、処理する原稿に応じて装置へ指
示を行っていた。
Conventionally, there has been no method for distinguishing between the alphabetic language and the Japanese language, and the user has instructed the apparatus using an operation panel or the like according to the document to be processed.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、ユーザ
がオペレーションパネルなどを使用して指示するという
方法では、ユーザの手間が多大であるし、さらに以下の
ような問題点がある。
However, the method in which the user gives an instruction using an operation panel or the like requires a lot of trouble for the user, and further has the following problems.

【0006】複数ページの原稿のデータを読み込む際に
は、ADF(オートドキュメントフィーダ)がユーザの
原稿差し替え作業を削減する。このとき、その複数ペー
ジ中に英語のドキュメントと日本語のドキュメントが入
り混じっているような場合がある。このような場合にお
いて、各ページが日本語か英語かについて、一枚読み込
む毎にユーザの指示を請うていてはADFの利点が台無
しになってしまう。また、全ページ読み込んだ後にユー
ザの指示を請うような形態とするには、大量のメモリが
必要になり現実的でない。また、1ページ中に日本語の
部分と英語の部分とが混在するような原稿では、OCR
を適切に切り換えることはできない。
When reading data of a document of a plurality of pages, an ADF (Auto Document Feeder) reduces the user's document replacement work. At this time, there are cases where English documents and Japanese documents are mixed in the plurality of pages. In such a case, the advantage of the ADF is ruined if the user instructs whether each page is Japanese or English every time one page is read. In addition, in order to request a user's instruction after reading all pages, a large amount of memory is required, which is not practical. For manuscripts where Japanese and English parts are mixed in one page, OCR
Cannot be switched properly.

【0007】本発明は上記の問題に鑑みてなされたもの
であり、光学的に読取った原稿イメージより、当該イメ
ージに含まれる文字列がアルファベット使用言語の文字
列か日本語の文字列かを識別することを可能とする文字
列種別判定装置及び方法を提供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made in view of the above problems, and identifies, based on an optically read original image, whether a character string included in the image is a character string in an alphabetic language or a Japanese character string. It is an object of the present invention to provide a character string type determination device and method capable of performing the same.

【0008】[0008]

【課題を解決するための手段】上記の目的を達成するた
めの本発明の文字列種別判定装置は、文字画像から行を
抽出する抽出手段と、前記抽出手段によって抽出された
行について所定値以上の幅を有するスペースの数をカウ
ントするカウント手段と、前記カウント手段によってカ
ウントされたスペースの数と、当該抽出された行の幅と
に基づいて日本語の行かアルファベット使用言語の行か
を判定する判定手段とを備える。
According to the present invention, there is provided a character string type determining apparatus for extracting a line from a character image, wherein the line extracted by the extracting means has a predetermined value or more. Counting means for counting the number of spaces having a width of, and determining whether to determine a Japanese line or a line in an alphabetic language based on the number of spaces counted by the counting unit and the width of the extracted line Means.

【0009】また、好ましくは、原稿画像を示すイメー
ジデータから文字領域を分離する分離手段を更に備え、
前記抽出手段は、前記分離手段で分離された文字領域か
ら行を抽出する。1ページ内に文字領域や図形領域等が
混在するイメージデータであっても、適切に文字列種別
の判定を行うことが可能となるからである。
Preferably, the apparatus further comprises separating means for separating a character area from image data representing an original image.
The extracting means extracts a line from the character area separated by the separating means. This is because the character string type can be appropriately determined even for image data in which a character area, a graphic area, and the like are mixed in one page.

【0010】また、好ましくは、前記抽出手段は、文字
画像データの所定方向への射影によって行の抽出を行
う。
Preferably, the extracting means extracts a line by projecting the character image data in a predetermined direction.

【0011】また、好ましくは、前記カウント手段は、
前記抽出手段で抽出された行について、行方向と垂直な
方向に射影を行って白部分を検出する検出手段を備え、
前記検出手段で検出された白部分のうち、その幅が所定
値以上のものをカウントする。
Preferably, the counting means includes:
For the row extracted by the extraction means, comprises a detection means for detecting a white portion by projecting in a direction perpendicular to the row direction,
Of the white portions detected by the detection means, those whose width is equal to or more than a predetermined value are counted.

【0012】また、好ましくは、前記文字画像よりノイ
ズを除去する除去手段を更に備える。より正確にスペー
スの数をカウントすることが可能となり、文字列の種別
判定の精度が向上するからである。
Preferably, the apparatus further comprises a removing unit for removing noise from the character image. This is because the number of spaces can be counted more accurately, and the accuracy of determining the type of a character string is improved.

【0013】また、好ましくは、前記抽出手段で抽出さ
れた行の傾きを検出し、当該行の傾きを補正する補正手
段を更に備える。原稿の傾きに対して文字列種別の判定
精度を維持できるからである。
Preferably, the apparatus further comprises correction means for detecting the inclination of the row extracted by the extraction means and correcting the inclination of the row. This is because the determination accuracy of the character string type can be maintained with respect to the inclination of the document.

【0014】また、好ましくは、前記文字画像より文字
を抽出し、該文字の方向を検出することにより該文字画
像の方向を検出する方向検出手段と、前記方向検出手段
で検出された方向に基づいて前記文字画像が所定の向き
となるように回転する回転手段とを更に備える。文字画
像中の文字の方向によらず、同じアルゴリズムで文字列
の種別を判定できるからである。また、例えば、1ペー
ジ中に複数の文字画像領域が存在し、各文字画像領域内
の文字の方向が異なっていても、文字画像毎に画像回転
を行って文字列の種別判定を行えるので、同じアルゴリ
ズム(すなわち、所定方向の文字画像に対応するアルゴ
リズム)で文字列の種別を判定できる。
Preferably, a direction detecting means for extracting a character from the character image and detecting a direction of the character to detect a direction of the character image, based on the direction detected by the direction detecting means. Rotating means for rotating the character image in a predetermined direction. This is because the type of the character string can be determined by the same algorithm regardless of the direction of the character in the character image. Also, for example, even if a plurality of character image regions exist in one page and the direction of the characters in each character image region is different, the type of the character string can be determined by performing image rotation for each character image. The type of character string can be determined by the same algorithm (that is, an algorithm corresponding to a character image in a predetermined direction).

【0015】[0015]

【発明の実施の形態】以下、添付の図面を参照して本発
明の好適な一実施形態を説明する。
Preferred embodiments of the present invention will be described below with reference to the accompanying drawings.

【0016】図1は本実施形態による文字認識装置の構
成を説明するブロック図である。同図において、11は
CPUであり、本文字認識装置における各種制御を実行
する。12はRAMであり、CPU11が各種の処理を
実行する際の作業領域を提供する。13はROMであ
り、本文字認識装置における各種制御プログラムを格納
する。CPU11はROM13に格納された制御プログ
ラムを実行することにより後述する各種制御を実現する
ものである。なお、本実施形態では制御プログラムをR
OM13に保持した構成を示したが、ハードディスクや
フロッピーディスク等の外部記憶装置から制御プログラ
ムをRAM12へロードして、これをCPU11によっ
て実行する形態としても良いことはもちろんである。
FIG. 1 is a block diagram illustrating the configuration of the character recognition device according to the present embodiment. In the figure, reference numeral 11 denotes a CPU, which executes various controls in the character recognition device. Reference numeral 12 denotes a RAM, which provides a work area when the CPU 11 executes various processes. A ROM 13 stores various control programs for the character recognition device. The CPU 11 executes various control programs described later by executing a control program stored in the ROM 13. In this embodiment, the control program is R
Although the configuration held in the OM 13 has been shown, it is a matter of course that the control program may be loaded into the RAM 12 from an external storage device such as a hard disk or a floppy disk and executed by the CPU 11.

【0017】14はディスクインターフェースであり、
ハードディスク141やフロッピーディスク142を当
該文字認識装置のバス18へ接続する。15はスキャナ
であり、原稿画像を光学的によみとる。スキャナ15で
読取られた画像は、CPU11で処理可能なイメージデ
ータに変換され、バス18へ出力される。このイメージ
データは、CPU11の制御により、RAM12もしく
はハードディスク141やフロッピーディスク142へ
格納される。16は入力部であり、キーボードやポイン
ティングデバイスで構成される。17はディスプレイで
あり、原稿画像のイメージデータや、文字認識処理を行
った結果等を表示する。18はバスであり、上述の各構
成を接続する。
Reference numeral 14 denotes a disk interface.
The hard disk 141 and the floppy disk 142 are connected to the bus 18 of the character recognition device. Reference numeral 15 denotes a scanner, which optically reads a document image. The image read by the scanner 15 is converted into image data that can be processed by the CPU 11 and output to the bus 18. This image data is stored in the RAM 12, the hard disk 141, or the floppy disk 142 under the control of the CPU 11. An input unit 16 includes a keyboard and a pointing device. Reference numeral 17 denotes a display, which displays image data of a document image, a result of performing character recognition processing, and the like. Reference numeral 18 denotes a bus that connects the above-described components.

【0018】ROM13には、図1に示した様な制御プ
ログラムが格納される。領域分離処理131は、スキャ
ナ15で読取った原稿画像のイメージから、文字で構成
されるテキスト領域や、図形等で構成される図形領域等
を分離する。行抽出処理132は、領域分離処理131
で分離されたテキスト領域から行を抽出する。スペース
カウント処理は、行抽出処理132で抽出された各行毎
に、行中に存在するスペースのうち所定幅を越えるスペ
ース数をカウントする。種別判定処理134は、スペー
スカウント処理で得られたスペース数と、各行の幅にも
とづいて、各行の種別(日本語かアルファベット使用言
語か)を判定する。文字認識処理135は、上記種別判
定処理134で得られる判定結果に基づいて、日本語文
字認識用のアルゴリズム、アルファベット使用言語文字
認識用のアルゴリズムを適時切り換えて文字認識処理を
実行する。
The ROM 13 stores a control program as shown in FIG. The area separation process 131 separates a text area composed of characters, a graphic area composed of figures, and the like from the image of the document image read by the scanner 15. The line extraction process 132 is a region separation process 131
Extract lines from the text area separated by. The space counting process counts the number of spaces exceeding a predetermined width among the spaces existing in the line for each line extracted in the line extraction process 132. The type determination process 134 determines the type (Japanese or alphabet language) of each line based on the number of spaces obtained by the space count process and the width of each line. The character recognition process 135 executes a character recognition process by appropriately switching between an algorithm for recognizing Japanese characters and an algorithm for recognizing characters in alphabetical languages based on the determination result obtained in the type determination process 134.

【0019】以下、上記の各処理について詳細に説明す
る。
Hereinafter, each of the above processes will be described in detail.

【0020】図2は本実施形態における文字列種別の判
定手順を表すフローチャートである。本フローチャート
は、領域分離処理131(ステップS101)、行抽出
処理132(ステップS104)、スペースカウント処
理133(ステップS106)、種別判定処理(ステッ
プS107、S108)、文字認識処理135(ステッ
プS109、S110)を含んでいる。
FIG. 2 is a flowchart showing a procedure for determining the type of character string in the present embodiment. In this flowchart, the area separation processing 131 (step S101), the line extraction processing 132 (step S104), the space count processing 133 (step S106), the type determination processing (steps S107 and S108), and the character recognition processing 135 (steps S109 and S110) ).

【0021】ステップS101では、スキャナ15など
の画像入力装置により入力されたビットマップ画像に対
して領域分離を行い、画像種別毎のブロック分けが行わ
れる。図3は1画素1ビットの2値ビットマップ画像の
一例を示す図である。この実施形態では単純2値化され
た2値画像を処理する場合を説明する。図4は、図3の
2値ビットマップ画像に領域分割処理を施した場合の結
果を示す図である。
In step S101, the bitmap image input by the image input device such as the scanner 15 is divided into regions, and blocks are divided for each image type. FIG. 3 is a diagram showing an example of a binary bitmap image of one bit per pixel. In this embodiment, a case where a simple binary image is processed will be described. FIG. 4 is a diagram illustrating a result when the area division processing is performed on the binary bitmap image of FIG.

【0022】図5は領域分離処理の手順の一例を示すフ
ローチャートである。ステップS301でビットマップ
画像にm×nのウィンドウリング処理を施し、1画素で
も黒があったら当該ウィンドリングの領域を黒とする。
なお、ウインドリングの領域は、解像度に応じて設定す
るのが好ましく、例えば300dpiにおいて8画素×
8画素程度とするのがよい。この結果、当該2値画像の
解像度が大幅に減少することになり、文字部分が連結さ
れる。図6はステップS301の解像度変換によって図
3の原稿を処理し、文字部分が連結した様子を示す図で
ある。
FIG. 5 is a flowchart showing an example of the procedure of the area separation process. In step S301, m × n windowing processing is performed on the bitmap image. If even one pixel has black, the windowing area is set to black.
The area of the wind ring is preferably set according to the resolution. For example, 8 pixels × 300 pixels at 300 dpi
It is preferable to use about eight pixels. As a result, the resolution of the binary image is greatly reduced, and the character portions are connected. FIG. 6 is a diagram showing a state in which the original shown in FIG. 3 is processed by the resolution conversion in step S301 and the character portions are connected.

【0023】次にステップS302で輪郭線追跡をする
と、文字特有の細長いパターン(テキスト部)とその他
の図形を区別することができる。最後にステップS30
3の同一グループ結合処理で、隣接するテキスト部を結
合させることによって図4のように領域分離を完成す
る。図7は領域分離処理の結果を保持するためのデータ
構造の一例を説明する図である。図7において、(a)
は、領域分離処理の結果を保持するためのデータ型を説
明する図である。分割された各領域には、当該領域内の
画像がタイトル、テキスト、図形、イメージのいずれで
あるかを示す属性情報(type)と、各領域の位置(領域
の左上の座標)、縦横の大きさを示す情報(startx,st
arty,width,height)を有する。また、next_address
は、次の領域が存在する場合に、その格納位置を示すポ
インタである。図7の(b)は、図4に示した領域分離
処理の結果に基づくデータ保持例を示すものである。
Next, when the contour is traced in step S302, it is possible to distinguish an elongated pattern (text portion) unique to a character from other figures. Finally, step S30
In the same group combining process of 3, the adjacent text portions are combined to complete the area separation as shown in FIG. FIG. 7 is a diagram illustrating an example of a data structure for holding a result of the area separation processing. In FIG. 7, (a)
FIG. 4 is a diagram illustrating a data type for holding a result of the region separation processing. In each of the divided areas, attribute information (type) indicating whether the image in the area is a title, text, graphic, or image, the position of each area (the upper left coordinate of the area), and the vertical and horizontal sizes Information (startx, st
arty, width, height). Also, next_address
Is a pointer indicating the storage location of the next area, if any. FIG. 7B shows an example of data storage based on the result of the area separation processing shown in FIG.

【0024】図2の説明に戻る。ステップS101にお
ける以上のような領域分離処理を完了すると、抽出され
たブロックデータに従って、ステップS102で未処理
のブロックがなくなるまで(構造体のnext_addressがNU
LLになるまで)以下の処理ループを回す。即ち、ステッ
プS102において未処理のブロックがないと判定され
れば本処理を終了し、未処理のブロックがあると判定さ
れればステップS103に進む。
Returning to the description of FIG. When the above-described region separation processing in step S101 is completed, according to the extracted block data, until there is no unprocessed block in step S102 (the next_address of the structure is NU
Turn the following processing loop (until LL). That is, if it is determined in step S102 that there is no unprocessed block, the process ends, and if it is determined that there is an unprocessed block, the process proceeds to step S103.

【0025】ステップS103では、現在処理しようと
するブロックが文字を含んでいるか否かを判定する。即
ち、図7で説明した構造体のtypeがtitleまたはtextを
表す場合(typeの値が0又は1の場合)は、当該ブロッ
クが文字を含むとして、ステップS104に進む。それ
以外であれば、ステップS102に戻る。
In step S103, it is determined whether the block to be processed at present contains characters. That is, when the type of the structure described in FIG. 7 indicates title or text (when the value of type is 0 or 1), it is determined that the block includes characters, and the process proceeds to step S104. Otherwise, the process returns to step S102.

【0026】ステップS104ではブロック内のデータ
をY軸に射影して行抽出を行う。図8はY軸への射影の
実行例を示す図である。同図では、Y軸への射影の実行
例として図4のテキストBに対して射影を実行した様子
が示されている。以下、図9を参照してY軸への射影を
さらに具体的に説明する。
In step S104, data in the block is projected on the Y axis to extract a row. FIG. 8 is a diagram illustrating an example of execution of projection onto the Y axis. FIG. 7 shows a state in which projection is performed on text B in FIG. 4 as an example of execution of projection on the Y axis. Hereinafter, the projection on the Y axis will be described more specifically with reference to FIG.

【0027】図9は本実施形態におけるY軸への射影の
処理手順を示すフローチャートである。ステップS90
1で文字画像中の行数を示すnlineをリセットし、続く
ステップS902で行の始まりを探しているのか行の終
りを探しているのかを区別するフラグflagをリセットす
る。また、ステップS903でY方向のループのカウン
タjをリセットし、ステップS904でX方向のループ
のカウンタiをリセットする。ステップS905では、
第i行に黒画素が一つでも存在したか否かを示すフラグ
kuroをリセットする。以上の、nline,flag,j,i,k
uroの各変数は夫々RAM12に確保される。
FIG. 9 is a flowchart showing a processing procedure for projecting onto the Y axis in this embodiment. Step S90
In step S902, nline indicating the number of lines in the character image is reset, and in step S902, a flag for discriminating whether to search for the beginning of a line or the end of a line is reset. In step S903, the counter j of the loop in the Y direction is reset, and in step S904, the counter i of the loop in the X direction is reset. In step S905,
Flag indicating whether any black pixel exists in the i-th row
Reset kuro. Nline, flag, j, i, k
Each variable of uro is secured in the RAM 12.

【0028】以上の変数を用いてY軸への射影を行う。
図9のフローチャートの概要を説明すると、ステップS
906〜S908のループでは、処理対象のブロック内
における第j番目の行について、0≦i≦widh(当該ブ
ロックの幅)の範囲を走査する。そして黒画素が検出さ
れると、ステップS909〜S912の処理によって、
第j行を文字列の存在する行の開始位置としてline_sy
(line)に保持し、次の行の走査へ処理を進める(ステッ
プS913〜S945)。ここで、flagを”1”にセッ
トし、行の終わりを探す処理へ移行する。行の終わりを
探す処理においては、黒画素が検出されても、ステップ
S910の判定により開始位置としての保持は行われな
い。
Projection on the Y axis is performed using the above variables.
The outline of the flowchart of FIG. 9 will be described.
In the loop from 906 to S908, the range of 0 ≦ i ≦ widh (the width of the block) is scanned for the j-th row in the processing target block. Then, when a black pixel is detected, the processing in steps S909 to S912 causes
Line_sy with the j-th line as the starting position of the line where the character string exists
(line), and the process proceeds to the scanning of the next line (steps S913 to S945). Here, the flag is set to “1”, and the process shifts to a process of searching for the end of the line. In the process of searching for the end of the line, even if a black pixel is detected, the determination as to the step S910 does not hold the start position.

【0029】ステップS906〜S908のループにお
いて黒画素が検出されなかった場合は、ステップS91
3において現在の処理が行の終わりを探す処理であるか
どうかが判定され、そうであればステップS916〜S
918によって、当該文字列の存在する行の高さを示す
情報が保持される。以上の処理が、当該ブロックについ
て繰り返される。
If no black pixel is detected in the loop of steps S906 to S908, step S91 is executed.
In step S3, it is determined whether the current process is a process for searching for the end of a line.
918 holds information indicating the height of the line where the character string exists. The above processing is repeated for the block.

【0030】以下、図9のフローチャートに沿ってさら
に詳細に説明する。
Hereinafter, a more detailed description will be given with reference to the flowchart of FIG.

【0031】ステップS906では画素pixel[startx+
i][starty+j]が黒か否かを判定し、黒であればステップ
S909へ、白であればステップS907へ夫々進む。
ここで、startx及びstartyは、図7のデータ構造で説明
したように処理対象のブロックの左上の座標を表してい
るので、ステップS906〜S908の処理は当該ブロ
ック内のstarty+j番目の行の各画素をx方向へ順次走査
して黒画素か否かを判定するものである。
In step S906, the pixel pixel [startx +
i] [starty + j] is determined to be black. If black, the process proceeds to step S909. If white, the process proceeds to step S907.
Here, since startx and starty represent the upper left coordinates of the processing target block as described in the data structure of FIG. 7, the processing in steps S906 to S908 is performed in the starty + j-th row in the block. Each pixel is sequentially scanned in the x direction to determine whether or not the pixel is a black pixel.

【0032】ステップS906における判定の結果が白
であった場合、さらにその次のiに対して処理を行うの
ためiをインクリメントして(ステップS908)ステ
ップS906に戻る。以上の処理を、黒画素が検出され
るまで当該ブロックの幅(width)の分実行する。
If the result of the determination in step S906 is white, i is incremented to further process the next i (step S908), and the flow returns to step S906. The above processing is executed for the width of the block until a black pixel is detected.

【0033】黒画素が検出されると、当該ライン(第j
ライン)についてそれ以上黒画素を走査する必要はない
ので、ステップS906〜S908のループを脱出して
ステップS909へ進む。
When a black pixel is detected, the corresponding line (j-th line) is detected.
Since it is not necessary to scan the black pixels any more for line (line), the process exits the loop of steps S906 to S908 and proceeds to step S909.

【0034】ステップS909では、kuroに1をセット
する。そして、ステップS910において、flagが0か
否か(即ち、文字列の行の始まりを探しているモードな
のか否か)調べる。flagが0であれば、行の始まりを探
している状態なので、ステップS911でline_sy[nlin
e]にjを代入することで、行の始まり位置を保持する。
そして、ステップS912でflagを1に変更し、処理の
状態を「文字列の行の終わりを探すモード」とする。一
方、ステップS910でflagが1であれば、文字列行の
終わりを探している状態なので、なにも行わずステップ
S913ヘ進む。
In step S909, kuro is set to 1. Then, in step S910, it is checked whether or not flag is 0 (that is, whether or not the mode is a mode for searching for the beginning of a line of a character string). If the flag is 0, it means that the beginning of the line is being searched, and therefore, in step S911, line_sy [nlin
By assigning j to e], the start position of the line is held.
Then, in step S912, the flag is changed to 1, and the processing state is set to "the mode for searching for the end of the line of the character string". On the other hand, if the flag is 1 in step S910, it means that the end of the character string line is being searched, and the process proceeds to step S913 without performing anything.

【0035】ステップS913へ進んだということは、
そのライン(第jライン)の処理が終了したことを示
す。そこで、ステップS913では、kuroが0(そのラ
インに黒画素が無く)であり、かつflagが1(行の終り
を探しているモード)であるかを判定する。この条件を
満たす場合は、文字列行の終了を示すものであり、処理
はステップS916に進む。ステップS916では、当
該文字列行の高さを示すライン数(j-line_sy[nline])
をline_h[nline]に代入する。そして、ステップS91
7においてflagを行の始まりを探すモードに戻し(flag
を0に戻し)、ステップS918でnlineをインクリメ
ントしてステップS914へ進む。一方、ステップS9
13において条件が満足されなければ、そのままステッ
プS914へ進む。
The fact that the process has proceeded to step S913 means that
Indicates that the processing of the line (j-th line) has been completed. Therefore, in step S913, it is determined whether kuro is 0 (there is no black pixel on the line) and flag is 1 (the mode for searching for the end of the line). If this condition is satisfied, it indicates the end of the character string line, and the process proceeds to step S916. In step S916, the number of lines indicating the height of the character string line (j-line_sy [nline])
To line_h [nline]. Then, Step S91
7 returns the flag to the mode of searching for the beginning of a line (flag
Is reset to 0), nline is incremented in step S918, and the flow advances to step S914. On the other hand, step S9
If the condition is not satisfied in step 13, the process proceeds to step S914.

【0036】ステップS914では、jがheightより小
さいか否かを判断する。この条件が満たされない場合
は、当該ブロック内の全ラインについて処理を終了した
ことを意味するので、本処理を終了する。一方、ステッ
プS914の条件が満足されている場合は、当該ブロッ
クに未処理のラインが存在するので、jをインクリメン
トした後ステップS904へ戻る。
In step S914, it is determined whether j is smaller than height. If this condition is not satisfied, it means that the processing has been completed for all the lines in the block, and this processing is terminated. On the other hand, if the condition of step S914 is satisfied, since an unprocessed line exists in the block, j is incremented, and the process returns to step S904.

【0037】以上の図9の処理により文字画像から行数
(nline)、各行のスタート点(line_sy[nline])、お
よび高さ(line_h[nline])を抽出することができる。
By the processing of FIG. 9, the number of lines (nline), the starting point (line_sy [nline]), and the height (line_h [nline]) of each line can be extracted from the character image.

【0038】図2の説明に戻る。ステップS105で
は、ステップS104で抽出された各行を処理するため
のループを形成する。すべての行の処理が終わったらス
テップS102に戻り次のブロックへ処理を進める。未
処理の行が存在すれば、ステップS105からステップ
S106に進む。ステップS106では図10に示すよ
うにX軸への射影を行い、スペース数カウント処理を行
う。図10は、X軸への射影処理とスペース数カウント
処理を説明する図である。なお、X軸ヘの射影処理の手
順は、上述のY軸への射影の処理の手順(図9)を変形
することにより得られることは明らかであるので、ここ
では詳細な説明を省略する。
Returning to the description of FIG. In step S105, a loop for processing each row extracted in step S104 is formed. When all the rows have been processed, the process returns to step S102 and proceeds to the next block. If there is an unprocessed row, the process proceeds from step S105 to step S106. In step S106, projection is performed on the X axis as shown in FIG. 10, and a space number counting process is performed. FIG. 10 is a diagram for explaining the projection process on the X axis and the space number counting process. It is clear that the procedure of the projection process on the X axis can be obtained by modifying the procedure of the projection process on the Y axis (FIG. 9), and thus the detailed description is omitted here.

【0039】図11は本実施形態におけるスペース数カ
ウント処理の手順を示すフローチャートである。ここ
で、X軸への射影は終了していることとして、その射影
結果はSX[i]に格納されているものとする。
FIG. 11 is a flowchart showing the procedure of the space number counting process in this embodiment. Here, it is assumed that the projection on the X axis has been completed, and the projection result is stored in SX [i].

【0040】先ずステップS1001からS1004で
各変数を初期化する。即ち、ステップS1001で文字
数カウンタn_charを0に、スペース数カウンタn_space
を−1にリセットする。ここで、n_spaceがマイナス1
なのは、実際の文字部が始まる前の白部分をカウントし
て0になるようにするためである(最初の白部分はスペ
ースとしてカウントしない)。ステップS1002で
は、所定幅に満たないスペースをスペース数カウンタに
カウントしないよう制御するのに用いる白ドットカウン
タcountを0にリセットする。さらに、ステップS10
03で文字部分なのか、スペース部分なのかを示すフラ
グstateをWHITEにする。そして、ステップS1004
で、当該文字領域矩形(ブロック)の横幅をカウントす
るためのiを0にリセットする。
First, variables are initialized in steps S1001 to S1004. That is, in step S1001, the character number counter n_char is set to 0, and the space number counter n_space
Is reset to -1. Where n_space is minus 1
The reason is that the white portion before the actual character portion starts is counted to be 0 (the first white portion is not counted as a space). In step S1002, the white dot counter count used to control the space number counter not to count the space less than the predetermined width is reset to zero. Further, step S10
In 03, a flag state indicating whether it is a character portion or a space portion is set to WHITE. Then, step S1004
Then, i for counting the width of the character area rectangle (block) is reset to 0.

【0041】以下の処理では、当該行のスペース数をカ
ウントする。ステップS1005では、横幅カウンタi
が文字領域矩形widthを超えているかどうかチェック
し、超えていたら本処理を終了する。また、超えていな
ければ、当該行に対するスペース数のカウントを続行す
べくステップS1006に進む。
In the following processing, the number of spaces in the line is counted. In step S1005, the width counter i
Is greater than or equal to the character area rectangle width, and if so, terminates this processing. If not exceeded, the flow advances to step S1006 to continue counting the number of spaces for the line.

【0042】ステップS1006では、X軸への射影結
果SX[i]が白か黒かをチェックして処理を分岐す
る。ここで、SX[i]が1のときは、射影結果が黒で
あることを示し、処理をステップS1007に進める。
一方、SX[i]が0のときは、射影結果が白であるこ
とを示し、処理をステップS1011へ進める。
In step S1006, it is checked whether the projection result SX [i] on the X axis is white or black, and the process branches. Here, when SX [i] is 1, it indicates that the projection result is black, and the process proceeds to step S1007.
On the other hand, when SX [i] is 0, it indicates that the projection result is white, and the process proceeds to step S1011.

【0043】ステップS1007〜S1010では、白
領域検出後(stateがWHITEである状態)であれば、スペ
ース部分の終わりとしてn_spaceをインクリメントす
る。それ以外の状態であれば、countを0にセットして
ステップS1005へ処理を戻す。また、ステップS1
011〜S1015では、黒領域検出後(stateがBLACK
である状態)であれば、countをインクリメントする。
射影結果の白部分が所定幅を越えていると、countが所
定値(LIMIT)を越えるので、この時点で黒領域が終了
したと判定してn_charをインクリメントするとともに、
白領域の検出を示すべくstateをWHITEに変更する。以上
の手順により、count数がLIMITを越える白領域の数がn_
spaceに格納されることになる。
In steps S1007 to S1010, if a white area has been detected (state is WHITE), n_space is incremented as the end of the space portion. Otherwise, the count is set to 0, and the process returns to step S1005. Step S1
In 011-S1015, after the black area is detected (state is BLACK
), The count is incremented.
If the white portion of the projection result exceeds the predetermined width, the count exceeds the predetermined value (LIMIT). At this point, it is determined that the black region has ended, and n_char is incremented.
Change state to WHITE to indicate detection of white area. By the above procedure, the number of white areas whose count exceeds LIMIT is n_
It will be stored in space.

【0044】各ステップについて説明すると、ステップ
S1007では射影結果が1のとき(黒であるとき)、
フラグstateがWHITEかどうかチェックし、YESのとき
はステップS1008に進み、NOのときはステップS
1010に進む。
Each step will be described. In step S1007, when the projection result is 1 (when it is black),
It is checked whether or not the flag state is WHITE. If YES, the process proceeds to step S1008, and if NO, the process proceeds to step S1008.
Proceed to 1010.

【0045】ステップS1008では、文字部分の始ま
りが検出されたとして、(すなわちスペース部分の終わ
りが検出された)としてn_spaceをインクリメントす
る。そして、ステップS1009でフラグstateをBLACK
にする。ステップS1010では白ドットカウンタcoun
tを0にする。その後ステップS1016へ進み、次の
画素へ処理を進めるべくiをインクリメントする。
In step S1008, n_space is incremented assuming that the beginning of the character portion has been detected (ie, the end of the space portion has been detected). Then, in step S1009, the flag state is set to BLACK.
To In step S1010, the white dot counter coun
Set t to 0. Thereafter, the process proceeds to step S1016, where i is incremented so as to proceed to the next pixel.

【0046】一方、射影結果が0のとき(白であると
き)は、まずステップS1011でフラグstateがBLACK
かどうかチェックし、YESのときはステップS101
2に、NOのときはステップS1016へそれぞれ進
む。ステップS1012では、白ドットカウンタcount
をインクリメントし、白ドットの連続数をカウントす
る。ステップS1013では、白ドットカウンタcount
が解像度に依ってあらかじめ決められたLIMITと比較さ
れ、LIMITより大きいときはスペースの始まり(文字部
の終了)としてステップS1014に進み、それ以外の
ときはステップS1016に進む。ステップS1014
では文字部数カウンタn_charをインクリメントする。ス
テップS1015では、白領域の検出をしめすべくフラ
グstateをWHITEにする。
On the other hand, when the projection result is 0 (when it is white), first in step S1011 the flag state is set to BLACK
It is checked whether it is, and if YES, step S101
If the answer is NO, the process proceeds to step S1016. In step S1012, the white dot counter count
Is incremented, and the number of continuous white dots is counted. In step S1013, the white dot counter count
Is compared with a LIMIT predetermined according to the resolution. If the LIMIT is larger than LIMIT, the process proceeds to step S1014 as the start of a space (end of the character portion), and otherwise proceeds to step S1016. Step S1014
Then, the character copy counter n_char is incremented. In step S1015, the flag state is set to WHITE to indicate the detection of a white area.

【0047】以上の処理により、抽出された行のスペー
ス数(n_space)が算出される。
With the above processing, the number of spaces (n_space) in the extracted row is calculated.

【0048】図2の説明に戻る。ステップS107では
文字領域横幅widthとスペース数n_spaceの比Rを求め
る。そして、ステップS108では、比Rが予め決めて
ある所定の閾値T以上かどうかチェックする。ここで、
YESならばその行は英語であると判定して、ステップ
S110ヘ進み、英語OCRを実行する。NOならばそ
の行は日本語であると判定て、ステップS109ヘ進
み、日本語OCRを実行する。図10に示した実際の文
章例によって本実施形態のスペース数カウント処理の動
作を説明する。
Returning to the description of FIG. In step S107, a ratio R between the character area width width and the number of spaces n_space is obtained. In step S108, it is checked whether the ratio R is equal to or greater than a predetermined threshold T. here,
If YES, the line is determined to be in English, and the flow proceeds to step S110 to execute English OCR. If NO, the line is determined to be in Japanese, and the flow advances to step S109 to execute Japanese OCR. The operation of the space number counting process of the present embodiment will be described with reference to an actual sentence example shown in FIG.

【0049】日本語である図10の(a)は、X軸への
射影によって本来16個に分割される。しかし、解像度
を考慮してLIMITを適切に設定することによってほとん
どの白部は消え、残るスペースは1個だけとなる。LIMI
Tは例えば、文字高さ×0.357で求めることができ
る。本例のように、文字高さが7mmであれば、7×
0.357=2.5mmとなる。よって本例では、LIMI
Tを2.5ミリとし、2.5ミリ未満の白部分を打ち消
すように設定した場合を示す(図10では文字上部に白
部分の長さをミリ数で示した)。英語である図10の
(b)は、X軸への斜影によって本来30個に分割され
る。しかし、LIMITを2.5ミリ未満の白部分を打ち消
すように設定することにより、残るスペースは4つとな
る。
FIG. 10A, which is a Japanese language, is originally divided into 16 parts by projection onto the X axis. However, by setting LIMIT appropriately in consideration of the resolution, most white parts disappear and only one space remains. LIMI
T can be obtained by, for example, character height × 0.357. If the character height is 7 mm as in this example, 7 ×
0.357 = 2.5 mm. Therefore, in this example, LIMI
A case is shown in which T is set to 2.5 mm and a white portion smaller than 2.5 mm is set to be canceled (in FIG. 10, the length of the white portion is shown in millimeters above the character). FIG. 10B, which is English, is originally divided into 30 pieces by the oblique shadow on the X axis. However, by setting LIMIT to cancel white areas less than 2.5 mm, there will be four spaces left.

【0050】図10において、日本語文字列の行(a)
と英語文字列の行(b)の各々のスペース数と横幅widt
hとの比を求めることで日本語か英語かを判別すること
ができる。ここで、比Rと閾値Tについて簡単に説明す
る。本実施敬体では、比Rは、 R=(スペース数+1)/(行横幅/(文字高さ×3.
2)) によって求める。例えば、図10の日本語の場合、スペ
ース数=1、行横幅=120.0mm、文字高さ=7.
0mmであるから、R=0.37となる。また、図10
の英語の場合、スペース数=4、行横幅=126.0m
m、文字高さ=7.0mmであるから、R=0.888
となる。このように、ステップS107で求められる日
本語と英語の比は大きく異なるので、例えば閾値Tを
0.7程度に設定しておくことで、比Rから日本語か英
語かを識別できる。
In FIG. 10, the line (a) of the Japanese character string
And the number of spaces and the width widt of each of the lines (b) of the English string
By determining the ratio to h, it can be determined whether the language is Japanese or English. Here, the ratio R and the threshold T will be briefly described. In the present embodiment, the ratio R is: R = (number of spaces + 1) / (line width / (character height × 3.
2)) For example, in the case of Japanese in FIG. 10, the number of spaces = 1, the line width = 120.0 mm, and the character height = 7.
Since it is 0 mm, R = 0.37. FIG.
In the case of English, the number of spaces = 4, line width = 126.0m
m, character height = 7.0 mm, R = 0.888
Becomes As described above, since the ratio between Japanese and English obtained in step S107 is greatly different, it is possible to identify whether the language is Japanese or English from the ratio R by setting the threshold T to about 0.7, for example.

【0051】なお、上述の実施形態において行抽出手段
は文字画像に対するY軸への斜影としたがその限りでは
ない。例えば、図2のステップS101の領域分離処理
において行抽出を行なってもいい。具体的には図5のス
テップS301における解像度変換処理、ステップS3
02における輪郭線追跡処理によって抽出されたオブジ
ェクトのうち細長いものを文字と判定する。その後ステ
ップS303の同一グループ結合を行わずに、行として
領域分離をする。この処理により図3の原稿イメージに
領域分離を実行した結果は図12の様になり、Y軸への
斜影は必要なくなる。
In the above-described embodiment, the line extracting means uses the oblique shadow of the character image on the Y axis, but the present invention is not limited thereto. For example, line extraction may be performed in the region separation processing in step S101 in FIG. Specifically, the resolution conversion processing in step S301 in FIG.
In the object extracted by the outline tracking process in 02, an elongated object is determined to be a character. After that, the regions are separated into rows without performing the same group combination in step S303. As a result of performing the area separation on the original image of FIG. 3 by this processing, the result becomes as shown in FIG. 12, and the oblique shadow on the Y axis becomes unnecessary.

【0052】また、上述の実施形態において、本処理を
施す1画素の1ビットの画像にノイズが存在していては
本アルファベット日本語判別の能力を生かせられない。
従って明らかにノイズとわかる孤立ドットなどを除去す
ることが好ましい。孤立ドット除去の方法としては画像
をウインドリングしパタンマッチングで消去する方法な
どがある。例えば、中央の画素が「1」で、周辺の8画
素が「0」である3ドット×3ドットのウインドウとパ
ターンマッチングを行い、マッチングした場合に当該中
央画素にあたる画素を「0」とする。これにより、孤立
した黒画素を消去できる。
Further, in the above-described embodiment, if noise is present in the one-bit image of one pixel to be subjected to the present process, the ability of this alphabetic Japanese discrimination cannot be utilized.
Therefore, it is preferable to remove isolated dots and the like that are clearly recognized as noise. As a method of removing isolated dots, there is a method of windling an image and erasing the pattern by pattern matching. For example, pattern matching is performed with a 3 dot × 3 dot window in which the center pixel is “1” and the surrounding eight pixels are “0”, and when matching is performed, the pixel corresponding to the center pixel is set to “0”. As a result, isolated black pixels can be erased.

【0053】また、上述の実施形態において、図2のス
テップS101の領域分離処理を施す画像は1画素1ビ
ットの2値画像としたがその限りではない。例えば1画
素8ビットの多値画像でもよい。その場合、領域分離処
理としては微分フィルタをかけて高周波成分を抽出し、
文字部、写真部に分ける方法がある。なお、上述のアル
ファベット使用言語と日本語との判別を実施するには、
上記1画素8ビットの多値画像を所定のしきい値で2値
化する必要がある。
In the above embodiment, the image to be subjected to the region separation processing in step S101 in FIG. 2 is a binary image of one bit per pixel, but is not limited thereto. For example, a multi-valued image of 8 bits per pixel may be used. In that case, as a region separation process, a high frequency component is extracted by applying a differential filter,
There is a method of dividing into a text part and a photograph part. In addition, in order to distinguish between the above-mentioned alphabet language and Japanese,
It is necessary to binarize the multi-valued image of 8 bits per pixel with a predetermined threshold value.

【0054】また、本実施形態のアルファベット使用言
語と日本語の判別を施す前に、文字画像の傾きを補正す
ることが好ましい。このような補正を行うことにより、
原稿画像が傾いた場合であっても良好な結果を得ること
ができる。傾き補正は例えば抽出した行の傾きを求め
て、座標変換することによって実現できる。
Further, it is preferable to correct the inclination of the character image before discriminating between the language using the alphabet and Japanese in the present embodiment. By performing such a correction,
Good results can be obtained even when the document image is tilted. The inclination correction can be realized, for example, by obtaining the inclination of the extracted row and performing coordinate transformation.

【0055】また、実施形態のアルファベット使用言語
と日本語の判別法を施す前に、文字画像の方向を検出す
ることによって、原稿の方向に依存しない結果を得るこ
とができる。文字画像方向の検出は、例えば領域分割に
よって抽出した文字画像を行抽出、文字抽出を実行し、
抽出した数画像を0°回転、90°回転、180°回
転、270°回転を行いOCRを行う。各回転角毎にO
CRの確信度が得られるので、それらを利用して文字画
像の方向を検出し原画像回転を行う。即ち、最も高い確
信度が得られた方向を当該領域の文字画像の方向とす
る。
Further, by detecting the direction of the character image before performing the method of discriminating between the language using the alphabet and the Japanese language according to the embodiment, a result independent of the direction of the document can be obtained. For the detection of the character image direction, for example, a line is extracted from the character image extracted by region division, and character extraction is performed.
OCR is performed by rotating the extracted several images by 0 °, 90 °, 180 °, and 270 °. O for each rotation angle
Since the degree of certainty of the CR can be obtained, the direction of the character image is detected by using them, and the original image is rotated. That is, the direction in which the highest degree of certainty is obtained is set as the direction of the character image in the area.

【0056】なお、この原画像回転を、領域分離で得ら
れた各文字データブロックに対して行うようにすれば、
1ページ中に存在する複数の文字データブロックの文字
方向が異なっているような場合でも、正確に文字列種別
を判定できる。
If this original image rotation is performed on each character data block obtained by the area separation,
Even when the character directions of a plurality of character data blocks present in one page are different, the character string type can be accurately determined.

【0057】また、上述の実施形態では、文字画像の行
抽出を行い、すべての行を抽出したあとで一番目の行の
文字抽出を行ったが、この限りではない。例えば、文字
画像の行抽出を行い、一番目の行がみつかった時点でそ
の行に対して文字抽出を行い、本アルファベットで日本
語自動判別を実施することもできる。これにより、上記
実施形態と比較して行の構造体データを格納するメモリ
などが少なくてすむといったメリットがある。
In the above-described embodiment, the line of the character image is extracted, and after extracting all lines, the character of the first line is extracted. However, the present invention is not limited to this. For example, a line extraction of a character image may be performed, and when the first line is found, character extraction may be performed on that line, and Japanese automatic discrimination may be performed using this alphabet. As a result, there is an advantage that a memory for storing the structure data of a row is smaller than in the above embodiment.

【0058】以上説明したように、上記実施形態によれ
ば、イメージより抽出された各文字列行が日本語か、ア
ルファベット使用言語かを良好に判定でき、この判定結
果に従って適切な文字認識処理を切り換えることが可能
となる。日本語と英語が混在するような原稿であって
も、精度良く文字認識を行える。
As described above, according to the above-described embodiment, it is possible to satisfactorily determine whether each character string line extracted from an image is Japanese or an alphabetic language, and perform an appropriate character recognition process according to the determination result. It is possible to switch. Even if the original is a mixture of Japanese and English, character recognition can be performed with high accuracy.

【0059】なお、本発明は、複数の機器(例えばホス
トコンピュータ,インタフェイス機器,リーダ,プリン
タなど)から構成されるシステムに適用しても、一つの
機器からなる装置(例えば、複写機,ファクシミリ装置
など)に適用してもよい。
Even if the present invention is applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), a single device (for example, a copying machine, a facsimile, etc.) Device).

【0060】また、本発明の目的は、前述した実施形態
の機能を実現するソフトウェアのプログラムコードを記
録した記憶媒体を、システムあるいは装置に供給し、そ
のシステムあるいは装置のコンピュータ(またはCPU
やMPU)が記憶媒体に格納されたプログラムコードを
読出し実行することによっても、達成されることは言う
までもない。
An object of the present invention is to provide a storage medium storing a program code of software for realizing the functions of the above-described embodiments to a system or an apparatus, and to provide a computer (or CPU) of the system or apparatus.
And MPU) read and execute the program code stored in the storage medium.

【0061】この場合、記憶媒体から読出されたプログ
ラムコード自体が前述した実施形態の機能を実現するこ
とになり、そのプログラムコードを記憶した記憶媒体は
本発明を構成することになる。
In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention.

【0062】プログラムコードを供給するための記憶媒
体としては、例えば、フロッピディスク,ハードディス
ク,光ディスク,光磁気ディスク,CD−ROM,CD
−R,磁気テープ,不揮発性のメモリカード,ROMな
どを用いることができる。
As a storage medium for supplying the program code, for example, a floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD
-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like can be used.

【0063】また、コンピュータが読出したプログラム
コードを実行することにより、前述した実施形態の機能
が実現されるだけでなく、そのプログラムコードの指示
に基づき、コンピュータ上で稼働しているOS(オペレ
ーティングシステム)などが実際の処理の一部または全
部を行い、その処理によって前述した実施形態の機能が
実現される場合も含まれることは言うまでもない。
When the computer executes the readout program code, not only the functions of the above-described embodiment are realized, but also the OS (Operating System) running on the computer based on the instruction of the program code. ) May perform some or all of the actual processing, and the processing may realize the functions of the above-described embodiments.

【0064】さらに、記憶媒体から読出されたプログラ
ムコードが、コンピュータに挿入された機能拡張ボード
やコンピュータに接続された機能拡張ユニットに備わる
メモリに書込まれた後、そのプログラムコードの指示に
基づき、その機能拡張ボードや機能拡張ユニットに備わ
るCPUなどが実際の処理の一部または全部を行い、そ
の処理によって前述した実施形態の機能が実現される場
合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into a memory provided on a function expansion board inserted into the computer or a function expansion unit connected to the computer, based on the instructions of the program code, It goes without saying that the CPU included in the function expansion board or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.

【0065】本発明を上記記憶媒体に適用する場合、そ
の記憶媒体には、先に説明したフローチャートに対応す
るプログラムコードを格納することになるが、簡単に説
明すると、図13のメモリマップ例に示す各モジュール
を記憶媒体に格納することになる。
When the present invention is applied to the storage medium, the storage medium stores program codes corresponding to the above-described flowcharts. Each module shown will be stored in a storage medium.

【0066】すなわち、少なくとも「抽出処理モジュー
ル」「カウント処理モジュール」および「判定処理モジ
ュール」の各モジュールのプログラムコードを記憶媒体
に格納すればよい。また、図13に示されるように、
「分離処理モジュール」備えることが望ましい。
That is, at least the program code of each of the "extraction processing module", "count processing module" and "judgment processing module" may be stored in the storage medium. Also, as shown in FIG.
It is desirable to have a “separation processing module”.

【0067】ここで、抽出処理モジュールは、文字画像
から行を抽出する抽出処理を実現するためのプログラム
モジュールである。また、カウント処理モジュールは、
前記抽出処理によって抽出された行について所定値以上
の幅を有するスペースの数をカウントするカウント処理
を実現するプログラムモジュールである。また、判定処
理モジュールは、前記カウント処理によってカウントさ
れたスペースの数と、当該抽出された行の幅とに基づい
て日本語の行かアルファベット使用言語の行かを判定す
る判定処理を実現するプログラムモジュールである。ま
た、分離処理モジュールは、原稿画像を示すイメージデ
ータから文字領域を分離し、前記抽出処理へ文字画像と
して提供する分離処理を実現するプログラムモジュール
である。なお、上記図示したプログラムモジュールいが
いにも、文字画像からノイズ除去を行うプログラムモジ
ュールや、原稿の傾きを補正する補正モジュール等を備
えるようにしても良いことは言うまでもない。
Here, the extraction processing module is a program module for implementing an extraction processing for extracting a line from a character image. Also, the counting module
It is a program module that implements a count process for counting the number of spaces having a width equal to or greater than a predetermined value for a row extracted by the extraction process. The determination processing module is a program module that implements a determination process of determining whether a line is a Japanese line or a line in an alphabetic language based on the number of spaces counted by the counting process and the width of the extracted line. is there. Further, the separation processing module is a program module that realizes a separation process of separating a character region from image data indicating a document image and providing the character region to the extraction process as a character image. It is needless to say that the illustrated program module may include a program module for removing noise from the character image, a correction module for correcting the inclination of the document, and the like.

【0068】[0068]

【発明の効果】以上説明したように、本発明によれば、
光学的に読取った原稿イメージより、当該イメージに含
まれる文字列がアルファベット使用言語の文字列か日本
語の文字列かを自動的に識別することが可能となる。
As described above, according to the present invention,
From the optically read document image, it is possible to automatically identify whether the character string included in the image is a character string in the alphabet language or a Japanese character string.

【0069】このため、文字認識処理において、各言語
に対応する文字認識処理を適切に選することが可能とな
る。
For this reason, in the character recognition processing, it is possible to appropriately select the character recognition processing corresponding to each language.

【0070】[0070]

【図面の簡単な説明】[Brief description of the drawings]

【図1】本実施形態による文字認識装置の構成を説明す
るブロック図である。
FIG. 1 is a block diagram illustrating a configuration of a character recognition device according to an embodiment.

【図2】本実施形態における文字列種別の判定手順を表
すフローチャートである。
FIG. 2 is a flowchart illustrating a procedure for determining a character string type according to the embodiment.

【図3】1画素1ビットの2値ビットマップ画像の一例
を示す図である。
FIG. 3 is a diagram illustrating an example of a binary bitmap image of one bit per pixel.

【図4】図3の2値ビットマップ画像に領域分割処理を
施した場合の結果を示す図である。
FIG. 4 is a diagram illustrating a result when an area division process is performed on the binary bitmap image of FIG. 3;

【図5】領域分離処理の手順の一例を示すフローチャー
トである。
FIG. 5 is a flowchart illustrating an example of a procedure of a region separation process.

【図6】ステップS301の解像度変換によって図3の
原稿を処理し、文字部分が連結した様子を示す図であ
る。
FIG. 6 is a diagram illustrating a state in which the document in FIG. 3 is processed by resolution conversion in step S301 and character portions are connected.

【図7】領域分離処理の結果を保持するためのデータ構
造の一例を説明する図である。
FIG. 7 is a diagram illustrating an example of a data structure for holding a result of the area separation processing.

【図8】Y軸への射影の実行例を示す図である。FIG. 8 is a diagram showing an example of execution of projection onto a Y axis.

【図9】本実施形態におけるY軸への射影の処理手順を
示すフローチャートである。
FIG. 9 is a flowchart illustrating a processing procedure of projection onto the Y axis in the embodiment.

【図10】X軸への射影処理とスペース数カウント処理
を説明する図である。
FIG. 10 is a diagram illustrating a projection process onto the X axis and a space number counting process.

【図11】本実施形態におけるスペース数カウント処理
の手順を示すフローチャートである。
FIG. 11 is a flowchart illustrating a procedure of a space number counting process according to the embodiment.

【図12】図3の2値ビットマップ画像に、行抽出を含
む領域分割処理を施した場合の結果を示す図である。
FIG. 12 is a diagram illustrating a result obtained when an area division process including row extraction is performed on the binary bitmap image of FIG. 3;

【図13】本発明に係る制御プログラムを格納する記憶
媒体のメモリマップ例を示す図である。
FIG. 13 is a diagram showing an example of a memory map of a storage medium storing a control program according to the present invention.

Claims (16)

【特許請求の範囲】[Claims] 【請求項1】 文字画像から行を抽出する抽出手段と、 前記抽出手段によって抽出された行について所定値以上
の幅を有するスペースの数をカウントするカウント手段
と、 前記カウント手段によってカウントされたスペースの数
と、当該抽出された行の幅とに基づいて日本語の行かア
ルファベット使用言語の行かを判定する判定手段とを備
えることを特徴とする文字列種別判定装置。
1. An extracting unit for extracting a line from a character image, a counting unit for counting the number of spaces having a width equal to or more than a predetermined value for the line extracted by the extracting unit, and a space counted by the counting unit A character string type determination device, comprising: determination means for determining whether the line is a Japanese line or a line in an alphabetic language based on the number of characters and the width of the extracted line.
【請求項2】 原稿画像を示すイメージデータから文字
領域を分離する分離手段を更に備え、 前記抽出手段は、前記分離手段で分離された文字領域か
ら行を抽出することを特徴とする請求項1に記載の文字
列種別判定装置。
2. The image processing apparatus according to claim 1, further comprising a separating unit that separates a character region from image data indicating a document image, wherein the extracting unit extracts a line from the character region separated by the separating unit. The character string type determination device according to the item.
【請求項3】 前記抽出手段は、文字画像データの所定
方向への射影によって行の抽出を行うことを特徴とする
請求項1に記載の文字列種別判定装置。
3. The character string type judging device according to claim 1, wherein said extracting means extracts lines by projecting the character image data in a predetermined direction.
【請求項4】 前記カウント手段は、 前記抽出手段で抽出された行について、行方向と垂直な
方向に射影を行って白部分を検出する検出手段を備え、 前記検出手段で検出された白部分のうち、その幅が所定
値以上のものをカウントすることを特徴とする請求項1
に記載の文字列種別判定装置。
4. The counting means includes a detecting means for projecting a row extracted by the extracting means in a direction perpendicular to a row direction to detect a white part, and the white part detected by the detecting means. 2. The method according to claim 1, wherein: the number of which is greater than a predetermined value is counted.
The character string type determination device according to the item.
【請求項5】 前記文字画像よりノイズを除去する除去
手段を更に備えることを特徴とする請求項1に記載の文
字列種別判定装置。
5. The character string type determination device according to claim 1, further comprising a removing unit that removes noise from the character image.
【請求項6】 前記抽出手段で抽出された行の傾きを検
出し、当該行の傾きを補正する補正手段を更に備えるこ
とを特徴とする請求項1に記載の文字列種別判定装置。
6. The character string type determination device according to claim 1, further comprising a correction unit that detects a slope of the line extracted by the extraction unit and corrects the slope of the line.
【請求項7】 前記文字画像より文字を抽出し、該文字
の方向を検出することにより該文字画像の方向を検出す
る方向検出手段と、 前記方向検出手段で検出された方向に基づいて前記文字
画像が所定の向きとなるように回転する回転手段とをさ
らに備えることを特徴とする請求項1に記載の文字列種
別判定装置。
7. A direction detecting means for extracting a character from the character image and detecting a direction of the character, thereby detecting a direction of the character image; and detecting the character based on the direction detected by the direction detecting means. 2. The character string type determination device according to claim 1, further comprising: a rotation unit configured to rotate the image so that the image is oriented in a predetermined direction.
【請求項8】 文字画像から行を抽出する抽出工程と、 前記抽出工程によって抽出された行について所定値以上
の幅を有するスペースの数をカウントするカウント工程
と、 前記カウント工程によってカウントされたスペースの数
と、当該抽出された行の幅とに基づいて日本語の行かア
ルファベット使用言語の行かを判定する判定工程とを備
えることを特徴とする文字列種別判定方法。
8. An extraction step of extracting a line from a character image, a counting step of counting the number of spaces having a width equal to or greater than a predetermined value for the line extracted by the extraction step, and a space counted by the counting step A character string type determination method, comprising: a determination step of determining whether the line is a Japanese line or a line in an alphabetic language based on the number of characters and the width of the extracted line.
【請求項9】 原稿画像を示すイメージデータから文字
領域を分離する分離工程を更に備え、 前記抽出工程は、前記分離工程で分離された文字領域か
ら行を抽出することを特徴とする請求項8に記載の文字
列種別判定方法。
9. The method according to claim 8, further comprising a separating step of separating a character area from image data representing a document image, wherein the extracting step extracts a line from the character area separated in the separating step. Character string type determination method described in.
【請求項10】 前記抽出工程は、文字画像データの所
定方向への射影によって行の抽出を行うことを特徴とす
る請求項8に記載の文字列種別判定方法。
10. The method according to claim 8, wherein in the extracting step, lines are extracted by projecting the character image data in a predetermined direction.
【請求項11】 前記カウント工程は、 前記抽出工程で抽出された行について、行方向と垂直な
方向に射影を行って白部分を検出する検出工程を備え、 前記検出工程で検出された白部分のうち、その幅が所定
値以上のものをカウントすることを特徴とする請求項8
に記載の文字列種別判定方法。
11. The counting step includes a detecting step of projecting a row extracted in the extracting step in a direction perpendicular to a row direction to detect a white portion, and detecting the white portion detected in the detecting step. 9. The method according to claim 8, wherein, among those, those whose width is equal to or more than a predetermined value are counted.
Character string type determination method described in.
【請求項12】 前記文字画像よりノイズを除去する除
去工程を更に備えることを特徴とする請求項8に記載の
文字列種別判定方法。
12. The method according to claim 8, further comprising a step of removing noise from the character image.
【請求項13】 前記抽出工程で抽出された行の傾きを
検出し、当該行の傾きを補正する補正工程を更に備える
ことを特徴とする請求項8に記載の文字列種別判定方
法。
13. The character string type determination method according to claim 8, further comprising a correction step of detecting the inclination of the line extracted in the extraction step and correcting the inclination of the line.
【請求項14】 前記文字画像より文字を抽出し、該文
字の方向を検出することにより該文字画像の方向を検出
する方向検出工程と、 前記方向検出工程で検出された方向に基づいて前記文字
画像が所定の向きとなるように回転する回転工程とをさ
らに備えることを特徴とする請求項8に記載の文字列種
別判定方法。
14. A direction detecting step of detecting a direction of the character image by extracting a character from the character image and detecting a direction of the character, and detecting the character based on the direction detected in the direction detecting step. The method according to claim 8, further comprising: rotating the image so that the image is oriented in a predetermined direction.
【請求項15】 画像データ中の文字列の種別を判定す
るための制御プログラムを格納するコンピュータ可読メ
モリであって、 文字画像から行を抽出する抽出工程のコードと、 前記抽出工程によって抽出された行について所定値以上
の幅を有するスペースの数をカウントするカウント工程
のコードと、 前記カウント工程によってカウントされたスペースの数
と、当該抽出された行の幅とに基づいて日本語の行かア
ルファベット使用言語の行かを判定する判定工程のコー
ドとを備えることを特徴とするコンピュータ可読メモ
リ。
15. A computer-readable memory for storing a control program for determining a type of a character string in image data, wherein the code is for an extraction step of extracting a line from a character image, and is extracted by the extraction step. A code of a counting step for counting the number of spaces having a width equal to or more than a predetermined value for a row, and using a Japanese row or alphabet based on the number of spaces counted in the counting step and the width of the extracted row. A code for a determining step of determining whether the line is a language line.
【請求項16】 原稿画像を示すイメージデータから文
字領域を分離し、前記抽出工程へ文字画像として提供す
る分離工程のコードを更に備えることを特徴とする請求
項15に記載のコンピュータ可読メモリ。
16. The computer-readable memory according to claim 15, further comprising a code of a separation step of separating a character area from image data representing a document image and providing the character area to the extraction step as a character image.
JP8173795A 1996-07-03 1996-07-03 Method and device for discriminating character string classification Withdrawn JPH1021336A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8173795A JPH1021336A (en) 1996-07-03 1996-07-03 Method and device for discriminating character string classification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8173795A JPH1021336A (en) 1996-07-03 1996-07-03 Method and device for discriminating character string classification

Publications (1)

Publication Number Publication Date
JPH1021336A true JPH1021336A (en) 1998-01-23

Family

ID=15967306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8173795A Withdrawn JPH1021336A (en) 1996-07-03 1996-07-03 Method and device for discriminating character string classification

Country Status (1)

Country Link
JP (1) JPH1021336A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009282985A (en) * 2008-05-23 2009-12-03 Sharp Corp Method of identifying orientation of digital image
US8023741B2 (en) 2008-05-23 2011-09-20 Sharp Laboratories Of America, Inc. Methods and systems for detecting numerals in a digital image
KR101272445B1 (en) * 2011-07-20 2013-06-07 후지쯔 가부시끼가이샤 Method of and device for identifying direction of characters in image block

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009282985A (en) * 2008-05-23 2009-12-03 Sharp Corp Method of identifying orientation of digital image
US8023770B2 (en) 2008-05-23 2011-09-20 Sharp Laboratories Of America, Inc. Methods and systems for identifying the orientation of a digital image
US8023741B2 (en) 2008-05-23 2011-09-20 Sharp Laboratories Of America, Inc. Methods and systems for detecting numerals in a digital image
US8229248B2 (en) 2008-05-23 2012-07-24 Sharp Laboratories Of America, Inc. Methods and systems for identifying the orientation of a digital image
US8406530B2 (en) 2008-05-23 2013-03-26 Sharp Laboratories Of America, Inc. Methods and systems for detecting numerals in a digital image
KR101272445B1 (en) * 2011-07-20 2013-06-07 후지쯔 가부시끼가이샤 Method of and device for identifying direction of characters in image block
US8737743B2 (en) 2011-07-20 2014-05-27 Fujitsu Limited Method of and device for identifying direction of characters in image block

Similar Documents

Publication Publication Date Title
US6574375B1 (en) Method for detecting inverted text images on a digital scanning device
US7454060B2 (en) Image processor for character recognition
EP0677818B1 (en) Image pre-processor for character recognition system
EP0677817B1 (en) Page segmentation and character recognition system
US5867277A (en) Reduced resolution document storage and retrieval system
EP0677811A1 (en) Image processing system with on-the-fly JPEG compression
US5650799A (en) Programmable function keys for a networked imaging computer system
JP2001043310A (en) Device and method for correcting document picture
JPH08212298A (en) Automatic judging device for document direction and automatic correcting device for document direction
US20020051574A1 (en) Character recognition method, program and recording medium
JP4613397B2 (en) Image recognition apparatus, image recognition method, and computer-readable recording medium on which image recognition program is recorded
EP0766193B1 (en) Optical character reader with skew correction
JPH1021336A (en) Method and device for discriminating character string classification
JPH08180068A (en) Electronic filing device
JP3787377B2 (en) Document orientation determination method and apparatus, and character recognition method and apparatus
JPH11219409A (en) Document reader
JP3171626B2 (en) Character recognition processing area / processing condition specification method
EP3940628A1 (en) Image processing device, image reading device, image processing method, and program
JP2006072839A (en) Image processing method, image processing apparatus, image processing program and recording medium
JP3710164B2 (en) Image processing apparatus and method
JPH09114931A (en) Device and method for recognizing character
JPH08339424A (en) Device and method for image processing
JP3517077B2 (en) Pattern extraction device and method for extracting pattern area
JPH04276888A (en) Character reader
JPH0916712A (en) Document reader

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20031007