JP2893747B2 - Document image tilt detection method and apparatus - Google Patents

Document image tilt detection method and apparatus

Info

Publication number
JP2893747B2
JP2893747B2 JP1226944A JP22694489A JP2893747B2 JP 2893747 B2 JP2893747 B2 JP 2893747B2 JP 1226944 A JP1226944 A JP 1226944A JP 22694489 A JP22694489 A JP 22694489A JP 2893747 B2 JP2893747 B2 JP 2893747B2
Authority
JP
Japan
Prior art keywords
projection information
shift
binary
shift amount
binary projection
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.)
Expired - Lifetime
Application number
JP1226944A
Other languages
Japanese (ja)
Other versions
JPH0390980A (en
Inventor
善丈 辻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP1226944A priority Critical patent/JP2893747B2/en
Publication of JPH0390980A publication Critical patent/JPH0390980A/en
Application granted granted Critical
Publication of JP2893747B2 publication Critical patent/JP2893747B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、画像入力装置より入力された文書画像の傾
き検出方法及びその装置に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and a device for detecting the inclination of a document image input from an image input device.

〔従来技術〕(Prior art)

一般印刷文書等を自動的に読み取るためには、まず、
スキャナー等の画像入力装置を用いて、一般印刷文書等
を2値に量子化された文書画像として取り込む必要があ
るが、入力時の傾きがあるので、入力画像における水平
あるいは垂直走査方向に対して多少傾くのが普通であ
る。そのために、文字行の行間が狭い文書などでは、文
字行が検出できなくなったり、あるいは画像入力装置の
解像度を上げるなど、性能面での劣化が生じるため、予
め入力された文書画像の傾きを検出する必要がある。
To automatically read general printed documents, etc., first,
It is necessary to capture a general print document or the like as a binary quantized document image using an image input device such as a scanner. It is normal to lean a little. For this reason, in a document in which the character line spacing is narrow, the character line cannot be detected, or the resolution of the image input device is increased. There is a need to.

従来、このような文書画像では、その中心である文章
領域が規則正しく文字が並んでいることを利用して傾き
検出が行われる。
Conventionally, in such a document image, inclination detection is performed by utilizing the fact that the central text region is regularly arranged with characters.

例えば、「書式指定情報によらない紙面構成要素抽出
法」(電子情報通信学会、論文誌D,voL.J66-D,No.1,PP1
11〜118,1983)に示されているように、傾き角θを順次
変更しながら、角度θ方向にヒストグラムを作成し、ヒ
ストグラム上の山・谷が顕著に出現する角度θを傾き角
として求める第1方式が知られている。
For example, “Paper component extraction method without format specification information” (IEICE, Transaction D, voL.J66-D, No.1, PP1
11 to 118, 1983), a histogram is created in the angle θ direction while sequentially changing the inclination angle θ, and the angle θ at which peaks and valleys on the histogram appear remarkably is determined as the inclination angle. The scheme is known.

また、上記資料に示されているように、入力文書画像
を複数の帯状の領域に分割し、画素単位のヒストグラム
を作成して、隣接する各領域間のヒストグラム分布に対
する相関値から傾き角θを求める第2の方式が知られて
いる。
Further, as shown in the above document, the input document image is divided into a plurality of band-shaped regions, a histogram is created in pixel units, and the inclination angle θ is calculated from the correlation value for the histogram distribution between adjacent regions. A second method of seeking is known.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

しかしながら、上記第1の方式では、角度θ方向が変
化する毎にヒストグラムを算出する必要があり、処理時
間にかかる問題があった。
However, in the first method, it is necessary to calculate the histogram every time the angle θ direction changes, and there is a problem that processing time is required.

また、第2の方式では、隣接する帯状ごとに、ヒスト
グラムの山・谷(本文行、行間に相当)に対応させ、傾
き角θを求めるため、文字サイズが変化する文字行が含
まれると傾き検出精度が劣化する。
Further, in the second method, the inclination angle θ is obtained for each of the adjacent strips in correspondence with the peaks and valleys of the histogram (corresponding to the main text line and the space between the lines). The detection accuracy deteriorates.

更に、上記第1の方式や第2の方式の如く、文字行が
規則的に並んでいることのみを利用すると、表などの領
域が含まれると、傾き検出精度が劣化し、コストパフォ
ーマンスに問題が生じる。
Further, if only the fact that character lines are regularly arranged as in the first method and the second method is used, if a region such as a table is included, the inclination detection accuracy is degraded, resulting in a problem in cost performance. Occurs.

そこで、本発明の目的は、従来の上記課題を解決する
ために、文書全体のレイアウトが矩形上に規則的に配置
されることから、文字行や表などを傾き方向に射影した
場合、その射影即ち、文字行や表枠を表わす黒画素の幅
が最小となることを利用することによって、文字サイズ
の変化する文字行や表などが含まれていても安定にしか
も容易に文書画像の傾き検出を可能とした文書画像傾き
検出装置を提供することにある。
Therefore, an object of the present invention is to solve the above-described conventional problems, because the layout of the entire document is regularly arranged on a rectangle, so that when a character line or a table is projected in a tilt direction, the projection is performed. In other words, by utilizing the fact that the width of the black pixel representing a character line or a table frame is minimized, even if a character line or a table whose character size changes is included, the inclination of the document image can be detected stably and easily. It is an object of the present invention to provide a document image inclination detecting device which enables the above.

本発明の他の目的は、入力文書画像を帯状に複数の領
域に分けて、各領域毎に所定走査方向に黒画素の有無の
みを検出した2値射影情報を抽出し、各2値射影情報を
階段状にずらしながらそれらの論理和をとった累積2値
射影情報に基づいて傾き検出を行うことによって、処理
速度が改善された文書画像の傾き検出装置を提供するこ
とにある。
Another object of the present invention is to divide an input document image into a plurality of regions in a band shape, extract binary projection information that detects only the presence or absence of black pixels in a predetermined scanning direction for each region, and extract each binary projection information. The object of the present invention is to provide a document image inclination detecting apparatus in which the processing speed is improved by performing the inclination detection based on the accumulated binary projection information obtained by calculating the logical sum thereof while shifting the steps in a stepwise manner.

(課題を解決するための手段) 前述の課題を解決するために、本発明による文書画像
傾き検出方法は、2値に量子化された文書画像の傾き検
出方法において、垂直又は水平方向に一定サイズの帯状
に複数個の部分領域の各部分領域毎に、前記文書画像を
水平又は垂直方向に走査し、各走査ライン上に黒画素が
存在するか否かを調べ、各走査ライン上の黒画素の有無
を示す2値射影情報を抽出し、隣接する前記2値射影情
報を階段状に上下又は左右のずらし方向に所定のずらし
量だけずらして読み出し、前記複数個の2値射影の論理
和を求めて累積2値射影情報を抽出し、前記上下又は左
右方向へのずらし量を変化させて前記累積2値射影情報
の黒画素数を求め、前記黒画素数が最小となるずらし量
及びずらし方向を検出する。
(Means for Solving the Problems) In order to solve the above-mentioned problems, a method for detecting the inclination of a document image according to the present invention is a method for detecting the inclination of a binary-quantized document image, the method comprising: The document image is scanned in a horizontal or vertical direction for each of a plurality of partial areas in a strip shape, and it is checked whether or not a black pixel exists on each scan line. The binary projection information indicating the presence / absence of the binary projection is extracted, and the adjacent binary projection information is read in a stepwise manner by shifting a predetermined shift amount in a vertical or horizontal shift direction, and a logical sum of the plurality of binary projections is obtained. The cumulative binary projection information is extracted to obtain the number of black pixels of the cumulative binary projection information by changing the shift amount in the vertical or horizontal direction, and the shift amount and the shift direction in which the number of black pixels is minimized Is detected.

また、本発明文書画像傾き検出装置は、2値に量子化
された文書画像を記憶するメモリと、垂直又は水平方向
に一定サイズの帯状に複数個の部分領域を設定し、前記
文書画像を水平又は垂直方向に走査し、各走査ラインの
黒画素の有無を検出する2値射影抽出手段と、隣接する
前記2値射影情報を上下又は左右のずらし方向及び所定
のずらし量に従って、シフトするシフト演算手段と、階
段状にずらした前記複数個の2値射影情報の論理和を算
出する累積2値射影抽出手段と、前記累積2値射影情報
の黒画素数を検出する黒画素数算出手段と、前記ずらし
量及びずらし方向を変化させるカウンタと、前記ずらし
量及びずらし方向を変化させて得られた複数個の前記累
積2値射影情報の黒画素数の最小値を検出する手段とを
具備する。
Further, the document image inclination detecting apparatus of the present invention sets a memory for storing a binary-quantized document image and a plurality of partial areas in a band of a certain size in the vertical or horizontal direction, and horizontally sets the document image. Alternatively, a binary projection extracting unit that scans in the vertical direction and detects the presence or absence of a black pixel in each scanning line, and a shift operation that shifts the adjacent binary projection information according to a vertical or horizontal shift direction and a predetermined shift amount Means, cumulative binary projection extraction means for calculating the logical sum of the plurality of binary projection information shifted stepwise, and black pixel number calculation means for detecting the number of black pixels of the cumulative binary projection information, A counter for changing the shift amount and the shift direction; and means for detecting a minimum value of the number of black pixels of the plurality of cumulative binary projection information obtained by changing the shift amount and the shift direction.

更に、本発明の文書画像傾き検出装置は、2値に量子
化された文書画像を記憶するメモリと、垂直又は水平方
向に一定サイズの帯状に複数個の部分領域を設定し、前
記文書画像を水平又は垂直方向に走査し、各走査ライン
上の黒画素の有無を検出する2値射影抽出手段と、隣接
する前記2値射影情報を上下又は左右のずらし方向及び
所定のずらし量に従ってシフトするシフト演算手段と、
階段状にずらした前記複数個の2値射影情報の論理和を
算出する累積2値射影情報抽出手段と、前記累積2値射
影情報の黒画素数を検出する黒画素数算出手段と、前記
ずらし量を変化させるカウンタと、前記ずらし量が1に
おける上下等の2通りのずらし方向に対して算出される
前記累積2値射影情報の黒画素数の最小値を検出し、ず
らし方向を決定する手段と、決定された前記ずらし方向
に対して、前記ずらし量を2から始めて順次増加させて
得られた前記累積2値射影情報の黒画素数が既に検出さ
れた前記累積2値射影情報の黒画素数より大きくなるか
否かを調べて、前記ずらし量の増加を中断する手段とを
具備する。
Further, the document image inclination detecting device of the present invention sets a memory for storing a binary quantized document image and a plurality of partial areas in a vertical or horizontal direction in a band of a certain size, and Binary projection extraction means for scanning in the horizontal or vertical direction to detect the presence or absence of a black pixel on each scanning line, and a shift for shifting the adjacent binary projection information according to a vertical or horizontal shift direction and a predetermined shift amount Arithmetic means;
Cumulative binary projection information extracting means for calculating the logical sum of the plurality of binary projection information shifted stepwise; black pixel number calculating means for detecting the number of black pixels of the cumulative binary projection information; A counter for changing the amount, and a means for detecting the minimum value of the number of black pixels of the cumulative binary projection information calculated for two kinds of shifting directions such as up and down when the shifting amount is 1, and determining the shifting direction. With respect to the determined shift direction, the number of black pixels of the cumulative binary projection information obtained by sequentially increasing the shift amount starting from 2 is the number of black pixels of the cumulative binary projection information already detected. Means for checking whether or not the shift amount becomes larger than the number and suspending the increase in the shift amount.

〔実施例〕〔Example〕

以下に本発明の実施例について図面を参照しながら説
明する。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.

第1図は、傾いて入力された文書画像を一定サイズの
帯状に垂直方向に分解して得られる部分領域に対して、
水平方向に走査して黒画素の有無を示す2値射影情報を
求める原理を説明した図である。
FIG. 1 shows a partial area obtained by vertically decomposing a document image input at an angle into a band of a certain size.
FIG. 4 is a diagram illustrating the principle of obtaining binary projection information indicating the presence or absence of a black pixel by scanning in a horizontal direction.

第1図(a)において、斜線で文書画像内の文字や線
を示している。図中0,2,4……24は、水平方向の各走査
ラインを示しており、矢印で、各走査ライン上で最初に
検出される黒画素の位置までの距離を示している。
In FIG. 1 (a), characters and lines in the document image are indicated by oblique lines. In the figure, 0, 2, 4,..., 24 indicate each scanning line in the horizontal direction, and arrows indicate the distance to the position of the first black pixel detected on each scanning line.

第1図(b)は、第1図(a)に対して得られる2値
射影情報を示している。即ち、第1図(a)の走査ライ
ン4では文字部を示す黒画素が存在するため、第1図
(b)の走査ライン4には“1"が記憶され、走査ライン
10には、黒画素が存在しないため、第1図(b)の走査
ライン10が記憶される。このようにして、各走査ライン
に対して、黒画素の存在を表わす“1"か“0"らなる2値
射影情報が得られる。
FIG. 1B shows the binary projection information obtained for FIG. 1A. That is, since there is a black pixel indicating a character portion in the scanning line 4 in FIG. 1A, “1” is stored in the scanning line 4 in FIG.
Since no black pixel exists in 10, the scan line 10 of FIG. 1B is stored. In this way, binary projection information consisting of "1" or "0" indicating the presence of a black pixel is obtained for each scanning line.

第2図は、本発明における傾き検出方法の原理を説明
するために示した図である。
FIG. 2 is a view for explaining the principle of the tilt detection method according to the present invention.

第2図(a)は、傾いて入力された文書画像を示し、
図中点線で垂直方向に一定サイズΔmで3個の部分領域
i(i=0,1,2)に分割した様子を示している。
FIG. 2 (a) shows a document image input at an angle,
The dotted line in the figure shows a state where the image is divided into three partial areas i (i = 0, 1, 2) with a constant size Δm in the vertical direction.

第2図(b)は、第2図(a)で示した3個の部分領
域i(i=0,1,2)に対して、それぞれ、第1図で示し
た2値射影情報を示しており、図中黒でぬりつぶした領
域は黒画素が存在することを示している。
FIG. 2B shows the binary projection information shown in FIG. 1 for each of the three partial areas i (i = 0, 1, 2) shown in FIG. 2A. In the figure, the black region indicates that a black pixel exists.

傾き検出は、次のように行う。部分領域0を基準とし
て、上下方向にずらし量Δt(Δt=0,1,2,3……)を
設定し、部分領域1の2値射影情報の読出し位置を上下
方向にΔtだけ、部分領域2の2値射影情報の読出し位
置を上下方向に2Δtだけ(即ち、部分領域iに対して
ずらし量i・Δt)ずらして、3個の2値射影情報の論
理和を求めることによって、3個の部分領域の2値射影
情報を重ね合わせた累積2値射影情報を検出する。
The inclination detection is performed as follows. The shift amount Δt (Δt = 0, 1, 2, 3,...) In the vertical direction is set with reference to the partial area 0, and the readout position of the binary projection information of the partial area 1 is set in the vertical direction by Δt. By shifting the readout position of the binary projection information of 2 in the vertical direction by 2Δt (that is, the shift amount i · Δt with respect to the partial area i), and obtaining the logical sum of the three pieces of binary projection information, The accumulated binary projection information obtained by superimposing the binary projection information of the partial area of is detected.

第2図(c)は第2図(b)で示した各部分領域の2
値射影情報に対して得られる累積2値射影情報を示して
いる。
FIG. 2 (c) is a drawing of each partial area 2 shown in FIG. 2 (b).
It shows the cumulative binary projection information obtained for the value projection information.

第2図(c)では、ずらし量Δt=0の場合と下方向
にΔtだけ部分領域iの2値射影情報の読み出し位置を
ずらした場合が示される。
FIG. 2C shows a case where the shift amount Δt = 0 and a case where the readout position of the binary projection information of the partial area i is shifted downward by Δt.

傾き検出では、上述したずらし量とずらし方向(上方
向か下方向)を求めることによって行う。即ち、上方向
か下方向にΔtだけずらした時に得られる累積2値射影
情報の黒画素数が最小となるずらし方向とずらし量を求
めれば良い。例えば、第2図(c)では、下方向にΔt
だけずらした方が累積2値射影情報の黒画素数が小さい
(図中では黒のぬりつぶしの面積に相当)ことがわか
る。
The tilt detection is performed by obtaining the above-described shift amount and shift direction (upward or downward). That is, the shift direction and the shift amount at which the number of black pixels of the cumulative binary projection information obtained when the shift is performed by Δt in the upward or downward direction may be obtained. For example, in FIG.
It can be seen that the shift by only a small amount results in a smaller number of black pixels in the cumulative binary projection information (corresponding to the area of black fill in the figure).

ここで、ずらし方向とずらし量Δtが求まると、傾き
値θは、 となり、ずらし方向により傾き角の符号が判明すること
になる。
Here, when the shift direction and the shift amount Δt are obtained, the inclination value θ is Thus, the sign of the tilt angle is determined according to the shift direction.

ここで、第1の発明では、予め一定の許容値Tを設け
て置き、上方向及び下方向ともにずらし量Δtを0,1,2
……Tまで変化させて、それぞれ累積2値射影情報を抽
出してそれらの黒画素数の中から、最小となるずらし量
及びずらし方向を決めるようにしている。
Here, in the first invention, a predetermined allowable value T is provided in advance, and the shift amount Δt is set to 0, 1, 2 in both the upward and downward directions.
... T, the accumulated binary projection information is extracted, and the minimum shift amount and shift direction are determined from the number of black pixels.

また、第2の発明では、第一発明の処理速度を向上さ
せるために、まず、上方向及び下方向に対してずらし量
Δt=1で累積2値射影情報内の黒画素数を比較して、
ずらし方向を決定する。
Further, in the second invention, in order to improve the processing speed of the first invention, first, the number of black pixels in the cumulative binary projection information is compared with the shift amount Δt = 1 in the upward and downward directions. ,
Determine the shift direction.

次にずらし方向が決まると、ずらし量Δt=0,1,2,…
…を順次増加させて行き、1つの前に抽出された累積2
値射影情報の黒画素数の方が小さくなった時に、ずらし
量Δtを決定するようにしている。
Next, when the shift direction is determined, the shift amount Δt = 0, 1, 2,.
.. Are sequentially increased, and one previously extracted cumulative 2
When the number of black pixels in the value projection information becomes smaller, the shift amount Δt is determined.

第3図は、第1の発明の一実施例を示す機能ブロック
図である。パタンメモリ1は文書画像を量子化された画
像情報として記憶する。
FIG. 3 is a functional block diagram showing one embodiment of the first invention. The pattern memory 1 stores a document image as quantized image information.

2値射影情報抽出部2は、第1図及び第2図(a)で
説明したように、所定方向に一定サイズのm個の部分領
域i(i=0,1,2……m−1)を設定し、各部分領域i
毎に走査し、各走査ライン上の黒画素の有無を示す2値
射影情報を抽出し、順次2値射影情報記憶部3に格納す
る。
As described with reference to FIGS. 1 and 2 (a), the binary projection information extraction unit 2 includes m partial areas i (i = 0, 1, 2,... ) Is set and each partial area i
Scanning is performed every time, and binary projection information indicating the presence or absence of a black pixel on each scanning line is extracted and sequentially stored in the binary projection information storage unit 3.

部分領域カウンタ5であり、2値射影情報記憶部3に
格納された第i番目の部分領域(i=0,1,2,……m−
1)に対応しており、順次部分領域iの2値射影情報が
シフト演算部4で処理され、論理和演算部9に転送され
た時点でカウントアップされる。尚、部分領域カウンタ
5の最大値は、m−1とする。
The partial area counter 5, which is an i-th partial area (i = 0, 1, 2,..., M−2) stored in the binary projection information storage unit 3.
This corresponds to 1), and the binary projection information of the partial area i is sequentially processed by the shift operation unit 4 and counted up when it is transferred to the logical sum operation unit 9. Note that the maximum value of the partial area counter 5 is m-1.

