JPH0589285A - Character row inclination detector - Google Patents

Character row inclination detector

Info

Publication number
JPH0589285A
JPH0589285A JP3251996A JP25199691A JPH0589285A JP H0589285 A JPH0589285 A JP H0589285A JP 3251996 A JP3251996 A JP 3251996A JP 25199691 A JP25199691 A JP 25199691A JP H0589285 A JPH0589285 A JP H0589285A
Authority
JP
Japan
Prior art keywords
character
line
inclination
image
picture
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.)
Pending
Application number
JP3251996A
Other languages
Japanese (ja)
Inventor
Naoki Maeda
直樹 前田
Yasuhiko Kono
靖彦 河野
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.)
Sumitomo Electric Industries Ltd
Original Assignee
Sumitomo Electric Industries Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sumitomo Electric Industries Ltd filed Critical Sumitomo Electric Industries Ltd
Priority to JP3251996A priority Critical patent/JPH0589285A/en
Publication of JPH0589285A publication Critical patent/JPH0589285A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Abstract

PURPOSE:To accurately and quickly detect the angle of inclination of a character row. CONSTITUTION:A picture compressing part 11 compresses the document picture stored in a picture memory in the row direction of the picture memory. The row direction of the picture memory is approximately parallel with the character row. A black picture element expanding part 12 expands black picture elements constituting the compressed document picture 7 times in the row direction of the picture memory. This picture is rotated at 90 deg. by a picture rotating part 13. A cell extracting part 14 scans the picture in the row direction of the memory, where the rotated picture is stored, and extracts the group of 8 or more black picture elements, which are continuous on the scanning line, as a cell. Cells are grouped correspondingly to character rows by a classifying part 15. A row direction calculating part 16 calculates a line close to coordinates of the center position of each cell constituting each group. An inclination angle calculating part 17 obtains the inclination of the line and obtains the average value. The angle of inclination of the character row is obtained based on this average value.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、光学的文字読取装置
(OCR)などで用いられ、画像メモリに傾斜状態で記
憶された文書画像の文字行の傾きを検出する装置に関す
るものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus used in an optical character reader (OCR) or the like for detecting an inclination of a character line of a document image stored in an image memory in an inclined state.

【0002】[0002]

【従来の技術】従来から、文書画像をイメージスキャナ
により光学的に読み取り、この読み取られた文書画像か
ら1文字ごとの文字画像を切り出し、この文字画像から
抽出した特徴量を、認識辞書に記憶された基本となる特
徴量と比較・照合することにより文字認識を行い、認識
された文字の文字コードを出力するようにした光学的文
字読取装置が用いられている。
2. Description of the Related Art Conventionally, a document image is optically read by an image scanner, a character image for each character is cut out from the read document image, and the feature amount extracted from this character image is stored in a recognition dictionary. There is used an optical character reading device which performs character recognition by comparing and collating with the basic characteristic amount and outputs the character code of the recognized character.

【0003】1文字ずつの文字画像の切り出しに当たっ
ては、先ず1行を構成する画像を切り出し、この1行の
画像から個別文字の文字画像が切り出される。1行の画
像の抽出を行うための一般的な手法では、文書画像に関
して文字行の方向の射影がとられて文字を構成する黒画
素の分布が求められる。そして、求められた黒画素の分
布に基づいて、白画素で分離された画像が1行の画像と
して切り出される。
When cutting out a character image for each character, first, an image forming one line is cut out, and a character image of an individual character is cut out from this one line image. In a general method for extracting an image of one line, a distribution of black pixels forming a character is obtained by projecting a document image in the direction of a character line. Then, based on the obtained distribution of black pixels, the image separated by white pixels is cut out as an image of one row.

【0004】ところが、イメージスキャナなどにより読
み取られる文書画像の文字行は、常に一定の方向を向い
ているわけではなく、読み取り操作時に不可避的に生じ
る原稿の位置決め誤差などのために、読み取られた文書
画像ごとにばらつきがある。このため、文書画像が記憶
される画像メモリにおける行方向(たとえばイメージス
キャナの主走査方向に対応した仮想的な方向をいうもの
とする。)と、この画像メモリに記憶された文書画像の
文字行の方向とは必ずしも一致するわけではない。そし
て、画像メモリの行方向に対する文字行の方向の傾斜角
が大きいときには、1行の画像の切り出しが困難にな
る。
However, the character lines of the document image read by an image scanner or the like do not always face a fixed direction, and the read document is read because of an erroneous document positioning error that occurs inevitably during a reading operation. There are variations from image to image. Therefore, the line direction in the image memory in which the document image is stored (for example, the virtual direction corresponding to the main scanning direction of the image scanner) and the character line of the document image stored in this image memory Does not necessarily match the direction of. Then, when the inclination angle of the character line direction with respect to the line direction of the image memory is large, it becomes difficult to cut out one line of the image.

