[go: up one dir, main page]

JP2715930B2 - Line detection method - Google Patents

Line detection method

Info

Publication number
JP2715930B2
JP2715930B2 JP6232752A JP23275294A JP2715930B2 JP 2715930 B2 JP2715930 B2 JP 2715930B2 JP 6232752 A JP6232752 A JP 6232752A JP 23275294 A JP23275294 A JP 23275294A JP 2715930 B2 JP2715930 B2 JP 2715930B2
Authority
JP
Japan
Prior art keywords
point
line segment
connected component
case
calculated
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 - Fee Related
Application number
JP6232752A
Other languages
Japanese (ja)
Other versions
JPH0896076A (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
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP6232752A priority Critical patent/JP2715930B2/en
Publication of JPH0896076A publication Critical patent/JPH0896076A/en
Application granted granted Critical
Publication of JP2715930B2 publication Critical patent/JP2715930B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Image Analysis (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、線分検出方法に関し、
特に、文書を画像として入力し認識する装置における線
分検出方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for detecting a line segment,
In particular, lines on devices that input and recognize documents as images
Minute detection method .

【0002】[0002]

【従来の技術】郵便や一般文書の読み取りにおいては、
文字と線分の接触部分を検出し、分離する処理が必要で
ある。そのための従来手法として、ハフ変換を用いる手
法、レイアウト解析処理により文字行を抽出し投影パタ
ンから線分を検出する手法、などが提案されている。
2. Description of the Related Art In reading mail and general documents,
Processing for detecting and separating the contact portion between the character and the line segment is required. As a conventional method therefor, a method using Hough transform, a method of extracting a character line by layout analysis processing and detecting a line segment from a projection pattern, and the like have been proposed.

【0003】まずハフ変換を用いる手法について説明を
行う。画像のような2次元平面における線分の方程式y
=a・x+b(但しa,bは定数)を変形すると、b=
−x・a+yとなり、ab平面における直線の方程式と
も見なすことができる。従って画像上の全ての黒画素点
(x,y)に対応する(a,b)平面上の点数の累積値
を算出すると、その極大点(a0 ,b0 )が求める線
分の方程式となる。黒画素が線状に並んでいれば、文字
等との接触があっても検出することができる。
First, a method using the Hough transform will be described. Equation y of a line segment in a two-dimensional plane such as an image
= A x + b (where a and b are constants), b =
−x · a + y, which can be regarded as a straight line equation in the ab plane. Therefore, when the cumulative value of the points on the (a, b) plane corresponding to all the black pixel points (x, y) on the image is calculated, the local maximum point (a0, b0) becomes the equation of the line segment to be obtained. If the black pixels are arranged in a line, even if there is a contact with a character or the like, it can be detected.

【0004】次にレイアウト解析処理と投影パタンによ
る線分検出手法について説明を行う。レイアウト解析処
理に関しては、従来例として辻により「スプリット検出
法に基づく頁画像の構造解析」と題し、電子通信学会技
術研究報告・パターン認識と学習PRL85-17に発表された
論文がある。ここでは入力される文書画像に対し、水平
もしくは垂直方向の投影パタンの空白を検出して再帰的
に領域分割を行い、図,段組,文字行,文字等の要素領
域を抽出する。次に1つまたは複数個の要素領域がブロ
ックとして構造化され、更に各ブロックの包含関係およ
び上下または左右の配置関係に従って、ブロックの属性
およびブロック間の配置構造が階層的に決定され、記憶
される。文字列に関しては領域の位置、大きさと方向が
得られるため、文字列方向の投影パタンの極大値からア
ンダーライン等の線分の有無が検出され、同じく投影パ
タンの極小値から線分と文字との境界位置を求めること
ができる。
Next, a layout analysis process and a line segment detection method using a projection pattern will be described. For the layout analysis processing by Tsuji as a conventional example entitled "Structural Analysis of a page image based on split-detection method", there is a paper published in Electronics and Communication Engineers Technical Report pattern recognition and learning PRL85-17. Here, the input document image is recursively divided into regions by detecting blanks in the horizontal or vertical projection pattern and extracting element regions such as figures, columns, character lines, and characters. Next, one or a plurality of element regions are structured as blocks, and the attributes of the blocks and the arrangement structure between the blocks are hierarchically determined and stored in accordance with the inclusion relation of each block and the vertical or horizontal arrangement relation. You. As for the character string, the position, size and direction of the area can be obtained, so the presence or absence of a line segment such as an underline is detected from the maximum value of the projection pattern in the character string direction, and the line segment, the character and the Can be determined.

【0005】[0005]

【発明が解決しようとする課題】ハフ変換を用いる方法
は計算量が多いという問題があり、レイアウト解析処理
と投影パタンによる方法は、文書の傾きが生じた場合に
線分に対応する投影パタンの極大値が検出しにくいとい
う問題があった。
The method using the Hough transform has a problem that the amount of calculation is large, and the method using the layout analysis processing and the projection pattern requires the projection pattern corresponding to the line segment when the document is inclined. There is a problem that the maximum value is difficult to detect.

【0006】そこで本発明の目的は、文書の傾きの影響
を受けにくく、かつハフ変換等に比べて計算量の少ない
線分検出方法を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a line segment detecting method which is hardly affected by the inclination of a document and which requires less calculation than Hough transform or the like.

【0007】[0007]

【課題を解決するための手段】本発明の線分検出方法
は、文書を画像として入力する画像入力手段と、前記画
像から連結成分を抽出する連結成分抽出手段と、前記連
結成分の輪郭座標を(x,y)とし、Pを定数としたと
き、x+P・yを最小とする点A、x−P・yを最小と
する点B、x+P・yを最大とする点C、x−P・yを
最大とする点D、の計4点の座標を算出する線分端点検
出手段と、前記点A,B,C,Dで表現される四角形
BCDの外接矩形座標を算出し、長辺と短辺の長さが所
定の条件を満たすものを選択し出力する外接矩形判定手
段と、前記外接矩形判定手段において選択された連結成
分に関し、前記四角形ABCDのうち前記短辺に対応す
る2辺をABとCDとしたとき、前記ABと前記
CDがいずれも所定の長さより短ければ第1ケース、
前記ABと前記CDのうち一方のみが所定の長さよ
り短ければ第2ケースとし、前記第1ケースまたは前記
第2ケースを満足するものを選択し出力する短辺判定手
段と、前記短辺判定手段において選択された連結成分に
関し、前記第1ケースに該当するものについては前記
ABと前記CDの各中点を算出し、両中点間を結ぶ線
分上の黒画素比率が所定値を越えるものであれば、前記
連結成分は線分を含むと判定し、前記第2ケースに該当
するものについては、前記ABと前記CDのうち長
い辺(前記CDとする)の2端点のうち、短辺方向の
座標値が前記ABの中点に近い点(前記点Dとする)
を選び、前記点Dから点Cの方向に長さABだけ離れた
点C’を算出し、前記ABとC’Dの各中点を算出
し、両中点間を結ぶ線分上の黒画素比率が所定値を越え
るものであれば、前記連結成分は線分を含むと判定する
黒画素判定手段とを含むことを特徴とする。
According to the present invention, there is provided a line segment detecting method comprising: image input means for inputting a document as an image; connected component extracting means for extracting connected components from the image; When (x, y) and P are constants, a point A that minimizes x + Py, a point B that minimizes xPy, a point C that maximizes x + Py, xPy a line segment end point detecting means for calculating coordinates of a total of four points, that is, a point D which maximizes y, and a square A represented by the points A, B, C, and D
A circumscribed rectangle determining means for calculating a circumscribed rectangular coordinate of the BCD and selecting and outputting a coordinate having a long side and a short side satisfying a predetermined condition; and a quadrangle for the connected component selected by the circumscribed rectangle determining means. when the two sides corresponding to the short sides of ABCD was sides AB and CD, the said side AB
If both sides CD are shorter than a predetermined length, the first case,
If only one of the side AB and the side CD is shorter than a predetermined length, the second case is set, and the first case or the
A short-side determining unit that selects and outputs a component that satisfies the second case; and a connected component selected by the short-side determining unit. For the component corresponding to the first case, each of the side AB and the side CD is used. The midpoint is calculated, and if the ratio of black pixels on the line segment connecting the two midpoints exceeds a predetermined value, it is determined that the connected component includes the line segment, and for the case corresponding to the second case, Is a point near the middle point of the side AB (referred to as the point D), of the two end points of the longer side (referred to as the side CD) of the side AB and the side CD.
Is calculated, a point C ′ separated from the point D by a length AB in the direction of the point C is calculated, each midpoint of the side AB and the side C′D is calculated, and a line segment connecting the two midpoints is calculated. If the black pixel ratio exceeds a predetermined value, the connected component includes a black pixel determining unit that determines that the connected component includes a line segment.

【0008】本発明線分検出装置、文書を画像とし
て入力する画像入力部と、前記画像から連結成分を抽出
する連結成分抽出部と、前記連結成分の輪郭座標を
(x,y)とし、Pを定数としたとき、x+P・yを最
小とする点A、x−P・yを最小とする点B、x+P・
yを最大とする点C、x−P・yを最大とする点D、の
計4点の座標を算出する線分端点検出部と、前記点A,
B,C,Dで表現される四角形ABCDの外接矩形座標
を算出し、長辺と短辺の長さが所定の条件を満たすもの
を選択し出力する外接矩形判定部と、前記外接矩形判定
部において選択された連結成分に関し、前記四角形AB
CDのうち前記短辺に対応する2辺をABとCDと
したとき、前記ABと前記CDがいずれも所定の長
さより短ければ第1ケース、前記ABと前記CDの
うち一方のみが所定の長さより短ければ第2ケースと
し、前記第1ケースまたは前記第2ケースを満足するも
のを選択し出力する短辺判定部と、前記短辺判定部にお
いて選択された連結成分に関し、前記第1ケースに該当
するものについては前記ABと前記CDの各中点を
算出し、両中点間を結ぶ線分上の黒画素比率が所定値を
越えるものであれば、前記連結成分は線分を含むと判定
し、前記第2ケースに該当するものについては、前記
ABと前記CDのうち長い辺(前記CDとする)の
2端点のうち、短辺方向の座標値が前記ABの中点に
近い点(前記点Dとする)を選び、前記点Dから点Cの
方向に長さABだけ離れた点C’を算出し、前記AB
C’Dの各中点を算出し、両中点間を結ぶ線分上の
黒画素比率が所定値を越えるものであれば、前記連結成
分は線分を含むと判定する黒画素判定部とを具備するこ
とを特徴とする。
[0008] line detection device of the present invention an image input unit for inputting a document as an image, a connected component extraction unit for extracting connected components from the image, the outline coordinates of the connected component and (x, y) , P as constants, a point A that minimizes x + P · y, a point B that minimizes x−P · y, x + P ·
a line segment end point detector for calculating coordinates of a total of four points: a point C that maximizes y and a point D that maximizes x-P · y;
A circumscribed rectangle determining unit that calculates circumscribed rectangular coordinates of a quadrangle ABCD represented by B, C, and D, and selects and outputs one having a long side and a short side satisfying a predetermined condition; With respect to the connected component selected in
Wherein when the two sides corresponding to the short side was sides AB and CD of CD, the side AB and the side CD are both first case is shorter than the predetermined length, one of the sides AB and the side CD If only one of them is shorter than a predetermined length, it is regarded as a second case, and a short side determining unit for selecting and outputting one satisfying the first case or the second case, and a connected component selected in the short side determining unit. For the case corresponding to the first case, the respective midpoints of the side AB and the side CD are calculated, and if the black pixel ratio on the line segment connecting the two midpoints exceeds a predetermined value, It is determined that the connected component includes a line segment, and for the case corresponding to the second case, of the two end points of the longer side (referred to as the side CD) of the side AB and the side CD, the shorter side direction point coordinates value is close to the midpoint of the side AB and (the point D That) to select, to calculate a spaced point C 'length AB from the point D in the direction of point C, the side AB
And the midpoints of the sides C′D are calculated, and if the ratio of black pixels on the line segment connecting the two midpoints exceeds a predetermined value, it is determined that the connected component includes a line segment. And a unit.

【0009】[0009]

【作用】本発明の線分検出方法においては、検出対象に
関し、例えば郵便に多く見られるように線分が文字行に
比べて十分に長く、線分の両端近傍が文字と接触しない
ものに限定する。図1を参照すると、連結成分抽出部1
1において連結成分を抽出した後、線分端点検出部12
において輪郭座標から線分の端点候補を求める。外接矩
形判定部13においては、縦横比や大きさに関する条件
から線分を含む可能性のある連結成分を選択する。短辺
判定部14では線分端点検出部12において求めた端点
が線分の一部か、または他の成分の一部かを判定し、他
の成分である場合は線分の一部と考えられる端点に置き
換える。黒画素判定部15では線分上を追跡して黒画素
比率を算出し、線分であるかどうかの最終判定を行う。
これより線分を含んだ連結成分が抽出され、同時に線分
の端点を得ることができる。
According to the line segment detection method of the present invention, the detection target is limited to those in which the line segment is sufficiently longer than the character line and the vicinity of both ends of the line segment does not come in contact with the character, as is often seen in postal mail. I do. Referring to FIG. 1, a connected component extraction unit 1
1, after extracting the connected component, the line segment end point detection unit 12
In step (2), a line segment end point candidate is obtained from the outline coordinates. The circumscribed rectangle determination unit 13 selects a connected component that may include a line segment based on the conditions regarding the aspect ratio and the size. The short side determination unit 14 determines whether the end point obtained by the line segment end point detection unit 12 is a part of a line segment or a part of another component. To the end point. The black pixel determination unit 15 calculates the black pixel ratio by tracking the line segment, and makes a final determination as to whether or not the pixel is a line segment.
From this, the connected component including the line segment is extracted, and at the same time, the end point of the line segment can be obtained.

【0010】[0010]

【実施例】次に、本発明について図面を参照して説明す
る。
BRIEF DESCRIPTION OF THE DRAWINGS FIG.
You.

【0011】図1を参照して本発明の線分検出方法の一
実施例について説明を行う。
An embodiment of the line segment detecting method according to the present invention will be described with reference to FIG.

【0012】画像入力部10においてはイメージスキャ
ナ等の画像入力装置により文書を入力し、ディジタル画
像を得る。以下ではこれを文書画像と呼ぶものとする。
In the image input unit 10, a document is input by an image input device such as an image scanner to obtain a digital image. Hereinafter, this is referred to as a document image.

【0013】連結成分抽出部11においては文書画像に
対してラベリング処理を施し、連結成分を抽出する。
The connected component extracting section 11 performs a labeling process on the document image to extract connected components.

【0014】線分端点検出部12においては、連結成分
抽出部11において得られた連結成分の輪郭点座標を
(x,y)とし、Pを定数としたとき、x+P・yを最
小とする点A、x−P・yを最小とする点B、x+P・
yを最大とする点C、x−P・yを最大とする点D、の
計4点の座標を算出し、線分の端点候補とする。例えば
P=1とすると、各点は45度もしくは135度方向の
線分との接点を意味しており、Pの値により接線方向を
制御することができる。端点候補の具体的な算出手段と
しては、例えば次の3通りが考えられる。
In the line segment end point detecting section 12, the coordinates of the outline point of the connected component obtained in the connected component extracting section 11 are (x, y), and when P is a constant, the point which minimizes x + P.y A, a point B which minimizes x−P · y, B, x + P ·
The coordinates of a total of four points, that is, a point C that maximizes y and a point D that maximizes xP · y are calculated, and are set as end point candidates of the line segment. For example, if P = 1, each point means a contact point with a line segment in the direction of 45 degrees or 135 degrees, and the tangential direction can be controlled by the value of P. For example, the following three methods can be considered as specific calculation means of the end point candidate.

【0015】輪郭トレース処理を行いながらその座標
から各最大/最小値を随時計算する。
While performing the contour tracing process, maximum / minimum values are calculated as needed from the coordinates.

【0016】ラスタラベリングにより連結成分とその
外接矩形を求め、外接矩形の各頂点からのシティブロッ
ク距離(=マンハッタン距離): d=|x0 −x1 |+|y0 −y1 | が最小となる輪郭点を求める。
A connected component and its circumscribed rectangle are obtained by raster labeling, and the city block from each vertex of the circumscribed rectangle is determined.
Contour distance (= Manhattan distance): A contour point at which d = | x0−x1 | + | y0−y1 | is minimum is obtained.

【0017】におけるシティブロック距離をユーク
リッド距離: d’=(x0 −x1 )2 +(y0 −y1 )2 に変更し、外接矩形の各頂点を中心とする円と輪郭点と
の接点を求める。
The city block distance Euclidean distance in: d '= (x0 -x1) 2 + (y0 -y1) was changed to 2, determine the contact point between the circle and the contour point around each vertex of the circumscribing rectangle.

【0018】図2においては図2(a) が入力される原
画像を表し、図2(b) が得られた線分端点候補を表
す。
[0018] In FIG. 2 represents the original image 2 is (a) is input, representative of the line segment endpoint candidate Figure 2 (b) was obtained.

【0019】再び図1を参照して本発明の線分検出方法
の一実施例について説明を行う。
Referring to FIG. 1 again, one embodiment of the line segment detecting method of the present invention will be described.

【0020】外接矩形判定部13では、線分を含んだ連
結成分が細長い図形となることを利用して、連結成分を
選択し出力する。四角形ABCDの外接矩形座標を算出
し、長辺と短辺の長さが所定の条件を満たすものを選択
し出力する。また四角形ABCDの外接矩形だけでな
く、四角形ABCDを含む連結成分の外接矩形の長辺と
短辺からも、同様の条件により選択することができる。
図2(c) に四角形ABCDを含む連結成分の外接矩形
と長辺、短辺を求めた例を示す。具体的な選択条件とし
ては、・縦横比(長辺と短辺との比)が所定値より大き
い。・長辺は所定値より長く、短辺は所定値より短い。
等を用いる。
The circumscribed rectangle judging unit 13 selects and outputs a connected component by utilizing the fact that the connected component including a line segment becomes an elongated figure. The circumscribed rectangular coordinates of the square ABCD are calculated, and those whose long sides and short sides satisfy predetermined conditions are selected and output. Also, not just the rectangle circumscribing the square ABCD
And the long side of the circumscribed rectangle of the connected component including the square ABCD
Selection can be made from the short side under the same conditions.
FIG. 2C shows an example in which the circumscribed rectangle and the long and short sides of the connected component including the square ABCD are obtained. As specific selection conditions, the aspect ratio (the ratio between the long side and the short side) is larger than a predetermined value. -The long side is longer than the predetermined value, and the short side is shorter than the predetermined value.
And so on.

【0021】短辺判定部14では、線幅が所定値よりも
短いという条件により連結成分を選択し出力する。具体
的には、四角形ABCDのうち短辺に対応する2辺をA
BとCDとしたとき、ケース1:ABとCDがいずれも
所定の長さより短い、ケース2:ABとCDのうち一方
のみが所定の長さより短い。のいずれかを満足するもの
を選択する。図2(b) における四角形ABCDはケー
ス1の例であり、4点とも線分の端点となる場合を表
す。一方、図3(b) における四角形ABCDはケース
2の例であり、点Cのみが文字の一部を表している。
The short side determining section 14 selects and outputs a connected component under the condition that the line width is shorter than a predetermined value. Specifically, two sides of the rectangular ABCD corresponding to the short sides are A
Assuming B and CD, Case 1: AB and CD are both shorter than a predetermined length, Case 2: Only one of AB and CD is shorter than a predetermined length. Select one that satisfies either of The square ABCD in FIG. 2B is an example of Case 1 and shows a case where all four points are end points of a line segment. On the other hand, the square ABCD in FIG. 3B is an example of Case 2, and only the point C represents a part of the character.

【0022】黒画素判定部15は線分上を追跡して黒画
素比率を算出し、所定値を越えていたら線分を含むもの
と判定する。ケース1についてはABとCDの各中点を
算出し、両中点間を結ぶ線分上の黒画素比率を求めて判
定を行う。ケース2については図3(b) に示すよう
に、ABとCDのうち長い辺(ここではCD)の2端点
のうち、短辺方向(ここでは縦方向)の座標値がABの
中点に近い点(ここでは点D)を線分の一部と判定す
る。残った点Cは線分以外の成分の一部と判定されるた
め、点Cの代わりに点C’(=点Dから点Cの方向に長
さABだけ離れた点)を求める。次にABとC’Dの各
中点を算出し、両中点間を結ぶ線分上の黒画素比率を求
めて判定を行う。
The black pixel judging section 15 calculates the black pixel ratio by tracing the line segment, and if the ratio exceeds a predetermined value, judges that the line segment is included. In case 1, the midpoints of AB and CD are calculated, and the determination is made by obtaining the ratio of black pixels on a line segment connecting the midpoints. In case 2, as shown in FIG. 3 (b), of the two end points of the long side (here, CD) of AB and CD, the coordinate value in the short side direction (here, the vertical direction) is the middle point of AB. A near point (here, point D) is determined as a part of a line segment. Since the remaining point C is determined to be a part of a component other than the line segment, a point C ′ (= a point separated by a length AB from the point D in the direction of the point C) is obtained instead of the point C. Next, each midpoint of AB and C'D is calculated, and the determination is made by obtaining a black pixel ratio on a line connecting the two midpoints.

【0023】以上により、線分に関して長さ,縦横比,
線幅,黒画素比率に関する条件を満足した連結成分が検
出され、かつ線分の端点座標を求めることができる。
As described above, the length, the aspect ratio,
A connected component satisfying the conditions relating to the line width and the black pixel ratio is detected, and the end point coordinates of the line segment can be obtained.

【0024】[0024]

【発明の効果】本発明によれば、文字と線分との接触に
関し、図2(a) のように線分の両端が文字列よりも十
分に突出した場合や、図3(a) のように線分の一端の
みが文字列よりも突出し他端が文字と接触した場合、こ
れらを接触領域と判定し、かつ線分の端点座標を得るこ
とができる。線分の傾きが影響するのは外接矩形判定部
14において縦横比を用いる場合のみであり、実質的に
は影響されない。
According to the present invention, regarding the contact between a character and a line segment, the case where both ends of the line segment project sufficiently beyond the character string as shown in FIG. As described above, when only one end of the line segment protrudes from the character string and the other end touches the character, these are determined to be the contact area, and the end point coordinates of the line segment can be obtained. The inclination of the line segment affects only when the circumscribed rectangle determination unit 14 uses the aspect ratio, and is not substantially affected.

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

【図1】本発明の線分検出方法を示す流れ図である。 FIG. 1 is a flowchart showing a line segment detection method of the present invention .

【図2】線分の両端が文字列よりも十分に突出した場合
における検出例を示す図である。
FIG. 2 is a diagram illustrating a detection example in a case where both ends of a line segment project sufficiently from a character string;

【図3】線分の一端のみが文字列よりも突出し他端が文
字と接触した場合における検出例を示す図である。
FIG. 3 is a diagram illustrating a detection example in a case where only one end of a line segment protrudes from a character string and the other end contacts a character;

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

10 画像入力部 11 連結成分抽出部 12 線分端点検出部 13 外接矩形判定部 14 短辺判定部 15 黒画素判定部 Reference Signs List 10 Image input unit 11 Connected component extraction unit 12 Line segment end point detection unit 13 Bounding rectangle judgment unit 14 Short side judgment unit 15 Black pixel judgment unit

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 文書を画像として入力する画像入力手段
と、前記画像から連結成分を抽出する連結成分抽出手段
と、前記連結成分の輪郭座標を(x,y)とし、Pを定
数としたとき、x+P・yを最小とする点A、x−P・
yを最小とする点B、x+P・yを最大とする点C、x
−P・yを最大とする点D、の計4点の座標を算出する
線分端点検出手段と、前記点A,B,C,Dで表現され
る四角形ABCDの外接矩形座標を算出し、長辺と短辺
の長さが所定の条件を満たすものを選択し出力する外接
矩形判定手段と、前記外接矩形判定手段において選択さ
れた連結成分に関し、前記四角形ABCDのうち前記短
辺に対応する2辺をABとCDとしたとき、前記
ABと前記CDがいずれも所定の長さより短ければ
ケース、前記ABと前記CDのうち一方のみが所
定の長さより短ければ第2ケースとし、前記第1ケース
または前記第2ケースを満足するものを選択し出力する
短辺判定手段と、前記短辺判定手段において選択された
連結成分に関し、前記第1ケースに該当するものについ
ては前記ABと前記CDの各中点を算出し、両中点
間を結ぶ線分上の黒画素比率が所定値を越えるものであ
れば、前記連結成分は線分を含むと判定し、前記第2
ースに該当するものについては、前記ABと前記
Dのうち長い辺(前記CDとする)の2端点のうち、
短辺方向の座標値が前記ABの中点に近い点(前記点
Dとする)を選び、前記点Dから点Cの方向に長さAB
だけ離れた点C’を算出し、前記ABとC’Dの各
中点を算出し、両中点間を結ぶ線分上の黒画素比率が所
定値を越えるものであれば、前記連結成分は線分を含む
と判定する黒画素判定手段とを含むことを特徴とする線
分検出方法。
1. An image input means for inputting a document as an image, a connected component extracting means for extracting a connected component from the image, and when the contour coordinates of the connected component are (x, y) and P is a constant , X + P · y at minimum A, x−P ·
Point B that minimizes y, Point C that maximizes x + P · y, x
A line segment end point detecting means for calculating coordinates of a total of four points including a point D which maximizes P · y, and a circumscribed rectangular coordinate of a square ABCD expressed by the points A, B, C, and D is calculated; A circumscribing rectangle determining means for selecting and outputting one having a long side and a short side satisfying a predetermined condition, and a connected component selected by the circumscribing rectangle determining means corresponding to the short side of the square ABCD when the two sides was sides AB and CD, is shorter than the side AB and the side CD are both predetermined length first
One case, if only one of the side AB and the side CD is shorter than a predetermined length, a second case is selected, and a short side determining means for selecting and outputting a result satisfying the first case or the second case; Regarding the connected component selected by the short side determining means, for those corresponding to the first case, the respective midpoints of the side AB and the side CD are calculated, and the black pixels on the line connecting the two midpoints are calculated. If the ratio exceeds a predetermined value, it is determined that the connected component includes a line segment . For the case corresponding to the second case, the side AB and the side C
Of the two end points of the long side (referred to as the side CD) of D,
A point whose coordinate value in the short side direction is close to the middle point of the side AB (referred to as the point D) is selected, and the length AB in the direction from the point D to the point C is selected.
Is calculated, the midpoints of the side AB and the side C′D are calculated, and if the black pixel ratio on the line segment connecting the two midpoints exceeds a predetermined value, A black pixel determining unit that determines that the connected component includes a line segment.
【請求項2】 文書を画像として入力する画像入力部
と、前記画像から連結成分を抽出する連結成分抽出部
と、前記連結成分の輪郭座標を(x,y)とし、Pを定
数としたとき、x+P・yを最小とする点A、x−P・
yを最小とする点B、x+P・yを最大とする点C、x
−P・yを最大とする点D、の計4点の座標を算出する
線分端点検出部と、前記点A,B,C,Dで表現される
四角形ABCDの外接矩形座標を算出し、長辺と短辺の
長さが所定の条件を満たすものを選択し出力する外接矩
形判定部と、前記外接矩形判定部において選択された連
結成分に関し、前記四角形ABCDのうち前記短辺に対
応する2辺をABとCDとしたとき、前記ABと
前記CDがいずれも所定の長さより短ければ第1ケー
ス、前記ABと前記CDのうち一方のみが所定の長
さより短ければ第2ケースとし、前記第1ケースまたは
前記第2ケースを満足するものを選択し出力する短辺判
定部と、前記短辺判定部において選択された連結成分に
関し、前記第1ケースに該当するものについては前記
ABと前記CDの各中点を算出し、両中点間を結ぶ線
分上の黒画素比率が所定値を越えるものであれば、前記
連結成分は線分を含むと判定し、前記第2ケースに該当
するものについては、前記ABと前記CDのうち長
い辺(前記CDとする)の2端点のうち、短辺方向の
座標値が前記ABの中点に近い点(前記点Dとする)
を選び、前記点Dから点Cの方向に長さABだけ離れた
点C’を算出し、前記ABとC’Dの各中点を算出
し、両中点間を結ぶ線分上の黒画素比率が所定値を越え
るものであれば、前記連結成分は線分を含むと判定する
黒画素判定部とを具備することを特徴とする線分検出装
置。
2. An image input unit for inputting a document as an image, a connected component extracting unit for extracting a connected component from the image, and when the contour coordinates of the connected component are (x, y) and P is a constant. , X + P · y at minimum A, x−P ·
Point B that minimizes y, Point C that maximizes x + P · y, x
A line segment end point detection unit that calculates coordinates of a total of four points, ie, a point D that maximizes P · y, and a circumscribed rectangular coordinate of the square ABCD represented by the points A, B, C, and D; A circumscribed rectangle determination unit that selects and outputs a long side and a short side satisfying a predetermined condition, and a connected component selected by the circumscribed rectangle determination unit, and corresponds to the short side of the square ABCD. When the two sides are a side AB and a side CD, the first case is provided if both the side AB and the side CD are shorter than a predetermined length, and if only one of the side AB and the side CD is shorter than a predetermined length. A second case, a short side determining unit that selects and outputs the one that satisfies the first case or the second case, and a connected component selected by the short side determining unit that corresponds to the first case and the side AB for the sides CD Those calculates the middle point, if a black pixel ratio on a line segment connecting the two midpoints in which exceeds a predetermined value, the connected component is determined to contain a line segment, corresponding to the second case for the out of 2 end points of the long sides (and the side CD) of the sides AB and the side CD, the coordinate values of the short-side direction (the said point D) the midpoint point near the said side AB
Is calculated, a point C ′ separated from the point D by a length AB in the direction of the point C is calculated, each midpoint of the side AB and the side C′D is calculated, and a line segment connecting the two midpoints is calculated. A black pixel determination unit that determines that the connected component includes a line segment if the black pixel ratio of the line segment exceeds a predetermined value.
JP6232752A 1994-09-28 1994-09-28 Line detection method Expired - Fee Related JP2715930B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6232752A JP2715930B2 (en) 1994-09-28 1994-09-28 Line detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6232752A JP2715930B2 (en) 1994-09-28 1994-09-28 Line detection method

Publications (2)

Publication Number Publication Date
JPH0896076A JPH0896076A (en) 1996-04-12
JP2715930B2 true JP2715930B2 (en) 1998-02-18

Family

ID=16944207

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6232752A Expired - Fee Related JP2715930B2 (en) 1994-09-28 1994-09-28 Line detection method

Country Status (1)

Country Link
JP (1) JP2715930B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4738469B2 (en) * 2008-10-29 2011-08-03 株式会社東芝 Image processing apparatus, image processing program, and image processing method

Also Published As

Publication number Publication date
JPH0896076A (en) 1996-04-12

Similar Documents

Publication Publication Date Title
JP3308032B2 (en) Skew correction method, skew angle detection method, skew correction device, and skew angle detection device
US7440618B2 (en) Apparatus for extracting rules line from multiple-valued image
CN101246549B (en) Method and apparatus for recognizing boundary line in an image information
JP3996579B2 (en) Form processing system for identifying active areas of machine-readable forms
EP1017011A2 (en) Block selection of table features
JP4565396B2 (en) Image processing apparatus and image processing program
JP4011646B2 (en) Line detection method and character recognition device
JP3006466B2 (en) Character input device
JP2715930B2 (en) Line detection method
JPH08210811A (en) Method and device for detecting circle or ellipse
JP3442847B2 (en) Character reader
JP3476595B2 (en) Image area division method and image binarization method
JP4242962B2 (en) Character extractor
JPH09134404A (en) Bar graph recognizing device
JP3187894B2 (en) Document image tilt detection method
JP3517077B2 (en) Pattern extraction device and method for extracting pattern area
JP2957729B2 (en) Line direction determination device
JP2630261B2 (en) Character recognition device
JPH0573718A (en) Area attribute identification method
JP2982221B2 (en) Character reader
JP2937607B2 (en) Layout creation device
JP3100825B2 (en) Line recognition method
JP2881080B2 (en) Feature extraction method
JP2755299B2 (en) Image processing method
JPH0217586A (en) Inclination extracting device

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19971007

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

Free format text: PAYMENT UNTIL: 20071107

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20081107

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20081107

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20091107

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20091107

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20101107

Year of fee payment: 13

LAPS Cancellation because of no payment of annual fees