ずらし量カウンタ6は、第2図(b)で説明したよう
にずらし量Δtを表わす。ずらし方向レジスタ8は、第
2図(b)で説明したように、ずらし方向(例えば、上
方向又は下方向)を表わしている。
The shift amount counter 6 indicates the shift amount Δt as described with reference to FIG. The shift direction register 8 indicates a shift direction (for example, upward or downward) as described with reference to FIG. 2B.

2値射影情報記憶部3に格納された部分領域i(i=
0,1,2,……m−1)の2値射影情報がシスト演算部4に
転送されると、部分領域カウンタ5の内容とずらし量カ
ウンタ6の内容との積(即ち、i・Δt)が乗算部7で
計算されることによって部分領域iの2値射影情報が、
乗算部7の出力値及びずらし方向レジスタ8の内容に従
ってシストされて論理和演算部9へ転送される。
The partial area i (i = i = n) stored in the binary projection information storage unit 3
When the binary projection information of (0, 1, 2,..., M-1) is transferred to the cyst operation unit 4, the product of the contents of the partial area counter 5 and the contents of the shift amount counter 6 (i. ) Is calculated by the multiplication unit 7 to obtain binary projection information of the partial area i.
In accordance with the output value of the multiplication unit 7 and the contents of the shift direction register 8, the data is transferred to the OR operation unit 9.