【0005】そこで、画像切出しの前処理として、文字
行の傾きを検出し、この傾きを補正した後に、行切出し
処理を行う技術が提案されている。このような技術は、
たとえば、特開平2−69886号公報や特開昭62−
281084号公報などに開示されている。特開平2−
69886号公報に記載されている技術は、文書画像に
対していろいろな方向から射影をとり、この射影に基づ
いて最適な方向を見出すことで文字行の傾斜角を検出し
ている。また、特開昭62−281084号公報に開示
されている技術では、1つの文字行において行方向に離
間した2箇所に位置する文字の行方向に関する各投影分
布をとり、各文字のたとえば下端を結ぶ直線を求め、こ
の直線の傾きを基に文字行の傾斜角を検出している。
Therefore, as a pre-process for cutting out an image, a technique has been proposed in which the inclination of a character line is detected, the inclination is corrected, and then the line cutting-out processing is performed. Such technology is
For example, JP-A-2-69886 and JP-A-62-1
It is disclosed in Japanese Patent No. 281084. JP-A-2-
The technique disclosed in Japanese Patent Publication No. 69886 detects a tilt angle of a character line by projecting a document image from various directions and finding an optimal direction based on the projection. Further, in the technique disclosed in Japanese Patent Application Laid-Open No. 62-281084, the projection distributions in the line direction of characters located at two positions separated in the line direction in one character line are taken, and the lower end of each character, for example, is calculated. The connecting straight line is obtained, and the inclination angle of the character line is detected based on the inclination of this straight line.

【0006】[0006]

【発明が解決しようとする課題】ところが、特開平2−
69886号公報の開示技術では、全く任意の方向から
試行錯誤的に画像の射影をとるようにしているため、文
字行の傾きが得られるまでの処理が多くなり、処理に長
時間を要するという問題がある。しかも、文字行の傾き
を正しく検出できる保証はなく、文字行の正確な傾斜角
を求めるのが困難であるという問題もある。
However, Japanese Unexamined Patent Publication No. HEI 2-
In the technology disclosed in Japanese Patent Publication No. 69886, since an image is projected by trial and error from an arbitrary arbitrary direction, there is a large amount of processing until the inclination of the character line is obtained, and the processing takes a long time. There is. In addition, there is no guarantee that the inclination of the character line can be detected correctly, and it is difficult to obtain an accurate inclination angle of the character line.

【0007】一方、特開昭62−281084号公報の
開示技術では、上記の問題は生じないが、文字行の特定
の2箇所の画像を用いているので、行が短い場合や、長
い行と短い行とが混在している場合には、文字行の傾斜
角の検出が困難になり、結局、検出された傾斜角が不正
確になる場合がある。そこで、本発明の目的は、上述の
技術的課題を解決し、文字行の傾斜角を速やかにかつ正
確に検出できるようにした文字行の傾き検出装置を提供
することである。
On the other hand, in the technique disclosed in Japanese Patent Laid-Open No. 62-281084, the above problem does not occur, but since images at two specific places of a character line are used, when the line is short or long line, When short lines are mixed, it may be difficult to detect the inclination angle of the character line, and eventually the detected inclination angle may be incorrect. SUMMARY OF THE INVENTION An object of the present invention is to solve the above technical problems and to provide a character line inclination detection device capable of quickly and accurately detecting the inclination angle of a character line.

【0008】[0008]

【課題を解決するための手段および作用】上記の目的を
達成するための請求項1記載の文字行の傾き検出装置
は、画像記憶手段に記憶された文書画像の文字行が所定
方向に対してなす傾斜角を検出する装置であって、文字
を構成する文字構成画素を、文字行に略平行な方向に膨
張させる画素膨張手段と、画素膨張後の文書画像を文字
行に略垂直な方向に走査し、走査線上で連続する所定数
以上の文字構成画素からなるセルを抽出するセル抽出手
段と、文字行に略平行な方向に関して重なりを有すると
ともに文字行に略平行な方向の所定距離内に位置するセ
ル同士が同一グループに属するようにセルをグループ分
けする分類手段と、各グループを構成するセルの上記走
査線に沿う方向に関する中心位置の座標に基づき、文字
行の方向を算出する行方向算出手段と、上記算出された
文字行の方向が上記所定方向に対してなす角を文字行の
傾斜角として検出する傾斜角検出手段とを含むものであ
る。
According to another aspect of the present invention, there is provided a character line inclination detecting device for achieving the above object, wherein a character line of a document image stored in an image storage means is in a predetermined direction. A device for detecting a tilt angle formed, which comprises a pixel expanding means for expanding character constituting pixels forming a character in a direction substantially parallel to a character line, and a document image after the pixel expanding in a direction substantially perpendicular to the character line. A cell extracting unit that scans and extracts cells consisting of a predetermined number or more of character constituent pixels that are continuous on the scanning line, and has a overlap in the direction substantially parallel to the character line and within a predetermined distance in the direction substantially parallel to the character line. The direction of the character line is calculated based on the classification means for grouping the cells so that the located cells belong to the same group, and the coordinates of the center position of the cells forming each group with respect to the direction along the scanning line. A direction calculation means, the direction of character lines which is the calculated is intended to include an inclination angle detecting means for detecting a tilt angle of the character lines an angle with respect to the predetermined direction.

