JPH09120430A - Image processor - Google Patents
Image processorInfo
- Publication number
- JPH09120430A JPH09120430A JP8275812A JP27581296A JPH09120430A JP H09120430 A JPH09120430 A JP H09120430A JP 8275812 A JP8275812 A JP 8275812A JP 27581296 A JP27581296 A JP 27581296A JP H09120430 A JPH09120430 A JP H09120430A
- Authority
- JP
- Japan
- Prior art keywords
- contour
- image
- memory
- tilt
- stored
- 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
Links
Landscapes
- Character Input (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は画像処理装置に係り、特
に文書画像の傾きの正規化に好適な画像処理装置に関す
る。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing apparatus, and more particularly to an image processing apparatus suitable for normalizing the inclination of a document image.
【0002】[0002]
【従来の技術】従来の文書画像処理、特に二値文書画像
処理において、画像を光電変換及びディジタル化を行っ
て、入力画像をディジタル画像に変換してから処理を行
うのが普通である。この際用いる光電変換及びディジタ
ル化のための装置をスキャナと呼ぶ。画像の人力の際、
文書とスキャナとの相対的な傾きは避けられず、その結
果生ずる画像の傾きは文書画像処理、たとえば文書中の
文字列の抽出に悪影響を及ぼす。また文書とスキャナと
の相対的な傾きを極めて小さくできたとしても、文書を
タイプライタで作成する場合や文書を複写した場合な
ど、文書中の文字列が用紙に対し元々傾いていることも
ある。2. Description of the Related Art In conventional document image processing, particularly binary document image processing, it is usual to perform photoelectric conversion and digitization of an image to convert an input image into a digital image before processing. The device for photoelectric conversion and digitization used at this time is called a scanner. When the human power of the image,
The relative tilt between the document and the scanner is unavoidable, and the resulting tilt of the image adversely affects the document image processing, eg, extraction of character strings in the document. Even if the relative inclination between the document and the scanner can be made extremely small, the character string in the document may be originally inclined with respect to the paper when the document is created by a typewriter or when the document is copied. .
【0003】従来技術ではこのような問題点に対処する
ため、文書画像を複数の方向に対して積分し、その積分
値がピークとなるような方向を求め、その方向が紙面の
エッジとなす角度だけ文書画像を回転する方法が知られ
ており、たとえば昭和59年度電子通信学会全国大会講
演論文集第1769番「黒色背景を有する帳票上の文字切り
出し方式」で報告されている。しかし、この方法は全て
の画素の濃淡値について演算を行なうために、処理量が
膨大となるという問題があった。In the prior art, in order to deal with such a problem, the document image is integrated with respect to a plurality of directions, a direction in which the integrated value has a peak value is obtained, and the direction makes an angle with the edge of the paper. A method of rotating a document image is known, and it is reported, for example, in the 1991 Conference of the Institute of Electronics, Information and Communication Engineers of Japan, 1769 "Character cutout method on a form with a black background". However, this method has a problem that the amount of processing becomes enormous because the grayscale values of all the pixels are calculated.
【0004】[0004]
【発明が解決しようとする課題】本発明の目的は、画像
の傾きを高速に補正できる文書画像処理装置を提供する
ことにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a document image processing apparatus capable of correcting image inclination at high speed.
【0005】[0005]
【課題を解決するための手段】かかる目的を達成するた
めに、本発明は、画像から輪郭抽出を行い、抽出された
輪郭から罫線など直線部分の傾きを抽出して、この直線
部分の傾きが水平(あるいは垂直)になるように傾きを
補正することにより画像の傾きを高速に補正することを
特徴とする。In order to achieve the above object, the present invention extracts a contour from an image, extracts the inclination of a straight line portion such as a ruled line from the extracted contour, and determines the inclination of the straight line portion. It is characterized in that the inclination of the image is corrected at high speed by correcting the inclination so that it becomes horizontal (or vertical).
【0006】図1にその原理を示す。図1(A)は文書
画像の例、(B)は(A)から輪郭抽出を行って得られ
る画像、(C)は(B)の中で外輪郭だけを抽出した画
像を示す。(A)の罫線11に対応して、(B)の輪郭
21が得られる。(C)の21は同じ輪郭を示す。輪郭
は、その上を黒地を左に見て一周するときの座標系列と
して表現されており、その場合反時計方向に一周するな
らば外輪郭、時計方向に一周するならば内輪郭として区
別できる。FIG. 1 shows the principle. 1A shows an example of a document image, FIG. 1B shows an image obtained by performing contour extraction from FIG. 1A, and FIG. 1C shows an image in which only the outer contour is extracted from FIG. The contour 21 of (B) is obtained corresponding to the ruled line 11 of (A). 21 in (C) shows the same contour. The outline is expressed as a coordinate series when making a round on the black background to the left, and in this case, it can be distinguished as an outer contour if making a round in the counterclockwise direction, and an inner contour if making a round in the clockwise direction.
【0007】輪郭座標系列を(Xj,Yj),j=0,
1,2,,,(L−1)とする(Lは点列の長さ)。こ
のとき2個の量(Xj−Yj),(Xj+Yj)の最大
値及び最小値を与える点を求めることにより、図1
(D)のように輪郭21の4隅を求めることができる。
ただし、(D)では輪郭21は拡大して示してある。The contour coordinate series is (Xj, Yj), j = 0,
1, 2, (L-1) (L is the length of the point sequence). At this time, the points giving the maximum value and the minimum value of the two quantities (Xj-Yj) and (Xj + Yj) are obtained to obtain the values shown in FIG.
The four corners of the contour 21 can be obtained as in (D).
However, in (D), the contour 21 is shown enlarged.
【0008】全ての輪郭について輪郭の4隅を求め、そ
の間の距離を求めることにより、細長い輪郭のみを抽出
することができる。文書上に(水平の)罫線と文字部の
みしか存在しないことが分っている場合、上記の細長い
輪郭は罫線であり、その水平線となす角度もまた輪郭4
隅の座標を用いて求めることができる。この角度を用い
て、罫線が水平となるように文書画像全体を回転すれば
よい。罫線は判り易い一つの例であるが、原理的には図
1(c)に示すように各文字の輪郭それぞれも、も、そ
の辺が特定の方向を向いていることが多い。By obtaining the four corners of the contour for all the contours and determining the distances between them, only the elongated contour can be extracted. If it is known that there are only (horizontal) ruled lines and text parts on the document, the elongated contour above is a ruled line, and the angle with that horizontal line is also contour 4.
It can be calculated using the coordinates of the corner. By using this angle, the entire document image may be rotated so that the ruled line is horizontal. The ruled line is one example that is easy to understand, but in principle, as shown in FIG. 1C, the contours of each character often have their sides oriented in a specific direction.
【0009】回転は、原画像を直線回転してもよいが、
輪郭座標系列について座標変換した後、画像に戻しても
よい。また、文書上に罫線以外の細長い模様が存在する
ときは、輪郭4隅の間を結ぶ点列の直線性を検定して罫
線のみを抽出できる。また、文書上の直線として傾線や
垂直線も存在するときは、同様に直線の傾きを求めて水
平線と垂直線(ほぼ水平または垂直に近い線)のみを抽
出し、そのどちらかを用いて傾きを補正することにより
画像の傾きを高速に補正すればよい。The rotation may be a linear rotation of the original image,
The coordinates of the contour coordinate series may be transformed and then returned to the image. Further, when an elongated pattern other than the ruled line exists on the document, only the ruled line can be extracted by examining the linearity of the point sequence connecting the four corners of the contour. In addition, when there are slanted lines and vertical lines as straight lines on the document, similarly obtain the slant of the straight lines and extract only horizontal lines and vertical lines (almost horizontal or nearly vertical lines) and use either of them. The tilt of the image may be corrected at high speed by correcting the tilt.
【0010】また、本発明の態様においては、画像から
抽出された輪郭に対して特微量を求め、この特徴量をい
ろいろな方向に積分し、その積分値がピークとなるよう
な方向を求め、その方向が紙面のエッジとなす角度だけ
傾きを補正することにより画像の傾きを高速に補正する
ものである。Further, in the aspect of the present invention, a feature amount is obtained for the contour extracted from the image, the feature amount is integrated in various directions, and a direction in which the integrated value becomes a peak is obtained, The inclination of the image is corrected at high speed by correcting the inclination by the angle formed by the direction with the edge of the paper.
【0011】画像から抽出された輪郭に対する特微量の
例としては、輪郭(外輪郭)に外接する長方形を作り、
その縦または横の辺の長さを取ることができる。この方
法は、罫線が存在しない場合に文字列の傾きを求めるた
めに使用できる。他の例としては、長方形の面積や、こ
れらの値をもとに求められた任意の関数値を考えること
ができる。As a specific example of the contour extracted from the image, a rectangle circumscribing the contour (outer contour) is formed,
It can take the length of its vertical or horizontal sides. This method can be used to determine the inclination of a character string when no ruled line exists. As another example, the area of a rectangle or an arbitrary function value obtained based on these values can be considered.
【0012】図2,図3にその原理を示す。図2(A)
は文書画像の例、(B)は(A)から輪郭抽出を行って
得られている画像、(C)は(B)の中で外輪郭だけを
抽出した画像を示す。(C)の外輪郭から(D)のよう
な外接長方形を作る。外接長方形の座標は、輪郭点列座
標の最大値と最小値とから容易に求められるが、これを (PXj,PYj),(QXj,QYj),(RXj,
RYj),(SXj,SYj) とする。ここで、P,Q,R,Sはそれぞれ、外接長方
形jの左上、左下、右下、右上を表す。すなわち、 (QXj,QYj),(RXj,RYj) はそれぞれ、外接長方形jの下辺の画像を表す。このと
き、ある角度αに対し次の量V(α)を計算する。ま
ず、ヒストグラムを格納する配列 H(k),k=0,1,,,(N−1) を0クリアする。N文書画像をM×Nとしたときの縦の
長さである。つぎに、jに関するループにより H(Kj)←H(Kj)+|QXj−RXj| ただし、Kj=G[QYj−QXj・tan(α)]を計
算する。上記において記号「←」は代入を意味し、G
[x]は実数xを整数に変換する関数を示す。The principle is shown in FIGS. FIG. 2 (A)
Shows an example of a document image, (B) shows an image obtained by performing contour extraction from (A), and (C) shows an image obtained by extracting only the outer contour from (B). A circumscribed rectangle as shown in (D) is created from the outer contour of (C). The coordinates of the circumscribed rectangle can be easily obtained from the maximum value and the minimum value of the outline point sequence coordinates, and these are (PXj, PYj), (QXj, QYj), (RXj,
RYj) and (SXj, SYj). Here, P, Q, R, and S represent the upper left, lower left, lower right, and upper right of the circumscribed rectangle j, respectively. That is, (QXj, QYj) and (RXj, RYj) respectively represent images on the lower side of the circumscribed rectangle j. At this time, the next quantity V (α) is calculated for a certain angle α. First, the array H (k), k = 0, 1, ..., (N-1) that stores the histogram is cleared to zero. This is the vertical length when the N document image is M × N. Next, H (Kj) ← H (Kj) + | QXj−RXj | is calculated by a loop for j, where Kj = G [QYj−QXj · tan (α)]. In the above, the symbol "←" means substitution and G
[X] indicates a function for converting the real number x into an integer.
【0013】図3に示すようにKjは、31の外接長方
形jの左下隅の点Qjから角度αの直線を引いたとき、
画像の左辺32と交わる点のY座標である。したがっ
て、ヒストグラムH(Kj)は角度αだけ画像を傾けて
外接長方形jの下辺の長さを積分することに相当する。
これを角度α方向の辺長周辺分布と呼ぶ。jに関するル
ープが終了すると V(α)=Σ|H(k)−H(k−1)| を計算する。V(α)は角度α方向の辺長周辺分布の鋭
さを表す量である。角度αを例えば−2°から+2°ま
で0.1°きざみで変化させ、V(α)の最大となる角
度を求めることにより、外接長方形の下辺が最もよく重
なるような方向が求まる。一般に文字の行はほぼ下辺が
揃って印刷あるいは書かれるから、これが同じ線上に並
ぶような角度は文字列の傾きと考えることができる。As shown in FIG. 3, Kj is obtained by drawing a straight line with an angle α from a point Qj at the lower left corner of the 31 circumscribed rectangle j.
It is the Y coordinate of the point that intersects the left side 32 of the image. Therefore, the histogram H (Kj) corresponds to inclining the image by the angle α and integrating the length of the lower side of the circumscribed rectangle j.
This is called a side length peripheral distribution in the angle α direction. When the loop for j is completed, V (α) = Σ | H (k) −H (k−1) | is calculated. V (α) is an amount representing the sharpness of the distribution around the edge length in the direction of the angle α. By changing the angle α in steps of 0.1 ° from −2 ° to + 2 °, and obtaining the maximum angle of V (α), the direction in which the lower sides of the circumscribed rectangles best overlap can be obtained. In general, lines of characters are printed or written with their lower sides aligned, and therefore the angle at which they are arranged on the same line can be considered as the inclination of the character string.
【0014】図7を用いて特徴値として矩形の底辺の長
さを用いた場合について、さらに判り易く説明する。図
7(a)は、ヒストグラムH(K)を傾き角と等しい角
度αで求めたときの図である。文字の外接矩形が四角の
列で示されている。同図に示すように傾き角と等しい方
向に矩形の底辺の長さを積分すると、ヒストグラムは各
文字行に対応した位置に大きな値を持つ。もし、文字の
輪郭を示す矩形がまったく規則的であったとすると各矩
形の左下隅の点は一直線状に並び、同図に示すようにヒ
ストグラムは対応する位置のみにピークをもつ。よっ
て、これに対するV(α)は、H(K)のとなり同士の
値の差分を積分した値なので、大きな値をとることにな
る。実際には、文字パターンはそれぞれ形状や大きさが
異なるが、その場合でも、ヒストグラムの示す傾向は変
わらない。The case where the length of the bottom side of the rectangle is used as the characteristic value will be described with reference to FIG. FIG. 7A is a diagram when the histogram H (K) is obtained at an angle α equal to the tilt angle. The circumscribing rectangle of the character is shown in a square column. As shown in the figure, when the length of the bottom of the rectangle is integrated in the direction equal to the tilt angle, the histogram has a large value at the position corresponding to each character line. If the rectangle indicating the outline of the character is completely regular, the points at the lower left corner of each rectangle are aligned, and the histogram has peaks only at the corresponding positions as shown in the figure. Therefore, V (α) for this is a value obtained by integrating the difference between the values of H (K) and is large, and therefore takes a large value. In reality, the character patterns have different shapes and sizes, but even in that case, the tendency indicated by the histogram does not change.
【0015】一方、積分する方向αが図7(b)のよう
に傾き角と異なる場合には、鋭いピークは現われずに、
各文字行に対応する位置の周りに分布を持つ。よってこ
れに対するV(α)は図7(a)に比べてずっと小さ
い。このように複数の方向についてV(α)を計算する
ことで、傾き角度に近いαのときにV(α)が最大にな
ることを利用して、画像の傾きを知ることができる。こ
の例では文字に外接する矩形の辺の長さを特徴量とした
が、矩形の面積を特徴量としても同様の効果が得られる
ことは明白である。On the other hand, when the integrating direction α is different from the tilt angle as shown in FIG. 7B, no sharp peak appears and
It has a distribution around the position corresponding to each character line. Therefore, V (α) for this is much smaller than that in FIG. By calculating V (α) in a plurality of directions in this way, the inclination of the image can be known by utilizing the fact that V (α) becomes maximum when α is close to the inclination angle. In this example, the length of the side of the rectangle circumscribing the character is used as the feature amount, but it is clear that the same effect can be obtained even if the area of the rectangle is used as the feature amount.
【0016】[0016]
【実施例】以下、本発明の実施例について図面を用いて
詳細に説明する。Embodiments of the present invention will be described below in detail with reference to the drawings.
【0017】図4は本発明の一実施例による文書処理方
式を採用した装置の構成を示すブロック図である。装置
の各部はバス1に接続され、全体の動作は制御部2によ
り制御される。文書3上の情報(文書画像)はスキャナ
4により光電変換・ディジタル化されてディジタル画像
となり、バス1を介してメモリ51に格納される。メモ
リ51は後述する52,53,54とともにメモリ5の
一部をなす。ディジタル画像51をスキャナ4から得る
代わりに、光ディスクなどのディジタル画像ファイル装
置から読みこんでもよい。また、以下の説明では1画素
1ビットに二値化するものとするが、1画素を多値で表
現したものや、カラースキャナにより光電変換して色情
報を付与したものでも、処理に僅かの変更を加えるのみ
で適用できることは明らかである。FIG. 4 is a block diagram showing the arrangement of an apparatus adopting the document processing system according to the embodiment of the present invention. Each part of the device is connected to a bus 1, and the overall operation is controlled by a control unit 2. The information (document image) on the document 3 is photoelectrically converted and digitized by the scanner 4 into a digital image, which is stored in the memory 51 via the bus 1. The memory 51 forms a part of the memory 5 together with 52, 53 and 54 described later. Instead of obtaining the digital image 51 from the scanner 4, it may be read from a digital image file device such as an optical disk. Further, in the following description, it is assumed that each pixel is binarized into 1 bit, but even if one pixel is represented by multi-values, or if color information is photoelectrically converted by a color scanner and color information is added, it is possible to perform a small amount of processing. Obviously, it can be applied with only changes.
【0018】制御部2のソフトウェアにより、メモリ5
1中の画像に対し輪郭抽出を行い、メモリ52に格納す
る。輪郭抽出は公知の手法を使用すればよいので詳細は
省略する。輪郭抽出の代わりにいわゆる連結領域抽出法
を使用してもよい。次に後述するようにして、メモリ5
2の中の輪郭データからその4隅の座標を求め、メモリ
53に格納する。次にメモリ52中の輪郭データに対し
傾き補正処理を行い、補正後の輪郭データをメモリ54
に格納する。この補正後の輪郭データから内部を塗り潰
した画像を生成し、メモリ51に傾き補正した画像を得
る。補正完了後、コンソール6を用いた使用者との対話
により、この画像を格納すべきファイル7中のアドレス
を決定し、ファイル7に格納する。By the software of the control unit 2, the memory 5
The contour of the image in 1 is extracted and stored in the memory 52. Since a known method may be used for contour extraction, the details are omitted. Instead of the contour extraction, a so-called connected region extraction method may be used. Then, as will be described later, the memory 5
The coordinates of the four corners are obtained from the contour data in 2 and stored in the memory 53. Next, inclination correction processing is performed on the contour data in the memory 52, and the corrected contour data is stored in the memory 54.
To be stored. An image of which the inside is filled is generated from the contour data after the correction, and a tilt-corrected image is obtained in the memory 51. After the correction is completed, the address in the file 7 in which this image should be stored is determined by the dialog with the user using the console 6, and is stored in the file 7.
【0019】図5を用いて4隅の抽出と傾き補正処理の
詳細を述べる。図5は、これらの処理の流れを説明する
図である。処理の流れは、PAD(Program Analysis D
iagram)形式で書かれている。101で文書画像の輪郭
データ(メモリ52中にある)を入力する。102は、
輪郭iに関するループ制御である。103で各輪郭の輪
郭データからそのX座標及びY座標の和及び差 (X(i)−Y(i)),(X(i)+Y(i)) の最大値及び最小値を抽出する。iは輪郭上の番号、こ
の4個の数値を与えるiから輪郭の4隅の座標 (PXi,PYi),(QXi,QYi),(RXi,
RYi),(SXi,SYi) が決まる。(後述した外接長方形の4隅とは異なること
に注意)。Details of the four corner extraction and the inclination correction processing will be described with reference to FIG. FIG. 5 is a diagram illustrating the flow of these processes. The processing flow is PAD (Program Analysis D
iagram) format. At 101, the contour data of the document image (in the memory 52) is input. 102 is
It is a loop control regarding the contour i. At 103, the maximum and minimum values of the sum and difference (X (i) -Y (i)) and (X (i) + Y (i)) of the X and Y coordinates are extracted from the contour data of each contour. i is the number on the contour, and the coordinates (PXi, PYi), (QXi, QYi), (RXi,
RYi) and (SXi, SYi) are determined. (Note that it is different from the four corners of the circumscribed rectangle described below).
【0020】104〜108は罫線判定処理を行う部分
である。103では最大値Rmaxの初期化を行う。10
4は、輪郭iに関するループ制御である。Reference numerals 104 to 108 are portions for performing ruled line determination processing. At 103, the maximum value R max is initialized. 10
4 is a loop control for the contour i.
【0021】106で幅Wiと高さHiの比をそれまで
の最大値と比較し、新しい最大値の場合は107でR
maxを更新しそのときのiをimとして登録する。In step 106, the ratio of the width Wi to the height Hi is compared with the maximum value up to that point, and in the case of the new maximum value, R is calculated in 107.
Update max and register i at that time as im.
【0022】108では輪郭imの幅Wiと高さHiが
ある範囲に入っているかを判定する、範囲に入っている
とき、輪郭imは水平の罫線(複数ある時は最も細長い
もの)であると判定し、109で罫線と判定された輪郭
imの傾きθを求める。ただし、 θ=arctan((SY
i−RYi)/(SXi−RXi)) また、110は、失敗したときの出口である。At 108, it is determined whether the width Wi and the height Hi of the contour im are within a certain range. When the contour im is within the range, the contour im is a horizontal ruled line (when there are a plurality of lines, it is the longest thin line). Then, the inclination θ of the contour im which is determined to be a ruled line in 109 is determined. However, θ = arctan ((SY
i-RYi) / (SXi-RXi)) Moreover, 110 is an exit at the time of failure.
【0023】111〜116は傾き補正処理した画像を
生成する部分である。111は、出力画像エリアBをク
リアする。112は、輪郭iに関するループ制御であ
る。113は、輪郭iを構成する点jに関するループ制
御である。114は点jの座標(Xj,Yj)を傾き補
正した座標(Xj,Yj)を計算式 Yj’=Yj−Xj・tan(θ) によって求める処理である。115は画素B(Xj,Y
j)を1とするもので、出力画像エリア上に輪郭iの点
列データをマッピングする処理である。116は輪郭内
部を塗り潰す処理であり、外輪郭では内部を黒で、内輪
郭では内部Hで塗り潰す。輪郭を塗り潰した後、内輪郭
を塗り潰すようにすれば、原パターンが完全に復元され
る。Reference numerals 111 to 116 are portions for generating an image subjected to inclination correction processing. 111 clears the output image area B. Reference numeral 112 is a loop control for the contour i. Reference numeral 113 is a loop control relating to the point j forming the contour i. Reference numeral 114 is a process for obtaining the coordinates (Xj, Yj) in which the coordinates (Xj, Yj) of the point j are tilt-corrected by the calculation formula Yj ′ = Yj−Xj · tan (θ). 115 is a pixel B (Xj, Y
j) is set to 1, which is a process of mapping the point sequence data of the contour i on the output image area. Reference numeral 116 is a process of filling the inside of the contour, in which the inside is filled with black for the outer contour and the inside H for the inner contour. If the inner contour is filled after filling the contour, the original pattern is completely restored.
【0024】以上の説明から理解されるように、傾き補
正はずれ変形を用いているが、回転変形を用いることも
できる。As can be understood from the above description, although the tilt correction uses the displacement deformation, the rotation deformation can also be used.
【0025】また、108の罫線判定の論理を変更する
ことにより罫線の代りに表の上下辺あるいは左右辺を使
用することもできる。Further, by changing the ruled line determination logic of 108, the upper and lower sides or the left and right sides of the table can be used instead of the ruled lines.
【0026】次に、本発明の実施例について説明する。Next, examples of the present invention will be described.
【0027】本実施例による文書処理装置を採用した装
置の構成は先に説明した実施例と同様であり、制御部2
における処理が異なっている。本実施例では、文字列の
傾きを検出して傾き補正を行うものであり、先に説明し
た例と異なる点は傾き検出の部分であるので、この部分
について説明する。The configuration of the apparatus employing the document processing apparatus according to this embodiment is the same as that of the above-described embodiment, and the control unit 2
The processing in is different. In the present embodiment, inclination correction is performed by detecting the inclination of the character string. The difference from the above-described example is the part of inclination detection, and this part will be described.
【0028】図6は、第2の実施例における傾き検出の
処理の流れ図であり、図5の103〜107の罫線判定
処理を行う部分に対応する。図6で、201〜211は
文字列の傾きを検出する部分である。201は、Vmax
を初期値にセットする。202は、角度αに関するルー
プ制御である。203はV(α)の初期値を0にセット
する。204はバッファエリア H(k),k=0.1,,,(N−1) を0クリアする。205は輪郭iに関するループ制御で
ある。206は、輪郭iの外接長方形の下辺の両端の座
標 (QXi,QYi),(RXi,RYi) を求める。207は輪郭iの大きさがある範囲に入って
いるときのみ208以降の処理を行う。208は H(Kj)←H(Kj)+|QXj−RXj| ただし、Kj=QYj−QXj・tan(α)を計算す
る。輪郭iに関するループが終了すると209でα方向
の辺長周辺分布の鋭さを、次式 V(α)=Σ|H(k)−H(k−1)| によって計算する。210,211はV(α)の最大値
を与えるαの値αm及び最大値Vmaxを更新する。20
2のループを終了したときのαmが文字列の傾きを与え
る。FIG. 6 is a flow chart of the inclination detection processing in the second embodiment, and corresponds to the portion for performing the ruled line determination processing of 103 to 107 in FIG. In FIG. 6, 201 to 211 are portions for detecting the inclination of the character string. 201 is V max
Is set to the initial value. 202 is a loop control relating to the angle α. 203 sets 0 to the initial value of V (α). 204 clears the buffer areas H (k), k = 0.1, ..., (N-1) to zero. Reference numeral 205 is a loop control for the contour i. 206 determines the coordinates (QXi, QYi), (RXi, RYi) of both ends of the lower side of the circumscribed rectangle of the contour i. 207 performs the processing after 208 only when the size of the contour i is within a certain range. 208 is H (Kj) ← H (Kj) + | QXj−RXj | where Kj = QYj−QXj · tan (α) is calculated. When the loop regarding the contour i is completed, the sharpness of the edge length peripheral distribution in the α direction is calculated in 209 by the following formula V (α) = Σ | H (k) −H (k−1) |. 210 and 211 update the value αm of α that gives the maximum value of V (α) and the maximum value V max . 20
Αm at the end of loop 2 gives the inclination of the character string.
【0029】以上の説明から理解されるように、第1の
実施例及び第2の実施例では罫線あるいは文字列はほぼ
水平であるとしたが、これらが垂直の場合であっても処
理内容をそのように変更することは容易である。また、
これらの傾きが水平か垂直か不明の場合でも、水平ある
いは垂直に近い方向の直線を選択し、それを用いて傾き
補正するように処理内容を修正することは容易である。As can be understood from the above description, the ruled lines or the character strings are substantially horizontal in the first and second embodiments. However, even if these are vertical, the processing content is It is easy to make such changes. Also,
Even if it is unknown whether these inclinations are horizontal or vertical, it is easy to select a straight line in the direction close to horizontal or vertical and correct the processing contents so as to correct the inclination.
【0030】[0030]
【発明の効果】以上の説明から理解されるように、本発
明では傾き補正で対象とする演算が全画素ではなく、黒
領域の輪郭のみであるので処理量が著しく減少している
ため、文書の傾き補正を高速に行うことができる。As can be understood from the above description, in the present invention, since the calculation to be performed in the tilt correction is not the whole pixels but only the outline of the black area, the processing amount is significantly reduced. The inclination correction can be performed at high speed.
【0031】また、文字列に着目する本発明では、罫線
の存在しない文書でも補正が可能である。また輪郭の大
きさを判定して文字らしい輪郭のみ積分し、文字以外の
模様や雑音を積分から除外しているので、高速性と耐雑
音性を兼ね備えることができる。Further, according to the present invention which pays attention to the character string, it is possible to correct even a document having no ruled line. Further, since the size of the contour is determined and only the contour that looks like a character is integrated and patterns and noise other than the character are excluded from the integration, both high speed and noise resistance can be achieved.
【図1】本発明の原理を説明する図。FIG. 1 illustrates the principle of the present invention.
【図2】本発明の原理を説明する図。FIG. 2 is a diagram illustrating the principle of the present invention.
【図3】本発明の原理を説明する図。FIG. 3 illustrates the principle of the present invention.
【図4】本発明の文書処理方式を実施する装置の構成を
示すブロック図。FIG. 4 is a block diagram showing the configuration of an apparatus that implements the document processing system of the present invention.
【図5】図4の制御部2における処理の流れ図。5 is a flow chart of processing in the control unit 2 of FIG.
【図6】図4の制御部2における処理の流れ図。6 is a flow chart of processing in the control unit 2 of FIG.
【図7】本願発明の原理を説明する模式図FIG. 7 is a schematic diagram illustrating the principle of the present invention.
1…バス、2…制御部、3…文書、4…スキャナ、5…
メモリ、6…コンソール、7…ファイル。1 ... bus, 2 ... control unit, 3 ... document, 4 ... scanner, 5 ...
Memory, 6 ... Console, 7 ... File.
───────────────────────────────────────────────────── フロントページの続き (72)発明者 花野井 歳弘 神奈川県小田原市国府津2880番地株式会社 日立製作所小田原工場内 (72)発明者 栗野 清道 神奈川県小田原市国府津2880番地株式会社 日立製作所小田原工場内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Toshihiro Hananoi 2880 Kozu, Odawara-shi, Kanagawa Hitachi Odawara factory (72) Inventor Kiyomichi Kurino 2880 Kozu, Kanagawa prefecture Hitachi Ltd. Odawara factory
Claims (2)
上記デジタル画像情報を格納するメモリと、該メモリ中
のデジタル画像情報の処理を行なう制御部とを有し、 該制御部は上記デジタル画像情報の輪郭デ−タを抽出す
る手段、該輪郭デ−タを演算して特徴量を算出する手
段、該特徴量を複数の方向に投影して積分して積分値を
得る手段、該積分値が極値を取る方向を抽出する手段を
有する画像処理装置。1. Input means for inputting digital image information,
It has a memory for storing the digital image information and a control unit for processing the digital image information in the memory, the control unit extracting the contour data of the digital image information, and the contour data. Image processing apparatus having means for calculating a characteristic amount by calculating the data, means for projecting the characteristic amount in a plurality of directions and integrating to obtain an integrated value, and means for extracting a direction in which the integrated value has an extreme value. .
力手段と、上記デジタル画像情報を格納するメモリと、
該メモリ中のデジタル画像情報の処理を行なう制御部と
を有し、 該制御部は上記デジタル画像情報中の文字デ−タの輪郭
デ−タを抽出する手段、該輪郭デ−タを演算して特徴量
を算出する手段、該特徴量を複数の方向に投影して積分
して積分値を得る手段、該積分値が極値を取る方向を抽
出する手段を有する画像処理装置。2. Input means for converting a document into digital image information and inputting it, and a memory for storing the digital image information.
A control unit for processing digital image information in the memory, the control unit calculating means for extracting contour data of character data in the digital image information, and calculating the contour data. An image processing apparatus having means for calculating a characteristic amount, means for projecting the characteristic amount in a plurality of directions and integrating to obtain an integrated value, and means for extracting a direction in which the integrated value has an extreme value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8275812A JPH09120430A (en) | 1996-10-18 | 1996-10-18 | Image processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8275812A JPH09120430A (en) | 1996-10-18 | 1996-10-18 | Image processor |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP60152210A Division JP2644724B2 (en) | 1985-07-12 | 1985-07-12 | Document image skew correction method |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH09120430A true JPH09120430A (en) | 1997-05-06 |
Family
ID=17560770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP8275812A Pending JPH09120430A (en) | 1996-10-18 | 1996-10-18 | Image processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH09120430A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7269298B2 (en) | 2000-09-14 | 2007-09-11 | Sharp Kabushiki Kaisha | Image processing device, image processing method, and record medium on which the same is recorded |
JP2010108135A (en) * | 2008-10-29 | 2010-05-13 | Toshiba Corp | Image processing device, image processing program, and image processing method |
US7805003B1 (en) | 2003-11-18 | 2010-09-28 | Adobe Systems Incorporated | Identifying one or more objects within an image |
JP2011180747A (en) * | 2010-02-26 | 2011-09-15 | Toshiba Corp | Expansion/contraction correction reading function for copy business form |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5752971A (en) * | 1980-09-12 | 1982-03-29 | Nippon Telegr & Teleph Corp <Ntt> | Two-dimensional character area extracting device |
JPS59139478A (en) * | 1983-01-28 | 1984-08-10 | Seiko Instr & Electronics Ltd | Picture processing device |
-
1996
- 1996-10-18 JP JP8275812A patent/JPH09120430A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5752971A (en) * | 1980-09-12 | 1982-03-29 | Nippon Telegr & Teleph Corp <Ntt> | Two-dimensional character area extracting device |
JPS59139478A (en) * | 1983-01-28 | 1984-08-10 | Seiko Instr & Electronics Ltd | Picture processing device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7269298B2 (en) | 2000-09-14 | 2007-09-11 | Sharp Kabushiki Kaisha | Image processing device, image processing method, and record medium on which the same is recorded |
US7805003B1 (en) | 2003-11-18 | 2010-09-28 | Adobe Systems Incorporated | Identifying one or more objects within an image |
JP2010108135A (en) * | 2008-10-29 | 2010-05-13 | Toshiba Corp | Image processing device, image processing program, and image processing method |
JP2011180747A (en) * | 2010-02-26 | 2011-09-15 | Toshiba Corp | Expansion/contraction correction reading function for copy business form |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3883696B2 (en) | Method for scanning and detecting multiple photos and removing artificial edges | |
JP4607633B2 (en) | Character direction identification device, image forming apparatus, program, storage medium, and character direction identification method | |
US6929183B2 (en) | Reconstruction of virtual raster | |
US6185341B1 (en) | Image processing using vector data to reduce noise | |
JP4777393B2 (en) | Text direction determination method and system in digital image, control program, and recording medium | |
JPH11338976A (en) | Document image recognition device, method therefor, and recording medium | |
JPH03201866A (en) | Decision of picture skew angle from data including data of compressed form | |
JPH0772861B2 (en) | Program creation device | |
JPH0721320A (en) | Automatic determination device of script | |
JP2011022867A (en) | Image processing device, image processing system and program | |
JP2009003936A (en) | Text direction-determining method in digital image, system, control program, and recording medium | |
US6055336A (en) | Image processing system which converts multi-value image data into binary image data | |
CN115222935A (en) | Image correction method, image correction device, electronic apparatus, scanning pen, and storage medium | |
JPH09120430A (en) | Image processor | |
JP2644724B2 (en) | Document image skew correction method | |
JP2005063055A (en) | Image generating device, image generation program, and recording medium with the program stored therein | |
EP0923045A2 (en) | Image recognition through localized interpretation | |
JP4803001B2 (en) | Image processing apparatus and image processing program | |
JP2000076378A (en) | Character recognizing method | |
JP2000187705A (en) | Document reader, document reading method and storage medium | |
US20020164087A1 (en) | System and method for fast rotation of binary images using block matching method | |
JP7327810B2 (en) | Image generation program, character recognition system, image generation method, image generation device, and character recognition model | |
JP2978496B2 (en) | Image processing device | |
JP2755299B2 (en) | Image processing method | |
JP2002288675A (en) | Method, program, and system for document identification |