論理和演算部9では、累積2値射影情報記憶部10に格
納された累積2値射影情報(但し、初期値はθとす
る。)とシスト演算部4への出力値との論理和を計算
し、累積2値射影情報記憶部10へ転送する。
The logical sum operation unit 9 calculates the logical sum of the cumulative binary projection information (the initial value is assumed to be θ) stored in the cumulative binary projection information storage unit 10 and the output value to the cyst calculation unit 4. Then, it is transferred to the cumulative binary projection information storage unit 10.

同様にして、m個の部分領域i(i=0,1,2,……m−
1)の2値射影情報が順次シスト演算部4に転送され、
論理和演算部9を介すことによって、累積2値射影情報
記憶部10には、ずらし量カウンタ6の内容であるずらし
量Δt及びずらし方向レジスタ8の内容であるずらし方
向に対する第2図(c)で示したような累積2値射影情
報が記憶される。
Similarly, m partial areas i (i = 0, 1, 2,..., M−
The binary projection information of 1) is sequentially transferred to the cyst operation unit 4,
Through the logical sum operation unit 9, the cumulative binary projection information storage unit 10 stores the shift amount Δt as the content of the shift amount counter 6 and the shift direction as the content of the shift direction register 8 in FIG. ) Is stored.

次に、累積2値射影情報記憶部10の内容が読み出さ
れ、黒画素数算出部11で前述した累積2値射影情報の黒
画素数が算出され比較部12へ転送される。
Next, the contents of the cumulative binary projection information storage unit 10 are read out, and the number of black pixels of the cumulative binary projection information described above is calculated by the black pixel number calculation unit 11 and transferred to the comparison unit 12.