【0009】上記の構成によれば、画素膨張手段により
文字構成画素が文字行に略平行な方向に膨張され、これ
により各行を構成する1行ごとの文書画像が、1または
数個の画素塊となる。この膨張処理後の文書画像は、文
字行に略垂直な方向に走査され、走査線上で文字構成画
素が所定数以上連続するときに、このような文字構成画
素群がセルとしてセル抽出手段に抽出される。
According to the above arrangement, the pixel expanding means expands the character-constituting pixels in a direction substantially parallel to the character line, so that the document image for each line forming each line becomes one or several pixel blocks. Becomes The document image after the expansion processing is scanned in a direction substantially perpendicular to the character line, and when the character-constituting pixels are consecutive for a predetermined number or more on the scanning line, such a character-constituting pixel group is extracted as a cell by the cell extracting means. To be done.

【0010】このようにして抽出されたセルは、文字行
に略平行な方向に関して重なりを有するとともに文字行
に略平行な方向の所定距離内に位置するセル同士が同一
グループに属するように、グループ分けされる。この結
果、各グループは、文書画像を構成するそれぞれの文字
行に対応する。行方向算出手段では、各グループを構成
するセルの走査線に沿う方向に関する中心位置の座標が
求められ、この座標に基づいて文字行の方向が算出され
る。そして、算出された文字行の方向と所定方向との間
の角が文字行の傾斜角として検出される。
The cells extracted in this way are grouped so that cells that have an overlap in the direction substantially parallel to the character line and are located within a predetermined distance in the direction substantially parallel to the character line belong to the same group. Be divided. As a result, each group corresponds to each character line forming the document image. The line direction calculating means obtains the coordinates of the center position in the direction along the scanning line of the cells forming each group, and calculates the direction of the character line based on these coordinates. Then, the angle between the calculated direction of the character line and the predetermined direction is detected as the inclination angle of the character line.

【0011】画像記憶手段に記憶される文書画像は、一
般に、文字行の方向が全く未知なのではなく、或るばら
つきはあるものの、縦書き文書および横書き文書のそれ
ぞれに対して略一定の方向に沿っている。このため、文
字行の方向を求める際に、全ての方向に関して文書画像
の投影をとったりすることは不必要である。そこで、本
発明では、文字行の大体の方向が予め判っていることに
基づいて、略文字行に沿う方向に画素を膨張させて文字
行の抽出を容易にし、また、画素膨張後の文書画像を文
字行に略直交する方向に走査したりすることで、文字行
に対応したセルのグループを抽出している。このような
処理は、全ての方向に関して画像の投影をとる処理より
も格段に短時間で終えることができ、しかも、最終的に
得られる文字行の傾斜角も確実に高精度のものとなる。
The document image stored in the image storage means is generally such that the direction of the character line is not completely unknown, and although there are some variations, the document image is in a substantially constant direction for each of the vertical writing document and the horizontal writing document. Along Therefore, when obtaining the direction of the character line, it is unnecessary to project the document image in all directions. Therefore, in the present invention, based on the fact that the general direction of the character line is known in advance, the pixels are expanded in the direction substantially along the character line to facilitate the extraction of the character line, and the document image after the pixel expansion is performed. By scanning in a direction substantially orthogonal to the character line, the group of cells corresponding to the character line is extracted. Such a process can be completed in a much shorter time than the process of projecting an image in all directions, and the inclination angle of the finally obtained character line can be surely highly accurate.

【0012】また、文字行を構成する画像のうち特定の
箇所の画像を用いるのではなく、文字行を構成する画像
の全てを用いて文字行の傾斜角を検出するようにしてい
るから、文字行の長さが短い場合や、文字行に長短があ
る場合でも、傾斜角を正確に検出することができる。な
お、上記行方向算出手段は、各グループを構成するセル
の走査線に沿う方向に関する中心位置の座標に基づい
て、各セルの中心位置に近接した直線をグループごとに
求める手段を含むものであってもよい。
[0012] Further, instead of using an image of a specific portion of the image forming the character line, the inclination angle of the character line is detected by using all the images forming the character line. Even if the line length is short or the character line is long or short, the tilt angle can be accurately detected. The row direction calculating means includes means for obtaining, for each group, a straight line that is close to the center position of each cell, based on the coordinates of the center position in the direction along the scanning line of the cells that form each group. May be.