比較部12では、最小黒画素数記憶部13に格納された最
小黒画素数(初期値は非常に大きな値とする。)と比較
し、黒画素算出部11の出力値の方が最小黒画素数記憶部
13の内容よりも小さければ、黒画素算出部11の出力値を
最小黒画素数記憶部13へ転送すると共に、制御部(図中
省略)によって、ずらし量カウンタ6の内容及びずらし
方向レジスタ8の内容をそれぞれずらし量記憶部14及び
ずらし方向記憶部14に転送する。
The comparison unit 12 compares the output value of the black pixel calculation unit 11 with the minimum black pixel number by comparing the minimum black pixel number stored in the minimum black pixel number storage unit 13 (the initial value is a very large value). Number storage
If it is smaller than the content of the shift register 13, the output value of the black pixel calculation unit 11 is transferred to the minimum black pixel count storage unit 13, and the content of the shift amount counter 6 and the shift direction register 8 are controlled by the control unit (omitted in the figure). The contents are transferred to the shift amount storage unit 14 and the shift direction storage unit 14, respectively.

次に、ずらし量カウンタ6の内容が1カウントアップ
され、以上述べた動作を繰り返し行い、ずらし量カウン
タ6の内容がある一定の許容値Tに達するまで行う。
Next, the content of the shift amount counter 6 is counted up by one, and the above-described operation is repeated until the content of the shift amount counter 6 reaches a certain allowable value T.