【0013】このようにして求められた直線の方向は、
各文字行の方向に対応することになる。また、上記傾斜
角検出手段は、各グループごとに求められた上記の各直
線が上記所定方向に対してなす傾斜角を求める手段と、
各直線の傾斜角の平均値を文字行の傾斜角として求める
手段とを含むものであってもよい。
The direction of the straight line thus obtained is
It corresponds to the direction of each character line. Further, the inclination angle detecting means, means for obtaining an inclination angle formed by each of the straight lines obtained for each group with respect to the predetermined direction,
A means for obtaining the average value of the inclination angle of each straight line as the inclination angle of the character line may be included.

【0014】これにより、各文字行の傾斜角の平均値
が、文字行の傾斜角とされることになり、文字行の傾斜
角を正確に検出できる。
As a result, the average value of the inclination angle of each character line is set as the inclination angle of the character line, and the inclination angle of the character line can be accurately detected.

【0015】[0015]

【実施例】以下では、本発明の実施例を、添付図面を参
照して詳細に説明する。図2は本発明の一実施例の文字
行の傾き検出装置1を適用した光学的文字読取装置(O
CR)の基本的な構成を示すブロック図である。イメー
ジスキャナなどを含む画像入力装置2で読み取られた文
書画像は、画像メモリ3に記憶される。この画像メモリ
3に記憶された文書画像は、文字切出部4により1文字
ごとの文字画像に切り出され、この切り出された文字画
像に基づいて文字認識部5での認識処理が行われる。そ
して、認識処理の結果として、文字コードが出力され
る。
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. FIG. 2 shows an optical character reader (O) to which the character line inclination detection device 1 according to an embodiment of the present invention is applied.
It is a block diagram showing a basic configuration of (CR). The document image read by the image input device 2 including an image scanner or the like is stored in the image memory 3. The document image stored in the image memory 3 is cut out into a character image for each character by the character cutout unit 4, and the character recognition unit 5 performs recognition processing based on the cutout character image. Then, the character code is output as a result of the recognition process.

【0016】文字切出部4での切出処理は、先ず、1頁
分の文書画像から、1行の画像が切り出される。そし
て、この切り出された1行の画像から、1文字ごとの文
字画像が切り出されることになる。1行の画像の切出し
に当たっては、傾き検出装置1で検出される文字行の傾
斜角が参照される。図1は、傾き検出装置1の構成を示
すブロック図である。この傾き検出装置1は、画像メモ
リ3に記憶された文書画像の文字行の方向が、画像メモ
リ3の行方向(たとえばイメージスキャナの主走査方向
に対応する仮想的な方向をいうものとする。)に対して
なす傾斜角を検出するものである。このような傾斜角に
基づく補正を施して1行の画像の切出しを行うことで、
この1行の画像の切出しの最適化を図ることができ、ひ
いては文字画像の抽出の最適化が図られ、文字認識処理
の精度の向上に寄与することができる。
In the cut-out processing in the character cut-out unit 4, first, one line of the image is cut out from the document image for one page. Then, a character image for each character is cut out from the cut-out one line image. When the image of one line is cut out, the inclination angle of the character line detected by the inclination detection device 1 is referred to. FIG. 1 is a block diagram showing the configuration of the tilt detection device 1. In the tilt detection device 1, the direction of the character lines of the document image stored in the image memory 3 is a line direction of the image memory 3 (for example, a virtual direction corresponding to the main scanning direction of the image scanner). ) Is detected. By performing the correction based on the inclination angle and cutting out the image of one line,
It is possible to optimize the cutout of the image of one line, and thus optimize the extraction of the character image, which can contribute to the improvement of the accuracy of the character recognition processing.

【0017】以下では、横書き文書が、画像メモリ3の
行方向に対して或る傾斜角をなして記憶されている場合
を例にとって説明する。画像メモリ3に記憶された文書
画像は、先ず画像圧縮部11に与えられ、行方向(すな
わち文字行に略平行な方向)に対して画像が圧縮され
る。このとき得られる圧縮後の文書画像の一例が図3に
示されている。このような画像の圧縮処理は、処理対象
のデータを減少させて処理時間の短縮化を図るととも
に、傾斜角の検出精度を劣化させないために行われる処
理である。なお、図3において、R1は行方向を示す。
In the following, an example will be described in which a horizontally written document is stored with a certain inclination angle with respect to the line direction of the image memory 3. The document image stored in the image memory 3 is first given to the image compression unit 11, and the image is compressed in the line direction (that is, the direction substantially parallel to the character line). An example of the compressed document image obtained at this time is shown in FIG. Such an image compression process is a process performed in order to reduce the data to be processed to shorten the processing time and to prevent deterioration in the inclination angle detection accuracy. In FIG. 3, R1 indicates the row direction.