ずらし量カウンタ6の内容がある一定の許容値Tに達
すると、次に、ずらし方向レジスタ8の内容を変更(例
えば0から1にするなど)することによって、ずらし方
向を変え、(例えば下方向から上方向へ)以上述べた動
作を繰り返して行う。
When the content of the shift amount counter 6 reaches a certain allowable value T, the shift direction is changed by changing the content of the shift direction register 8 (for example, from 0 to 1) (for example, in the downward direction). The above operation is repeated.

その結果、ずらし方向記憶部14及びずらし量記憶部15
に、ずらし方向とずらし量が求められ、それらによって
容易に傾き検出を行うことができる。
As a result, the shift direction storage unit 14 and the shift amount storage unit 15
In addition, the shift direction and the shift amount are obtained, so that the inclination can be easily detected by using them.

第4図は、第2の発明の一実施例を示す機能ブロック
図である。
FIG. 4 is a functional block diagram showing one embodiment of the second invention.

パタンメモリ1は、文書画像を量子化された画像情報
として記憶する。
The pattern memory 1 stores a document image as quantized image information.

2値射影情報抽出部2は、第1図及び第2図(a)で
説明したように、所定方向に一定サイズのm個の部分領
域i(i=0,1,2,……m−1)を設定し、各部分領域i
毎に走査し、各走査ライン上の黒画素の有無を示す2値
射影情報を抽出し、順次2値射影情報記憶部3に格納す
る。
As described with reference to FIGS. 1 and 2 (a), the binary projection information extraction unit 2 includes m partial areas i (i = 0, 1, 2,... 1) is set and each partial area i
Scanning is performed every time, and binary projection information indicating the presence or absence of a black pixel on each scanning line is extracted and sequentially stored in the binary projection information storage unit 3.

部分領域カウンタ5は、2値射影情報記憶部3に格納
された第i番目の部分領域(i=0,1,2,……m−1)に
対応しており、順次部分領域iの2値射影情報がシスト
演算部4で処理され、論理和演算部9に転送された時点
でカウントアップされる。尚、部分領域カウンタ5の最
大値はm-1とする。
The partial area counter 5 corresponds to the i-th partial area (i = 0, 1, 2,..., M−1) stored in the binary projection information storage unit 3, and sequentially stores 2 of the partial area i. The value projection information is processed by the cyst operation unit 4 and counted up when it is transferred to the OR operation unit 9. Note that the maximum value of the partial area counter 5 is m- 1 .

ずらし量カウンタ6は、第2図(b)で説明したよう
にずらし量Δtを表わす。ずらし方向レジスタ8は、第
2図(b)で説明したように、ずらし方向(例えば、上
方向又は下方向)を表わしている。
The shift amount counter 6 indicates the shift amount Δt as described with reference to FIG. The shift direction register 8 indicates a shift direction (for example, upward or downward) as described with reference to FIG. 2B.

2値射影情報記憶部3に格納された部分領域i(i=
0,1,2,……m−1)の2値射影情報がシスト演算部4に
転送されると、部分領域カウンタ5内容とずらし量カウ
ンタ6の内容との積(即ち、i・Δt)が乗算部7で計
算されることによって部分領域iの2値射影情報が、乗
算部7の出力値及びずらし方向レジスタ8の内容に従っ
てシストされて論理和演算部9へ転送される。
The partial area i (i = i = n) stored in the binary projection information storage unit 3
When the binary projection information (0, 1, 2,..., M-1) is transferred to the cyst operation unit 4, the product of the contents of the partial area counter 5 and the contents of the shift amount counter 6 (i.e., i.DELTA.t) Is calculated by the multiplication unit 7, the binary projection information of the partial area i is cysted in accordance with the output value of the multiplication unit 7 and the contents of the shift direction register 8, and is transferred to the logical sum operation unit 9.