【0018】圧縮後の文書画像は、次に黒画素膨張部1
2に与えられる。この黒画素膨張部12では、圧縮後の
文書画像を構成する各画素が画像メモリ3の行方向(す
なわち文字行に略平行な方向)にたとえば7倍に膨張さ
せられる。すなわち、1個の画素が存在するときには、
その左右3個ずつの画素も黒画素とされる。このような
画素膨張処理により、1行を構成する画像が1または数
個の黒画素の塊となる。画素膨張後の文書画像の一例を
図4に示す。
The compressed document image is next processed by the black pixel expansion unit 1.
Given to 2. In the black pixel expansion section 12, each pixel forming the compressed document image is expanded by, for example, 7 times in the row direction of the image memory 3 (that is, the direction substantially parallel to the character line). That is, when there is one pixel,
Three pixels on each of the left and right sides are also black pixels. By such pixel expansion processing, the image forming one row becomes a mass of one or several black pixels. An example of the document image after pixel expansion is shown in FIG.

【0019】黒画素膨張後の文書画像は、画像回転部1
3に与えられ、図4の矢印R2方向に90度だけ回転さ
せられ、図5に示すような画像とされる。このような文
書画像の回転処理は、次に述べる画像データの走査の便
宜のために行われる処理である。この回転後の文書画像
はセル抽出部14に与えられる。このセル抽出部14で
は、図5の状態で図外のメモリに記憶された文書画像
が、当該メモリの行方向R11(この方向は、文字行に
略垂直な方向に対応する。)に走査される。すなわち、
画像データが1バイト毎に走査され、8個の黒画素が連
続している箇所が検索される。このような箇所が検索さ
れたときには、その箇所の黒画素群が、走査線上での所
定数(8個)以上連続した黒画素群であるセルとして抽
出されるとともに、その前後に連続している黒画素の数
が計算され、当該セルを構成する黒画素の数が図外のメ
モリに記憶される。このとき、セルの左端および走査線
上での中心位置の座標もメモリに記憶される。さらに、
全ての画像データに関して走査が終了すると、全てのセ
ルの中で最も長いセル(構成画素数が最大のセル)が求
められ、この最長のセルの0.72倍未満の長さのセル
は、セルから除外される。
The document image after black pixel expansion is the image rotation unit 1.
3 and is rotated by 90 degrees in the direction of arrow R2 in FIG. 4 to obtain an image as shown in FIG. Such a rotation process of the document image is a process performed for convenience of scanning the image data described below. The rotated document image is provided to the cell extraction unit 14. In the cell extracting unit 14, the document image stored in the memory (not shown) in the state of FIG. 5 is scanned in the row direction R11 of the memory (this direction corresponds to the direction substantially perpendicular to the character line). It That is,
The image data is scanned byte by byte, and a location where eight black pixels are continuous is searched. When such a portion is searched, the black pixel group at that portion is extracted as a cell that is a black pixel group that is continuous for a predetermined number (8) or more on the scanning line, and is continuous before and after that. The number of black pixels is calculated, and the number of black pixels forming the cell is stored in a memory (not shown). At this time, the coordinates of the left end of the cell and the center position on the scanning line are also stored in the memory. further,
When scanning is completed for all image data, the longest cell (cell having the largest number of pixels) of all cells is obtained, and the cell having a length less than 0.72 times the longest cell is a cell. Excluded from.

【0020】次に、分類部15では、セルのグループ分
けが行われる。すなわち、同一行を構成する文字画像に
対応したセル毎にセルが分類される。このセルの分類
は、図6(a) 〜(d) に示すように、回転処理後の文書画
像が記憶されるメモリの列方向R12(図5参照。な
お、この方向は、文字行に略平行な方向に対応する。)
に関して重なりを有し、しかも列方向R12に沿う間隔
dが15画素以内であるセルC1,C2に対して、同一
グループの番号を付与するようにして行われる。
Next, the classification unit 15 performs cell grouping. That is, the cells are classified into cells corresponding to the character images forming the same row. As shown in FIGS. 6 (a) to 6 (d), this cell is classified in the column direction R12 (see FIG. 5) of the memory in which the document image after the rotation processing is stored. It corresponds to the parallel direction.)
The cells C1 and C2 that overlap each other and have a distance d of 15 pixels or less along the column direction R12 are assigned the same group number.

【0021】このようにして全てのセルが分類される
と、次に、行方向算出部16では、個々のグループ毎
に、当該グループを構成する各セルの中心位置の座標に
対して、最少二乗法などの直線近似処理が施され、各グ
ループに対応する直線L1,L2,L3,・・・・(図5参
照。)が求められる。この直線L1,L2,L3,・・・・
の方向は、元の文書画像を圧縮してさらに90度回転さ
せた場合の文字行の方向に対応する。
When all the cells have been classified in this way, the row direction calculation unit 16 then determines, for each group, at least two coordinates with respect to the coordinates of the center position of each cell forming the group. A straight line approximation process such as multiplication is performed to obtain straight lines L1, L2, L3, ... (See FIG. 5) corresponding to each group. This straight line L1, L2, L3, ...
The direction of corresponds to the direction of the character line when the original document image is compressed and further rotated by 90 degrees.