論理和演算部9では、累積2値射影情報記憶部10に格
納された累積2値射影情報(但し、初期値は0とす
る。)とシスト演算部4への出力値との論理和を計算
し、累積2値射影情報記憶部10へ転送する。
The logical sum operation unit 9 calculates the logical sum of the cumulative binary projection information (the initial value is set to 0) stored in the cumulative binary projection information storage unit 10 and the output value to the cyst calculation unit 4. Then, it is transferred to the cumulative binary projection information storage unit 10.

同様にして、m個の部分領域i(i=0,1,2,……m−
1)の2値射影情報が順次シスト演算部4に転送され、
論理和演算部9を介すことによって、累積2値射影情報
記憶部10には、ずらし量カウンタ6の内容であるずらし
量Δt及びずらし方向レジスタ8の内容であるずらし方
向に対する第2図(c)で示したような累積2値射影情
報が記憶される。
Similarly, m partial areas i (i = 0, 1, 2,..., M−
The binary projection information of 1) is sequentially transferred to the cyst operation unit 4,
Through the logical sum operation unit 9, the cumulative binary projection information storage unit 10 stores the shift amount Δt as the content of the shift amount counter 6 and the shift direction as the content of the shift direction register 8 in FIG. ) Is stored.

以上の機能は、第3図で示した前述第1の発明と同等
なものである。
The above functions are equivalent to those of the first embodiment shown in FIG.

次に、累積2値射影情報記憶部10の内容が読み出さ
れ、黒画素数算出部11で累積2値射影情報の黒画素数が
算出され選択部21へ転送される。
Next, the contents of the cumulative binary projection information storage unit 10 are read out, and the number of black pixels of the cumulative binary projection information is calculated by the black pixel number calculation unit 11 and transferred to the selection unit 21.

選択部21では、ずらし量カウンタ6の内容によって黒
画素数算出部11の出力値が最小値算出部22か比較部24へ
転送されるかが選択される。
The selection unit 21 selects whether the output value of the black pixel number calculation unit 11 is transferred to the minimum value calculation unit 22 or the comparison unit 24 according to the contents of the shift amount counter 6.