【0022】次に、傾斜角算出部17では、上記の直線
L1,L2,L3,・・・・が回転後の文書画像を記憶した
メモリの列方向R12に対してなす角度θ1,θ2,θ
3,・・・・が求められ、さらに、これらの角度の平均値θ
mが求められる。そして、この平均値θmに基づいて、
画像を1/8に圧縮する前の傾斜角θが演算される。こ
の傾斜角θとは、文書画像の文字行の方向が画像メモリ
2の行方向に対してなす角である。このようにして演算
された傾斜角θが文字切出し部4に入力されることにな
る。
Next, in the tilt angle calculation unit 17, the angles .theta.1, .theta.2, .theta. Formed by the straight lines L1, L2, L3, ... With respect to the column direction R12 of the memory storing the rotated document image.
3, ..., and the average value θ of these angles
m is required. Then, based on this average value θm,
The tilt angle θ before the image is compressed to 1/8 is calculated. The tilt angle θ is an angle formed by the direction of the character line of the document image with respect to the line direction of the image memory 2. The inclination angle θ calculated in this way is input to the character cutout unit 4.

【0023】以上のように本実施例の文字行の傾き検出
装置では、横書き文書を文書入力装置2で読み取って画
像メモリ3に記憶させた場合に、文字行の方向が画像メ
モリ3の行方向に略一致することを利用している。すわ
なち、行方向への画像圧縮、行方向への黒画素の膨張、
画像メモリ3の列方向(回転後の像が記憶されたメモリ
の行方向に対応する。)への走査によるセルの抽出など
の処理を通じて、試行錯誤的な文書画像の投影処理を行
うことなく、文字行の方向を正確に検出している。した
がって、文字行の傾斜角の検出が、簡単な処理で短時間
に行え、しかも正確に行えるから、文字認識処理の終了
までの時間を格段に短縮することができる。
As described above, in the character line inclination detecting device of this embodiment, when a horizontally written document is read by the document input device 2 and stored in the image memory 3, the direction of the character line is the line direction of the image memory 3. It is used to match approximately. That is, image compression in the row direction, expansion of black pixels in the row direction,
Through processing such as cell extraction by scanning in the column direction of the image memory 3 (corresponding to the row direction of the memory in which the rotated image is stored), without performing trial-and-error projection processing of the document image, The direction of the character line is accurately detected. Therefore, the inclination angle of the character line can be detected by a simple process in a short time and accurately, and thus the time until the end of the character recognition process can be significantly shortened.

【0024】しかも、文字行の特定の箇所の画像を用い
ているのではなく、文字行を構成する全ての画像を用い
て各文字行の傾斜角を検出しており、さらに各文字行の
傾斜角の平均値をとって文字行の傾斜角を求めるように
しているから、1行が短い場合や、行に長短がある場合
でも、文字行の傾斜角を高精度で検出できる。この結
果、1行の画像の切出しの最適化が図られ、したがって
文字画像の切出しも最適化されるから、文字認識処理が
極めて良好に行えるようになる。
Moreover, the inclination angle of each character line is detected not by using the image of a specific portion of the character line but by using all the images forming the character line, and the inclination of each character line is further detected. Since the inclination angle of the character line is obtained by taking the average value of the angles, the inclination angle of the character line can be detected with high accuracy even if one line is short or the line is long or short. As a result, the cutout of the image of one line is optimized, and the cutout of the character image is also optimized, so that the character recognition processing can be performed extremely well.

【0025】なお、本発明は上記の実施例に限定される
ものではない。たとえば、上記の実施例では、文書画像
を圧縮し、次に黒画素を膨張させ、さらに画像を回転さ
せているが、これらの処理順序は交換されてもよく、回
転処理→圧縮処理→画素膨張処理の順序で行わせたり、
圧縮処理→回転処理→画素膨張処理の順で各処理を行わ
せても同一の結果が得られる。なお、上記の文書画像の
圧縮処理は省かれてもよいが、この処理を省くとデータ
が増大するため処理時間が長くなるおそれがある。ま
た、上記の回転処理も省かれてもよいが、この回転処理
を省くと文書画像の走査をメモリの列方向に行うことと
なるため、処理が繁雑化して処理時間が長くなるおそれ
がある。
The present invention is not limited to the above embodiment. For example, in the above embodiment, the document image is compressed, then the black pixels are expanded, and then the image is rotated. However, the processing order may be exchanged, and the rotation process → the compression process → the pixel expansion may be performed. Or let them be done in the order of processing
Even if the respective processes are performed in the order of compression process → rotation process → pixel expansion process, the same result can be obtained. The compression processing of the document image may be omitted, but if this processing is omitted, the processing time may be long because the data is increased. Further, although the above rotation processing may be omitted, if this rotation processing is omitted, the scanning of the document image is performed in the column direction of the memory, which may complicate the processing and increase the processing time.

【0026】また、上記の実施例では、横書き文書の文
字行の傾斜角が検出される場合を例にとったが、縦書き
文書の場合も同様であり、画像圧縮処理および画素膨張
処理を画像メモリ3の列方向に関して行えばよい。ただ
し、この場合には、セル抽出のための文書画像の走査
は、画像メモリ3の行方向に関して行えばよいから、文
書画像の回転処理は省かれることが好ましい。
In the above embodiment, the case where the inclination angle of the character line of the horizontally written document is detected is taken as an example, but the same applies to the case of the vertically written document, in which the image compression processing and the pixel expansion processing are performed. It may be performed in the column direction of the memory 3. However, in this case, since the scanning of the document image for cell extraction may be performed in the row direction of the image memory 3, it is preferable to omit the rotation process of the document image.

【0027】また、上記の実施例では、白色の背景に黒
色で文字が形成されている場合を想定しているが、たと
えば黒色の背景に白色の文字が形成されている場合につ
いても本発明は容易に応用することができ、白画素に関
して画素の膨張やセル抽出の各処理を行わせればよい。
さらにまた、上記の実施例では、イメージスキャナなど
を含む文書入力装置2により、文書画像が取得される構
成について説明したが、たとえば文書画像に対応する画
像データが通信回線を介して取得される構成に対しても
本発明は容易に応用することができる。
Further, in the above embodiment, it is assumed that black characters are formed on a white background, but the present invention is also applicable to the case where white characters are formed on a black background, for example. It can be easily applied, and each process of expanding a pixel and extracting a cell may be performed on a white pixel.
Furthermore, in the above-described embodiment, the document input device 2 including an image scanner or the like describes the configuration in which the document image is acquired. However, for example, the configuration in which the image data corresponding to the document image is acquired through the communication line. The present invention can be easily applied to the above.

【0028】その他、本発明の要旨を変更しない範囲で
種々の設計変更を施すことが可能である。
Besides, various design changes can be made within the scope of the present invention.

【0029】[0029]

【発明の効果】以上のように本発明の文字行の傾き検出
装置によれば、全ての方向に関して文書画像の投影をと
ったりするような繁雑な処理を要することなく、文字行
の抽出を短時間でしかも正確に行うことができる。ま
た、文字行を構成する画像のうち特定の箇所の画像を用
いるのではなく、文字行を構成する画像の全てを用いて
文字行の傾斜角を検出するようにしているから、文字行
の長さが短い場合や、文字行に長短がある場合でも、傾
斜角を正確に検出することができる。
As described above, according to the character line inclination detecting apparatus of the present invention, character line extraction can be performed in a short time without requiring complicated processing such as projecting a document image in all directions. And it can be done accurately. In addition, the inclination angle of a character line is detected by using all of the images that form the character line instead of using the image of a specific part of the image that forms the character line. Even if the length is short or the character line is long or short, the tilt angle can be accurately detected.

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

【図1】本発明の一実施例の文字行の傾き検出装置の基
本的な構成を示すブロック図である。
FIG. 1 is a block diagram showing a basic configuration of a character line inclination detection device according to an embodiment of the present invention.

【図2】上記の傾き検出装置が適用される光学的文字読
取装置の全体の構成を示すブロック図である。
FIG. 2 is a block diagram showing an overall configuration of an optical character reading device to which the above tilt detecting device is applied.

【図3】圧縮処理後の文書画像を示す図である。FIG. 3 is a diagram showing a document image after compression processing.

【図4】画素膨張処理後の文書画像を示す図である。FIG. 4 is a diagram showing a document image after pixel expansion processing.

【図5】回転処理後の文書画像を示す図である。FIG. 5 is a diagram showing a document image after rotation processing.

【図6】セルをグループ分けする分類処理を説明するた
めの図である。
FIG. 6 is a diagram for explaining a classification process for grouping cells.

【符号の説明】[Explanation of symbols]