即ち、ずらし量カウンタ6の内容が1以下の場合(例
えば、第2図(b)で説明したように、ずらし量Δt=
0、上方向及び下方向に対するずらし量Δt=1の3通
り)についてのみ、累積2値射影情報の黒画素数が最小
値算出部22へ転送される。ここで、上記3通りの場合が
制御部(図中省略)によって先立って実行される。
That is, when the content of the shift amount counter 6 is 1 or less (for example, as described in FIG. 2B, the shift amount Δt =
(For 0, three shift amounts Δt = 1 in the upward and downward directions), the number of black pixels of the accumulated binary projection information is transferred to the minimum value calculation unit 22. Here, the above three cases are executed beforehand by the control unit (omitted in the figure).

最小値算出部22は、上記3つの黒画素数の最小値を検
出し、最小黒画素記憶部23に転送すると共に、制御部に
よって、それに対応するずらし量Δtをずらし量記憶部
15に、またずらし方向をずらし方向記憶部14及びずらし
方向レジスタ8に転送される。尚、最小値算出部22で、
ずらし量Δt=0の場合が検出されると、ずらし量Δt
をずらし量記憶部15に転送して、動作が終了となる。
The minimum value calculation unit 22 detects the minimum value of the three black pixel numbers, transfers the minimum value to the minimum black pixel storage unit 23, and controls the corresponding shift amount Δt by the control unit.
The shift direction is transferred to the shift direction storage unit 14 and the shift direction register 8. Note that the minimum value calculation unit 22 calculates
When the case where the shift amount Δt = 0 is detected, the shift amount Δt
Is transferred to the shift amount storage unit 15, and the operation is completed.

次に、ずらし量カウンタの内容であるずらし量Δt=
2にセットすると、同様にして、累積2値射影情報の黒
画素数を検出すると、選択部21を通して、ずらし量Δt
=2に対する黒画素数が比較部24に転送され、最小黒画
素記憶部23の内容と比較される。
Next, the shift amount Δt = the content of the shift amount counter
When the number is set to 2, similarly, when the number of black pixels of the accumulated binary projection information is detected, the shift amount Δt
The number of black pixels corresponding to = 2 is transferred to the comparison unit 24 and compared with the contents of the minimum black pixel storage unit 23.

比較部24において、最小黒画素記憶部23の内容が選択
部21を通じて比較部24に入力された値よりも大きけれ
ば、その値を最小黒画素記憶部23へ転送すると共に、ず
らし量カウンタ6の内容をずらし量記憶部15へ転送し、
ずらし量カウンタ6の値を1カウントアップし、同様な
操作が繰り返される。
In the comparing section 24, if the content of the minimum black pixel storage section 23 is larger than the value input to the comparing section 24 through the selection section 21, the value is transferred to the minimum black pixel storage section 23 and the shift amount counter 6 Transfer the contents to the shift amount storage unit 15,
The value of the shift amount counter 6 is incremented by one, and the same operation is repeated.

一方、比較部24において、最小黒画素記憶部23の内容
が選択部21を通じて比較部24に入力された値よりも小さ
ければ動作が終了となる。尚、ずらし量カウンタ6の値
が一定の許容値Tを超えても上記動作が終了するものと
する。
On the other hand, in the comparing section 24, if the content of the minimum black pixel storage section 23 is smaller than the value input to the comparing section 24 through the selecting section 21, the operation is terminated. It is assumed that the above operation is completed even when the value of the shift amount counter 6 exceeds a certain allowable value T.

上記動作が終了すると、ずらし方向記憶部14及びずら
し量記憶部15にはそれぞれずらし方向及びずらし量が格
納されることになる。
When the above operation is completed, the shift direction storage unit 14 and the shift amount storage unit 15 store the shift direction and the shift amount, respectively.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明の文書画像傾き検出方法
およびその装置によれば、文書画像内に文字サイズの変
化する文字行や表などが含まれた状態で、傾きが生じて
も、容易にしかも安定に傾き検出ができるため、コスト
パフォーマンスを著しく改善することができる。
As described above, according to the document image inclination detecting method and apparatus of the present invention, even if the document image includes a character line or a table of which the character size changes in the document image, even if the inclination occurs, it can be easily performed. Moreover, since the inclination can be detected stably, cost performance can be remarkably improved.

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

第1図は、傾いて入力され文書画像上の部分領域に対し
て、水平方向に走査して黒画素の有無を調べることによ
って得られる2値射影情報を説明するための図、第2図
は、本発明における傾き検出方法の原理を説明するため
に示す図、第3図は、第1の発明の実施例を示す機能ブ
ロック図、第4図は第2の発明の一実施例を示す機能ブ
ロック図である。 1……パタンメモリ、2……2値射影情報抽出部、3…
…2値射影情報記憶部、4……シスト演算部、5……部
分領域カウンタ、6……ずらし量カウンタ、7……乗算
部、8……ずらし方向レジスタ、9……論理和演算部、
10……累積2値射影情報記憶部、11……黒画素数算出
部、12……比較部、13……最小黒画素数記憶部、14……
ずらし方向記憶部、15……ずらし量記憶部、21……選択
部、22……最小値算出部、23……最小黒画素記憶部、24
……比較部。
FIG. 1 is a diagram for explaining binary projection information obtained by scanning a partial region on a document image input in an inclined manner in the horizontal direction to check for the presence or absence of a black pixel. FIG. FIG. 3 is a diagram illustrating the principle of the tilt detection method according to the present invention, FIG. 3 is a functional block diagram illustrating an embodiment of the first invention, and FIG. 4 is a function illustrating an embodiment of the second invention. It is a block diagram. 1 ... pattern memory, 2 ... binary projection information extraction unit, 3 ...
... Binary projection information storage section, 4... Cyst operation section, 5... Partial area counter, 6... Shift amount counter, 7... Multiplication section, 8.
10: cumulative binary projection information storage unit, 11: black pixel number calculation unit, 12: comparison unit, 13: minimum black pixel number storage unit, 14 ...
Shift direction storage unit, 15 shift amount storage unit, 21 selection unit, 22 minimum value calculation unit, 23 minimum black pixel storage unit, 24
...... Comparative part.

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】2値に量子化された文書画像の傾き検出方
法において、垂直又は水平方向に一定サイズの帯状に複
数個の部分領域の各部分領域毎に、前記文書画像を水平
又は垂直方向に走査し、各走査ライン上の黒画像の有無
を示す2値射影情報を抽出し、隣接する前記2値射影情
報を階段状に上下又は左右のずらし方向に所定のずらし
量だけずらして読み出し、前記複数個の2値射影の論理
和を求めて累積2値射影情報を抽出し、前記上下又は左
右方向へのずらし量を変化させて前記累積2値射影情報
の黒画素数を求め、前記黒画素数が最小となるずらし量
及びずらし方向を検出することを特徴とする文書画像傾
き検出方法。
1. A method for detecting the inclination of a binary-quantized document image, comprising the steps of: vertically or horizontally dividing the document image in a horizontal or vertical direction for each of a plurality of partial regions in a band of a certain size in a vertical or horizontal direction. To extract binary projection information indicating the presence or absence of a black image on each scanning line, and read out the adjacent binary projection information in a stepwise manner by shifting a predetermined shift amount in a vertical or horizontal shift direction, The cumulative binary projection information is extracted by calculating the logical sum of the plurality of binary projections, and the number of black pixels of the cumulative binary projection information is determined by changing the amount of shift in the vertical or horizontal direction. A document image inclination detecting method, wherein a shift amount and a shift direction at which the number of pixels is minimized are detected.
【請求項2】2値に量子化された文書画像を記憶するメ
モリと、垂直又は水平方向に一定サイズの帯状に複数個
の部分領域を設定し、前記文書画像を水平又は垂直方向
に走査し、各走査ラインの黒画素の有無を検出する2値
射影抽出手段と、隣接する前記2値射影情報を上下又は
左右のずらし方向及び所定のずらし量に従ってシフトす
るシフト演算手段と、階段状にずらした前記複数個の2
値射影情報の論理和を算出する累積2値射影情報抽出手
段と、前記累積2値射影情報の黒画素数を検出する黒画
素数算出手段と、前記ずらし量及びずらし方向を変化さ
せるカウンタと、前記ずらし量及びずらし方向を変化さ
せて得られた複数個の前記累積2値射影情報の黒画素数
の最小値を検出する手段とを具備することを特徴とする
文書画像傾き検出装置。
2. A memory for storing a binary-quantized document image, and a plurality of partial areas set in a vertical or horizontal direction in a band of a fixed size, and scanning the document image in a horizontal or vertical direction. A binary projection extraction unit for detecting the presence or absence of a black pixel in each scanning line; a shift operation unit for shifting the adjacent binary projection information according to a vertical or horizontal shift direction and a predetermined shift amount; Said a plurality of 2
Cumulative binary projection information extracting means for calculating a logical sum of value projection information, black pixel number calculating means for detecting the number of black pixels of the cumulative binary projection information, and a counter for changing the shift amount and shift direction; Means for detecting a minimum value of the number of black pixels of the plurality of accumulated binary projection information obtained by changing the shift amount and the shift direction.
【請求項3】2値に量子化された文書画像を記憶するメ
モリと、垂直又は水平方向に一定サイズの帯状に複数個
の部分領域を設定し、前記文書画像を水平又は垂直方向
に走査し、各走査ライン上の黒画素の有無を検出する2
値射影抽出手段と、隣接する前記2値射影情報を上下又
は左右のずらし方向及び所定のずらし量に従って、シフ
トするシフト演算手段と、階段状にずらした前記複数個
の2値射影情報の論理和を算出する累積2値射影情報抽
出手段と、前記累積2値射影情報の黒画素数を検出する
黒画素数算出手段と、前記ずらし量を変化させるカウン
タと、前記ずらし量が1における上下等の2通りずらし
方向に対して算出される前記累積2値射影情報の黒画素
数の最小値を検出し、ずらし方向を決定する手段と、決
定された前記ずらし方向に対して、前記ずらし量を順次
増加させて得られた前記累積2値射影情報の黒画素数が
既に検出された前記累積2値射影情報の黒画素数より大
きくなるか否かを調べて、前記ずらし量の増加を中断す
る手段とを具備することを特徴とする文書画像傾き検出
装置。
3. A memory for storing a binary quantized document image, and a plurality of partial areas set in a vertical or horizontal direction in a band of a predetermined size, and scanning the document image in a horizontal or vertical direction. Detecting the presence or absence of a black pixel on each scanning line 2
Value projection extraction means, shift operation means for shifting the adjacent binary projection information according to a vertical or horizontal shift direction and a predetermined shift amount, and a logical sum of the plurality of binary projection information shifted stepwise , A black pixel number calculating means for detecting the number of black pixels in the cumulative binary projection information, a counter for changing the shift amount, and Means for detecting the minimum value of the number of black pixels of the cumulative binary projection information calculated for the two shift directions and determining the shift direction; and sequentially determining the shift amount for the determined shift direction. Means for checking whether the number of black pixels of the cumulative binary projection information obtained by increasing the number of black pixels is larger than the number of black pixels of the cumulative binary projection information already detected, and suspending the increase of the shift amount; With Document image tilt detection apparatus characterized by.
JP1226944A 1989-08-31 1989-08-31 Document image tilt detection method and apparatus Expired - Lifetime JP2893747B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1226944A JP2893747B2 (en) 1989-08-31 1989-08-31 Document image tilt detection method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1226944A JP2893747B2 (en) 1989-08-31 1989-08-31 Document image tilt detection method and apparatus

Publications (2)

Publication Number Publication Date
JPH0390980A JPH0390980A (en) 1991-04-16
JP2893747B2 true JP2893747B2 (en) 1999-05-24

Family

ID=16853063

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1226944A Expired - Lifetime JP2893747B2 (en) 1989-08-31 1989-08-31 Document image tilt detection method and apparatus

Country Status (1)

Country Link
JP (1) JP2893747B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2745256B2 (en) * 1991-07-08 1998-04-28 富士写真フイルム株式会社 Micro film reader
JP4323606B2 (en) * 1999-03-01 2009-09-02 理想科学工業株式会社 Document image tilt detection device

Also Published As

Publication number Publication date
JPH0390980A (en) 1991-04-16

Similar Documents

Publication Publication Date Title
US5563403A (en) Method and apparatus for detection of a skew angle of a document image using a regression coefficient
US6043823A (en) Document processing system which can selectively extract and process regions of a document
US7684646B2 (en) System and method of determining image skew using connected components
JP2986383B2 (en) Method and apparatus for correcting skew for line scan images
EP0629970B1 (en) Method for detecting monetary amounts in binary images
US7616813B2 (en) Background area extraction in document layout analysis
JPH08241411A (en) System and method for evaluation of document image
JP2001109844A (en) Character string extracting method, handwritten character extracting method, character string extraction device, and image processor
US6493470B1 (en) Image processing method and apparatus for detecting the tilt amount of input image data
EP0248262B1 (en) Apparatus and method for detecting character components on a printed document
JPH11341259A (en) Inclination correction method for document image
EP0768000B1 (en) Automatic determination of blank pages and bounding boxes for binary images
JP2893747B2 (en) Document image tilt detection method and apparatus
JP4275973B2 (en) Retouched image extraction apparatus, program, storage medium, and retouched image extraction method
US20070146811A1 (en) Robust automatic page size detection algorithm for scan application
JP4281236B2 (en) Image recognition apparatus, image recognition method, and computer-readable recording medium storing image recognition program
JP3187895B2 (en) Character area extraction method
EP0767941B1 (en) Automatic determination of landscape scan in binary images
JP3850995B2 (en) Document image processing method and machine-readable recording medium storing a program for causing a computer to execute the document image processing method
JPH0250513B2 (en)
JP3019897B2 (en) Line segmentation method
JP2013157968A (en) Image processing apparatus
JP2536205B2 (en) Document image skew detection method and apparatus
JP2024015917A (en) Image processing apparatus, image processing system, and image processing program
JP2877548B2 (en) Document image attribute discrimination method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080305

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090305

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090305

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100305

Year of fee payment: 11

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100305

Year of fee payment: 11