1 傾き検出装置 2 画像入力装置 3 画像メモリ 4 文字切出部 5 文字認識部 11 画像圧縮部 12 黒画素膨張部 13 画像回転部 14 セル抽出部 15 分類部 16 行方向算出部 17 傾斜角算出部 DESCRIPTION OF SYMBOLS 1 Inclination detection device 2 Image input device 3 Image memory 4 Character cutout part 5 Character recognition part 11 Image compression part 12 Black pixel expansion part 13 Image rotation part 14 Cell extraction part 15 Classification part 16 Row direction calculation part 17 Inclination angle calculation part

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】画像記憶手段に記憶された文書画像の文字
行が所定方向に対してなす傾斜角を検出する装置であっ
て、 文字を構成する文字構成画素を、文字行に略平行な方向
に膨張させる画素膨張手段と、 画素膨張後の文書画像を文字行に略垂直な方向に走査
し、走査線上で連続する所定数以上の文字構成画素から
なるセルを抽出するセル抽出手段と、 文字行に略平行な方向に関して重なりを有するとともに
文字行に略平行な方向の所定距離内に位置するセル同士
が同一グループに属するように、セルをグループ分けす
る分類手段と、 各グループを構成するセルの上記走査線に沿う方向に関
する中心位置の座標に基づき、文字行の方向を算出する
行方向算出手段と、 上記算出された文字行の方向が上記所定方向に対してな
す角を文字行の傾斜角として検出する傾斜角検出手段と
を含むことを特徴とする文字行の傾き検出装置。
1. A device for detecting an inclination angle formed by a character line of a document image stored in an image storage means with respect to a predetermined direction, wherein character constituting pixels constituting a character are arranged in a direction substantially parallel to the character line. A pixel expanding means for expanding the image into pixels, a cell extracting means for scanning the document image after the pixel expanding in a direction substantially perpendicular to a character line, and extracting a cell consisting of a predetermined number or more of character constituent pixels continuous on a scanning line; Classifying means for grouping cells so that cells having an overlap in the direction substantially parallel to the lines and located within a predetermined distance in the direction substantially parallel to the character lines belong to the same group, and cells constituting each group Of the line direction calculation means for calculating the direction of the character line based on the coordinates of the center position with respect to the direction along the scanning line, and the inclination of the character line with respect to the predetermined direction. Inclination detecting apparatus of a character row, characterized in that it comprises an inclined angle detecting means for detecting a corner.
【請求項2】上記行方向算出手段は、各グループを構成
するセルの走査線に沿う方向に関する中心位置の座標に
基づいて、各セルの中心位置に近接した直線をグループ
ごとに求める手段を含むものであることを特徴とする請
求項1記載の文字行の傾き検出装置。
2. The row direction calculating means includes means for obtaining, for each group, a straight line that is close to the center position of each cell, based on the coordinates of the center position in the direction along the scanning line of the cells that form each group. The character line inclination detection device according to claim 1, wherein the inclination detection device is a character line inclination detection device.
【請求項3】上記傾斜角検出手段は、各グループごとに
求められた上記の各直線が上記所定方向に対してなす傾
斜角を求める手段と、各直線の傾斜角の平均値を文字行
の傾斜角として求める手段とを含むものであることを特
徴とする請求項2記載の文字行の傾き検出装置。
3. The inclination angle detecting means obtains an inclination angle formed by each of the straight lines obtained for each group with respect to the predetermined direction, and an average value of the inclination angles of the straight lines in a character line. 3. The character line inclination detecting apparatus according to claim 2, further comprising means for obtaining an inclination angle.
JP3251996A 1991-09-30 1991-09-30 Character row inclination detector Pending JPH0589285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3251996A JPH0589285A (en) 1991-09-30 1991-09-30 Character row inclination detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3251996A JPH0589285A (en) 1991-09-30 1991-09-30 Character row inclination detector

Publications (1)

Publication Number Publication Date
JPH0589285A true JPH0589285A (en) 1993-04-09

Family

ID=17231102

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3251996A Pending JPH0589285A (en) 1991-09-30 1991-09-30 Character row inclination detector

Country Status (1)

Country Link
JP (1) JPH0589285A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07192086A (en) * 1993-12-27 1995-07-28 Ricoh Co Ltd Picture inclination detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07192086A (en) * 1993-12-27 1995-07-28 Ricoh Co Ltd Picture inclination detection method

Similar Documents

Publication Publication Date Title
JP2835274B2 (en) Image recognition device
US5410611A (en) Method for identifying word bounding boxes in text
US5539841A (en) Method for comparing image sections to determine similarity therebetween
US5045677A (en) Combining bar code read data from a plurality of scanning lines formed from one-dimensional images
JP2986383B2 (en) Method and apparatus for correcting skew for line scan images
KR100247970B1 (en) Direction correction method of document image
US5708730A (en) Table recognition apparatus
JPH05242292A (en) Separating method
JPH05250409A (en) High-speed detection for page direction
US7350710B2 (en) Two-dimensional code extracting method
US6683983B1 (en) Document-inclination detector
US5887083A (en) Method of processing image information based on object model
JPH0589285A (en) Character row inclination detector
JP3337592B2 (en) Mark position detecting device and mark position detecting method
JPH04276888A (en) Character reader
JPH08123963A (en) Method and device for image recognition
JP4011859B2 (en) Word image normalization device, word image normalization program recording medium, and word image normalization program
JP2824372B2 (en) Report recognition device
US6738530B1 (en) Method of recognizing character in which correction of inclination of character is carried out and apparatus for carrying out this method
JP2802132B2 (en) Image forming device
JP2813601B2 (en) Tabular document recognition device
JP2004171337A (en) Image photographing unit
JPH11250179A (en) Character reocognition device and its method
JPS61196382A (en) Character segmenting system
JP2963474B2 (en) Similar character identification method