JPH08161494A - Method for detecting line segment and its device - Google Patents

Method for detecting line segment and its device

Info

Publication number
JPH08161494A
JPH08161494A JP6304519A JP30451994A JPH08161494A JP H08161494 A JPH08161494 A JP H08161494A JP 6304519 A JP6304519 A JP 6304519A JP 30451994 A JP30451994 A JP 30451994A JP H08161494 A JPH08161494 A JP H08161494A
Authority
JP
Japan
Prior art keywords
line segment
line
candidate
segment
area
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.)
Granted
Application number
JP6304519A
Other languages
Japanese (ja)
Other versions
JP3596055B2 (en
Inventor
Masafumi Yamamoto
雅史 山本
Atsushi Kutami
篤 久田見
Masanori Kobayashi
正典 小林
Hiroyuki Yoshida
博行 吉田
Hiroyuki Takahashi
弘行 高橋
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.)
Mazda Motor Corp
Original Assignee
Mazda Motor 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 Mazda Motor Corp filed Critical Mazda Motor Corp
Priority to JP30451994A priority Critical patent/JP3596055B2/en
Publication of JPH08161494A publication Critical patent/JPH08161494A/en
Application granted granted Critical
Publication of JP3596055B2 publication Critical patent/JP3596055B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE: To attain accurate detection of a line segment independently of a position of discrimination by calculating an overlap area interposed between an extension line of a 1st line segment object and a 2nd line segment object and discriminating it that the 1st and 2nd line segment objects form a same line segment when a level corresponding to the area is a prescribed threshold level or below. CONSTITUTION: The device is made up of a pre-processing section 1, a line segment detection section 2, a line segment discrimination section 3 and a line segment synthesis section 4. Then an overlap area S interposed between an extension line of a line segment object 9MAX in a direction of an line segment object g1 and the line segment object g1 is calculated and whether or not the line segment object g1 forms a same line segment with the line segment object gMAX, is discriminated based on the magnitude of the overlap area S. Thus, it is avoided that a straight line is adopted for a curve in mistake or a substantially one-line-segment is thinned and a line segment is accurately detected independently of a position of discrimination.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、入力画像から線分を検
出する線分検出方法およびその装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a line segment detecting method and apparatus for detecting a line segment from an input image.

【0002】[0002]

【従来の技術】例えば自動車組立て工場における作業の
自動化のためには部品のハンドリングが非常に重要な問
題である。特に、組立て領域の自動化において必要とさ
れているようなロボットによる多機能で正確な自動ハン
ドリングを実現するためには、対象物の画像の細線化処
理を行なって線分を検出し、この線分から対象物の形状
を精度良く抽出する技術が必要となってくる。
2. Description of the Related Art Handling of parts is a very important problem for automating work in an automobile assembly factory, for example. In particular, in order to realize multifunctional and accurate automatic handling by a robot, which is required in the automation of the assembly area, thinning the image of the object is performed to detect the line segment, and from this line segment A technique for accurately extracting the shape of an object is needed.

【0003】従来の線分検出方法として、下記の方法が
知られている。
The following methods are known as conventional line segment detection methods.

【0004】(1) 入力画像に対して、エッジ検出、2値
化、細線化等の前処理を行い、細線画像を得る。
(1) The input image is subjected to pre-processing such as edge detection, binarization and thinning to obtain a thin line image.

【0005】(2) 上記細線画像に含まれる全てのセグメ
ントについて、以下の処理(3) 〜(7)を行なう。ここ
で、「セグメント」とは、線幅1の、連続した画素列で
あって、分岐のないものを意味する。
(2) The following processes (3) to (7) are performed on all the segments included in the thin line image. Here, the "segment" means a continuous pixel row having a line width of 1 and having no branch.

【0006】(3) 任意のセグメントの端点からk個の画
素n1 〜nk (kの初期値として、例えばk=3とす
る)に対して、最小二乗法等を適用して直線を当てはめ
る。得られた直線をL1 とする。
(3) A straight line is applied to the k pixels n 1 to n k (k = 3, for example, as an initial value of k) from the end points of an arbitrary segment by applying the least square method or the like. . Let the obtained straight line be L 1 .

【0007】(4) (k+1)番目の画素nk+1 が直線L
1 に含まれるか否かを判別する。すなわち、画素n1
k+1 に対して、最小二乗法等を適用して直線を当ては
め、得られた直線をL2 とする。
(4) The (k + 1) th pixel n k + 1 is a straight line L
Determine whether it is included in 1 . That is, the pixels n 1 to
A straight line is applied to n k + 1 by applying the least square method or the like, and the obtained straight line is defined as L 2 .

【0008】(5) 直線L1 の傾きα1 と直線L2 の傾き
α2 とを比較し、|α1 −α2 |の値が所定のしきい値
以下であれば、画素nk+1 は直線L1 上にあると判定
し、|α1 −α2 |の値が所定のしきい値よりも大きけ
れば、画素nk+1 は直線L1 上にないと判定する。
[0008] (5) comparing the inclination alpha 2 of the straight line L 1 of inclination alpha 1 and the line L 2, | α 1 -α 2 | If the value is equal to or less than the predetermined threshold value, the pixel n k + It is determined that 1 is on the straight line L 1 , and if the value of | α 1 −α 2 | is larger than the predetermined threshold value, it is determined that the pixel n k + 1 is not on the straight line L 1 .

【0009】(6) 画素nk+1 が直線L1 上にあれば、画
素n1 〜nk+1 に当てはまる直線を新たにL1 として、
処理(4) へ戻る。画素nk+1 が直線L1 上になければ、
画素n1 〜nk は1本の線分と見なし、画素nk+1 を端
点とし、処理(3) へ戻って新たに直線を検出する。
(6) If the pixel n k + 1 is on the straight line L 1 , a new straight line that fits the pixels n 1 to n k + 1 is newly set as L 1 .
Return to process (4). If the pixel n k + 1 is not on the straight line L 1 ,
The pixels n 1 to n k are regarded as one line segment, the pixel n k + 1 is used as an end point, and the process returns to the process (3) to detect a new straight line.

【0010】(7) 処理(3) 〜(6) をセグメントの終点に
達するまで反復する。
(7) Processes (3) to (6) are repeated until the end point of the segment is reached.

【0011】また、線分検出方法としては、上述以外
に、画像情報から物体の輪郭を抽出して輪郭点座標を求
め、該輪郭点座標からハフ(Hough )変換を行なって関
数ρ=xicosθ+yisinθで表される正弦波に
変換し、関数値ρに従って2次元ヒストグラムを作成
し、該ヒストグラム上のピーク点を検出することによ
り、上記輪郭点座標の示す線分情報を検出する方法があ
る(特開昭64−74680号公報参照)。
In addition to the above, as a line segment detection method, the contour of the object is extracted from the image information to obtain the contour point coordinates, and the Hough transform is performed from the contour point coordinates to obtain the function ρ = xicosθ + yisinθ. There is a method of detecting the line segment information indicated by the above-mentioned contour point coordinates by converting into a sine wave represented, creating a two-dimensional histogram according to the function value ρ, and detecting a peak point on the histogram (Japanese Patent Laid-Open No. 2000-242242). (See JP-A-64-74680).

【0012】[0012]

【発明が解決しようとする課題】ところで、上述の処理
(1) 〜(7) からなる従来の線分検出方法には、次のよう
な問題点があり、それが原因で、正確な線分抽出が困難
であった。すなわち、(1)ノイズの影響や量子化誤差
のために、本来同一線分を構成する画素が、図5に示す
ように、同一直線上に位置しない。特に、上述の処理
(5) で用いられるしきい値が小さいと、このような同一
線分上にあるべき画素が、同一線分上にないものと判断
され、多数の線分に細分化されてしまう。
By the way, the above-mentioned processing
The conventional line segment detection method consisting of (1) to (7) has the following problems, which makes it difficult to accurately extract line segments. That is, (1) pixels that originally form the same line segment are not located on the same straight line as shown in FIG. 5 due to the influence of noise and the quantization error. In particular, the above process
If the threshold value used in (5) is small, it is determined that such pixels that should be on the same line segment are not on the same line segment, and the pixels are subdivided into many line segments.

【0013】(2)問題点(1)を解決しようとしてし
きい値を大きくすると、曲線上の画素等に対しても線分
が当てはめられ、図6に示すように、誤った線分検出結
果を得ることになる。
(2) When the threshold value is increased in order to solve the problem (1), the line segment is fitted to the pixel on the curve, and the erroneous line segment detection result is obtained as shown in FIG. You will get

【0014】また、ハフ変換を用いる方法は、複雑な処
理を必要とし、使用メモリ量と処理コストの面で問題が
あった。
Further, the method using the Hough transform requires complicated processing and has a problem in terms of the amount of memory used and the processing cost.

【0015】そこで、本発明は、上記問題点を解決する
ためになされたもので、正確な線分検出を容易になし得
る線分検出方法およびその装置を提供することを目的と
する。
Therefore, the present invention has been made to solve the above problems, and an object of the present invention is to provide a line segment detecting method and an apparatus therefor capable of easily performing accurate line segment detection.

【0016】[0016]

【課題を解決するための手段】本発明による線分検出方
法は、入力画像から得られる多数の線分候補からなる線
画画像から同一線分を検出する方法であって、第1の線
分候補の延長線と第2の線分候補との間に介在するオー
バーラップ領域の面積を算出し、該オーバーラップ領域
の面積に対応する値が所定のしきい値以下の場合に、上
記第1および第2の線分候補が同一線分を構成すると判
定することを特徴とする。
A line segment detection method according to the present invention is a method for detecting the same line segment from a line drawing image composed of a large number of line segment candidates obtained from an input image, and is a first line segment candidate. Is calculated and the area corresponding to the area of the overlap region interposed between the extension line and the second line segment candidate is calculated. It is characterized in that it is determined that the second line segment candidates form the same line segment.

【0017】本発明の線分検出方法においては、任意の
セグメントの端点からk個の画素n1 〜nk に対して当
てはめられた第1の直線と、上記端点からk+1個の画
素n1 〜nk+1 に対して当てはめられた第2の直線との
なす角度が所定のしきい値以下の場合に画素nk+1 が上
記第1の直線上にあるとの判定に基づいて抽出した線分
候補群のうちの最も長い線分候補を上記第1の線分候補
として選定することができる。
In the line segment detecting method of the present invention, the first straight line fitted to the k pixels n 1 to n k from the end point of an arbitrary segment and the k + 1 pixels n 1 to n k from the above end point. the angle between the second straight line that is fitted against n k + 1 pixel n k + 1 if more than a predetermined threshold value is extracted based on the determination that in the first straight line The longest line segment candidate in the line segment candidate group can be selected as the first line segment candidate.

【0018】また、同一線分を構成すると判定された上
記第1および第2の線分候補に含まれる画素に対して、
最小二乗法を適用して新たな線分を合成することができ
る。
Further, for the pixels included in the first and second line segment candidates which are determined to form the same line segment,
The least-squares method can be applied to synthesize a new line segment.

【0019】本発明による線分検出装置は、入力画像に
対してエッジ検出、2値化、細線化およびラベル付け等
の各処理を施す前処理部と、該前処理部で得られる線画
画像に含まれる任意のセグメントの端点からk個の画素
1 〜nk に対して当てはめられた第1の直線と、上記
端点からk+1個の画素n1 〜nk+1 に対して当てはめ
られた第2の直線とのなす角度が所定のしきい値以下の
場合に画素nk+1 が上記第1の直線上にあるとの判定に
基づいて線分候補を抽出する線分検出部と、該線分検出
部で抽出された線分候補群のうちの最も長い線分候補を
第1の線分候補として選定し、該第1の線分候補の延長
線と第2の線分候補との間に介在するオーバーラップ領
域の面積を算出し、該オーバーラップ領域の面積に対応
する値が所定のしきい値以下の場合に、上記第1および
第2の線分が同一線分を構成すると判定する線分判定部
と、該線分判定部で同一線分を構成すると判定された上
記第1および第2の線分に含まれる画素に対して、最小
二乗法を適用して新たな線分を合成する線分合成部とを
備えていることを特徴とする。
A line segment detecting apparatus according to the present invention is provided with a pre-processing unit for performing edge detection, binarization, thinning, labeling, etc. on an input image, and a line drawing image obtained by the pre-processing unit. A first straight line fitted to k pixels n 1 to n k from the end points of any segment included, and a first straight line fitted to k + 1 pixels n 1 to n k + 1 from the end points. A line segment detection unit that extracts a line segment candidate based on the determination that the pixel n k + 1 is on the first straight line when the angle formed by the second straight line is less than or equal to a predetermined threshold value; The longest line segment candidate in the line segment candidate group extracted by the line segment detection unit is selected as the first line segment candidate, and the extended line of the first line segment candidate and the second line segment candidate are selected. Calculate the area of the overlapping area between them and set the value corresponding to the area of the overlapping area to the specified threshold. A line segment determination unit that determines that the first and second line segments form the same line segment when the value is less than or equal to a value, and the first and first line segments that are determined to form the same line segment by the line segment determination unit. It is characterized by further comprising a line segment synthesizing unit for synthesizing a new line segment by applying the least squares method to the pixels included in the second line segment.

【0020】[0020]

【作用および発明の効果】本発明の線分検出方法および
その装置によれば、第1の線分の延長線と該第1の線分
の延長方向に隣接する第2の線分との間に介在するオー
バーラップ領域の面積を算出し、このオーバーラップ領
域の面積の大小に基づいて、上記第1および第2の線分
が同一線分を構成するか否かを判定しているので、曲線
に対して誤って直線を当てはめたり、本来1本の線分が
細分化されたりするような問題が解消され、判定位置に
関わり無く、正確な線分検出が可能になる。
According to the line segment detecting method and apparatus of the present invention, between the extension line of the first line segment and the second line segment adjacent in the extension direction of the first line segment. Since the area of the overlap area intervening in is calculated and it is determined whether or not the first and second line segments form the same line segment based on the size of the area of the overlap area, The problem that a straight line is erroneously fitted to a curve or one line segment is originally subdivided is solved, and accurate line segment detection is possible regardless of the determination position.

【0021】[0021]

【実施例】以下、図面を参照して本発明の実施例につい
て説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0022】図1は、本発明による線分検出装置の構成
を示すブロック図で、前処理部1、線分検出部2、線分
判定部3および線分合成部4とによって構成されてい
る。
FIG. 1 is a block diagram showing the configuration of a line segment detecting device according to the present invention, which is composed of a preprocessing unit 1, a line segment detecting unit 2, a line segment determining unit 3 and a line segment synthesizing unit 4. .

【0023】上記前処理部1は、入力画像に対して、エ
ッジ検出、2値化、細線化およびラベル付け等の前処理
を施す機能を有し、上記線分検出部2は、上記前処理部
1で得られる線画画像に含まれる任意のセグメントの端
点からk個の画素n1 〜nkに対して当てはめられた第
1の直線と、上記端点からk+1個の画素n1 〜nk+1
に対して当てはめられた第2の直線とのなす角度が所定
のしきい値以下の場合に画素nk+1 が上記第1の直線上
にあるとの判定に基づいて線分を抽出する機能を有す
る。
The preprocessing unit 1 has a function of performing preprocessing such as edge detection, binarization, thinning, and labeling on the input image, and the line segment detection unit 2 performs the preprocessing. The first straight line fitted to the k pixels n 1 to n k from the end points of any segment included in the line drawing image obtained in the section 1, and the k + 1 pixels n 1 to n k + from the end points. 1
A function of extracting a line segment based on the determination that the pixel n k + 1 is on the first straight line when the angle formed by the second straight line fitted to Have.

【0024】上記線分判定部3は、上記線分検出部2で
抽出された線分候補群のうちの最も長い線分候補を第1
の線分候補として選定し、該第1の線分候補の延長線と
第2の線分候補との間に介在するオーバーラップ領域の
面積を算出し、該オーバーラップ領域の面積に対応する
値が所定のしきい値以下の場合に、上記第1および第2
の線分候補が同一線分を構成すると判定する機能を有
し、上記線分合成部4は、上記線分判定部3で同一線分
を構成すると判定された上記第1および第2の線分候補
に含まれる画素に対して、最小二乗法を適用して新たな
線分を合成する機能を有する。
The line segment determination unit 3 first determines the longest line segment candidate in the line segment candidate group extracted by the line segment detection unit 2.
Value of the overlap region intervening between the extension line of the first line segment candidate and the second line segment candidate, and a value corresponding to the area of the overlap region. Is less than or equal to a predetermined threshold value, the first and second
Has a function of determining that they form the same line segment, and the line segment combining unit 4 determines that the line segment determination unit 3 determines that the line segment combination unit 3 forms the same line segment. It has a function of applying the least squares method to the pixels included in the segment candidate to synthesize a new line segment.

【0025】次に、上記線分検出装置によって実行され
る処理について、図2のフロ−チャ−トを参照して説明
する。
Next, the processing executed by the line segment detecting device will be described with reference to the flowchart of FIG.

【0026】(I)前処理 入力画像に対して、エッジ検出、2値化、細線化および
ラベル付け等の各処理を順に行なう。
(I) Pre-processing The input image is sequentially subjected to processing such as edge detection, binarization, thinning and labeling.

【0027】(II)線分検出 前述した従来技術と同様に、線画画像に含まれる任意の
セグメントの端点からk個の画素n1 〜nk に対して当
てはめられた第1の直線と、上記端点からk+1個の画
素n1 〜nk+1 に対して当てはめられた第2の直線との
なす角度が所定のしきい値以下の場合に画素nk+1 が上
記第1の直線上にあるとの判定に基づいて線分候補を抽
出する。このとき、しきい値を小さく設定し、細分化さ
れた線分候補が多数検出されるようにする。検出された
線分候補には、セグメントと同じラベルを付す(S
1)。
(II) Line Segment Detection Similar to the above-mentioned conventional technique, the first straight line fitted to the k pixels n 1 to n k from the end point of an arbitrary segment included in the line drawing image, and the above When the angle formed by the second straight line fitted to the k + 1 pixels n 1 to n k + 1 from the end point is equal to or less than a predetermined threshold value, the pixel n k + 1 is placed on the first straight line. A line segment candidate is extracted based on the determination that there is. At this time, the threshold value is set small so that a large number of subdivided line segment candidates are detected. The detected line segment candidate is labeled with the same label as the segment (S
1).

【0028】(III )線分判定 (イ)ラベル1が付された線分候補g1 〜gn に対し
て、以下の処理を行なう。
[0028] (III) with respect to the segment candidate segment discrimination (a) label 1 is affixed g 1 to g n, the following processing is performed.

【0029】(ロ)線分g1 〜gn の中で最も長い線分
候補gm を選び、それをgMAX とする(S2)。
(B) The longest line segment candidate g m is selected from the line segments g 1 to g n , and it is set as g MAX (S2).

【0030】(ハ)線分候補gMAX とgi (i=1,
2,…m−1,m+1,…n)の同一判定を行なう。こ
の同一判定は、図3に示すように、線分候補gMAX の線
分候補gi 方向への延長線に対して線分gi の両端から
垂線を引き、線分gMAX と線分gi と両垂線とによって
囲まれた領域、すなわち、線分gMAX の延長線と線分g
i との間に介在するオーバーラップ領域S(斜線部分)
の面積に対応する評価値Eを下記の評価式によって算出
し、評価値Eが所定のしきい値以下の場合に、線分候補
i は線分候補gMAX と同一線分を構成するものと判定
し、評価値Eが所定のしきい値よりも大きければ、線分
候補gi は線分候補gMAX と異なる線分を構成するもの
と判定する(S3)。
(C) Line segment candidates g MAX and g i (i = 1,
2, ... M-1, m + 1, ... N) are determined to be the same. As shown in FIG. 3, the same determination is performed by drawing perpendicular lines from both ends of the line segment g i with respect to the extension line of the line segment candidate g MAX in the direction of the line segment candidate g i to obtain the line segment g MAX and the line segment g i. A region surrounded by i and both perpendiculars, that is, an extension of line segment g MAX and line segment g
Overlap area S (shaded area) between i and
An evaluation value E corresponding to the area of the line segment is calculated by the following evaluation formula, and when the evaluation value E is less than or equal to a predetermined threshold value, the line segment candidate g i constitutes the same line segment as the line segment candidate g MAX. If the evaluation value E is larger than the predetermined threshold value, it is determined that the line segment candidate g i constitutes a line segment different from the line segment candidate g MAX (S3).

【0031】[0031]

【数1】 [Equation 1]

【0032】ただし、gMAX :ax+by+c=0,線
分候補gi に平行なベクトルを(p,q)、(xC ,y
C )を線分候補gi の中点、Lを線分候補gi の長さと
する。
However, g MAX : ax + by + c = 0, a vector parallel to the line segment candidate g i is (p, q), (x C , y
Let C ) be the midpoint of the line segment candidate g i and L be the length of the line segment candidate g i .

【0033】(IV)線分合成 (イ)全ての線分候補について上記同一判定を行なった
後(S4)、同一線分を構成する画素に対して、最小二
乗法を適用して合成された線分の方程式を求める(S
5)。実際には、下記の式を用いて線分の方程式y=a
x+bのパラメータを求める。
(IV) Line segment composition (a) After the same determination is made for all line segment candidates (S4), the pixels forming the same line segment are combined by applying the least squares method. Find the equation of the line segment (S
5). In practice, the equation of the line segment y = a
Find the parameter of x + b.

【0034】[0034]

【数2】 [Equation 2]

【0035】(ロ)上記(III )の処理(ロ)(S2)
へ戻り、残りの線分候補gk について処理を反復する。
線分候補gk がなくなれば、処理(ハ)へ進む。
(B) Process of (III) above (b) (S2)
Then, the process is repeated for the remaining line segment candidates g k .
When the line segment candidates g k are exhausted, the process proceeds to (c).

【0036】(ハ)次のラベルを選択し、(III )の処
理(ロ)(S2)へ戻る。全てのラベルについて処理が
終了すれば、終了。
(C) The next label is selected, and the process returns to (III) (B) (S2). When the processing is completed for all the labels, the processing ends.

【0037】以上が本発明による線分検出方法およびそ
の装置の実施例の説明であるが、本実施例によれば、線
分候補gMAX の候補線分gi 方向への延長線と線分候補
iとの間に介在するオーバーラップ領域Sの面積を算
出し、このオーバーラップ領域の面積の大小に基づい
て、線分候補gi が線分候補MAX と同一線分を構成する
か否かを判定しているので、曲線に対して誤って直線を
当てはめたり、本来1本の線分が細分化されたりするこ
とがなくなり、判定位置に関わり無く、正確な線分検出
が可能になる。
The above is the description of the embodiment of the line segment detecting method and apparatus according to the present invention. According to the present embodiment, the extension line and the line segment of the line segment candidate g MAX in the candidate line segment g i direction. calculating the area of the overlap region S interposed between the candidate g i, whether based on the magnitude of the area of the overlap region, the line segment candidate g i constitutes the same segment and the line segment candidate MAX Since it is determined whether or not a straight line is accidentally applied to a curve or one line segment is originally subdivided, accurate line segment detection is possible regardless of the determination position. .

【0038】なお、本実施例では、上記(I)の前処理
において、入力画像に対しエッジ検出、2値化、細線化
およびラベル付け等の各処理を順に行ない、かつ上記
(II)の線分検出において、線画画像に含まれる任意の
セグメントの端点からk個の画素n1 〜nk に対して当
てはめられた第1の直線と、上記端点からk+1個の画
素n1 〜nk+1 に対して当てはめられた第2の直線との
なす角度が所定のしきい値以下の場合に、画素nk+1
上記第1の直線上にあると判定しているが、これに代わ
り、入力画像を微分して検出したエッジにおける各画素
の濃度勾配のベクトル(方向および大きさ)を求め、互
いに隣接する画素の濃度勾配のベクトルの差を所定のし
きい値よりも小さい場合に、互いに隣接する2つの画素
が同一直線上にあると判定するようにしても良い。
In this embodiment, in the pre-processing (I), each processing such as edge detection, binarization, thinning and labeling is sequentially performed on the input image, and the line (II) is processed. In the minute detection, a first straight line fitted to the k pixels n 1 to n k from the end points of any segment included in the line drawing image and the k + 1 pixels n 1 to n k + 1 from the end points. the angle between the second straight line fitted against the case is less than a predetermined threshold value, but the pixel n k + 1 is determined to be in the first straight line, instead, The vector (direction and size) of the density gradient of each pixel at the edge detected by differentiating the input image is obtained, and when the difference between the vectors of the density gradient of pixels adjacent to each other is smaller than a predetermined threshold value, It is determined that two adjacent pixels are on the same straight line. It may be.

【0039】すなわち、図4に示すように、座標
(x0 ,y0 )を有する1つの画素p0 の8近傍の画素
の濃度をf1 〜f8 とすると、画素p0 の水平方向の濃
度勾配uおよび垂直方向の濃度勾配vはそれぞれ下式で
表される。
That is, as shown in FIG. 4, assuming that the densities of pixels in the vicinity of one pixel p 0 having coordinates (x 0 , y 0 ) 8 are f 1 to f 8 , the horizontal direction of the pixel p 0 is shown. The concentration gradient u and the vertical concentration gradient v are respectively expressed by the following equations.

【0040】 u=(f3 +f4 +f5 )−(f1 +f7 +f8 ) v=(f5 +f6 +f7 )−(f1 +f2 +f3 ) また、画素p0 (x0 ,y0 )の濃度勾配のベクトルの
方向を示す直線をy=k×(x−x0 )+y0 とする
と、上記ベクトルの方向を表す係数kおよび上記ベクト
ルの大きさP0 はそれぞれ下記の式で表される。
U = (f 3 + f 4 + f 5 ) − (f 1 + f 7 + f 8 ) v = (f 5 + f 6 + f 7 ) − (f 1 + f 2 + f 3 ). Further, the pixel p 0 (x 0 , x 0 , If the straight line indicating the direction of the vector of the concentration gradient of y 0 ) is y = k × (x−x 0 ) + y 0 , the coefficient k indicating the direction of the vector and the size P 0 of the vector are respectively expressed by the following equations. It is represented by.

【0041】k = tan-1(v/u) P0 =√(u2 +v2 ) このような画素の濃度勾配のベクトルの方向および大き
さを求める演算を各画素について行なって、互いに隣接
する画素の濃度勾配のベクトルの方向および大きさの差
がそれぞれ所定のしきい値以内である画素が同一直線上
にあると判定すれば良い。
K = tan −1 (v / u) P 0 = √ (u 2 + v 2 ) Such a calculation is performed for each pixel to obtain the direction and magnitude of the vector of the density gradient of the pixel, and they are adjacent to each other. It may be determined that the pixels whose difference in the direction and magnitude of the vector of the density gradient of the pixels are within the predetermined thresholds are on the same straight line.

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

【図1】本発明による線分検出装置の構成の1例を示す
ブロック図
FIG. 1 is a block diagram showing an example of the configuration of a line segment detecting device according to the present invention.

【図2】本発明による線分検出方法における処理の流れ
を表すフロ−チャ−ト
FIG. 2 is a flowchart showing the flow of processing in the line segment detecting method according to the present invention.

【図3】同 作用の説明図FIG. 3 is an explanatory diagram of the same action.

【図4】画素の濃度勾配を該画素の8近傍の画素の濃度
から求める方法の説明図
FIG. 4 is an explanatory diagram of a method for obtaining a density gradient of a pixel from the densities of pixels in the vicinity of the pixel.

【図5】従来の線分検出方法の問題点の説明図FIG. 5 is an explanatory diagram of problems of the conventional line segment detection method.

【図6】従来の線分検出方法の問題点の説明図FIG. 6 is an explanatory view of problems of the conventional line segment detection method.

【符号の説明】 1 前処理部 2 線分検出部 3 線分判定部 4 線分合成部[Explanation of reference numerals] 1 preprocessing unit 2 line segment detection unit 3 line segment determination unit 4 line segment synthesis unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 吉田 博行 広島県安芸郡府中町新地3番1号 マツダ 株式会社内 (72)発明者 高橋 弘行 広島県安芸郡府中町新地3番1号 マツダ 株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Hiroyuki Yoshida 3-1, Shinchi Fuchu-cho, Aki-gun, Hiroshima Prefecture Mazda Co., Ltd. (72) Inventor Hiroyuki Takahashi 3-1-1 Shinchu, Fuchu-cho, Hiroshima Prefecture Mazda Motor Corporation Within

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 入力画像から得られる多数の線分候補か
らなる線画画像から同一線分を検出する方法であって、 第1の線分候補の延長線と第2の線分候補との間に介在
するオーバーラップ領域の面積を算出し、該オーバーラ
ップ領域の面積に対応する値が所定のしきい値以下の場
合に、上記第1および第2の線分候補が同一線分を構成
すると判定することを特徴とする線分検出方法。
1. A method for detecting the same line segment from a line drawing image composed of a large number of line segment candidates obtained from an input image, wherein the line segment is between the extension line of the first line segment candidate and the second line segment candidate. If the area corresponding to the area of the overlap area is calculated and the value corresponding to the area of the overlap area is less than or equal to a predetermined threshold value, the first and second line segment candidates form the same line segment. A line segment detection method characterized by making a determination.
【請求項2】 任意のセグメントの端点からk個の画素
1 〜nk に対して当てはめられた第1の直線と、上記
端点からk+1個の画素n1 〜nk+1 に対して当てはめ
られた第2の直線とのなす角度が所定のしきい値以下の
場合に画素nk+1 が上記第1の直線上にあるとの判定に
基づいて抽出した線分候補群のうちの最も長い線分候補
を上記第1の線分候補として選定することを特徴とする
請求項1に記載の線分検出方法。
2. A first straight line fitted to k pixels n 1 to n k from the end point of an arbitrary segment and a k + 1 pixel n 1 to n k + 1 fitted from the end point. Of the line segment candidate group extracted based on the determination that the pixel n k + 1 is on the first straight line when the angle formed by the formed second straight line is equal to or smaller than a predetermined threshold value. The line segment detection method according to claim 1, wherein a long line segment candidate is selected as the first line segment candidate.
【請求項3】 同一線分を構成すると判定された上記第
1および第2の線分候補に含まれる画素に対して、最小
二乗法を適用して新たな線分を合成することを特徴とす
る請求項1または2に記載の線分検出方法。
3. A new line segment is synthesized by applying the least-squares method to pixels included in the first and second line segment candidates that are determined to form the same line segment. The line segment detection method according to claim 1 or 2.
【請求項4】 入力画像に対してエッジ検出、2値化、
細線化およびラベル付け等の各処理を施す前処理部と、 該前処理部で得られる線画画像に含まれる任意のセグメ
ントの端点からk個の画素n1 〜nk に対して当てはめ
られた第1の直線と、上記端点からk+1個の画素n1
〜nk+1 に対して当てはめられた第2の直線とのなす角
度が所定のしきい値以下の場合に画素nk+1 が上記第1
の直線上にあるとの判定に基づいて線分候補を抽出する
線分検出部と、 該線分検出部で抽出された線分候補群のうちの最も長い
線分候補を第1の線分候補として選定し、該第1の線分
候補の延長線と第2の線分候補との間に介在するオーバ
ーラップ領域の面積を算出し、該オーバーラップ領域の
面積に対応する値が所定のしきい値以下の場合に、上記
第1および第2の線分候補が同一線分を構成すると判定
する線分判定部と、 該線分判定部で同一線分を構成すると判定された上記第
1および第2の線分候補に含まれる画素に対して、最小
二乗法を適用して新たな線分を合成する線分合成部とを
備えていることを特徴とする線分検出装置。
4. Edge detection for an input image, binarization,
A pre-processing unit for performing each processing such as thinning and labeling, and a first processing applied to k pixels n 1 to n k from the end point of an arbitrary segment included in the line drawing image obtained by the pre-processing unit. 1 and k + 1 pixels n 1 from the above end point
If the angle formed by the second straight line fitted to ˜n k + 1 is less than or equal to a predetermined threshold value, the pixel n k + 1 is
Line segment detection unit that extracts line segment candidates based on the determination that they are on the straight line, and the longest line segment candidate of the line segment candidate group extracted by the line segment detection unit is the first line segment. It is selected as a candidate, the area of the overlap region interposed between the extension line of the first line segment candidate and the second line segment candidate is calculated, and the value corresponding to the area of the overlap region is set to a predetermined value. A line segment determination unit that determines that the first and second line segment candidates form the same line segment when the threshold value is less than or equal to a threshold value, and the first line segment determination unit that determines that the line segment determination unit configures the same line segment. A line segment synthesizing unit for synthesizing a new line segment by applying the least squares method to the pixels included in the first and second line segment candidates.
JP30451994A 1994-12-08 1994-12-08 Line segment detection method and device Expired - Fee Related JP3596055B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30451994A JP3596055B2 (en) 1994-12-08 1994-12-08 Line segment detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30451994A JP3596055B2 (en) 1994-12-08 1994-12-08 Line segment detection method and device

Publications (2)

Publication Number Publication Date
JPH08161494A true JPH08161494A (en) 1996-06-21
JP3596055B2 JP3596055B2 (en) 2004-12-02

Family

ID=17934007

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30451994A Expired - Fee Related JP3596055B2 (en) 1994-12-08 1994-12-08 Line segment detection method and device

Country Status (1)

Country Link
JP (1) JP3596055B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101691917B1 (en) * 2015-07-07 2017-01-02 조웅희 System for and method of simplfying continuously coupled lines to single line

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101691917B1 (en) * 2015-07-07 2017-01-02 조웅희 System for and method of simplfying continuously coupled lines to single line

Also Published As

Publication number Publication date
JP3596055B2 (en) 2004-12-02

Similar Documents

Publication Publication Date Title
CN111474184B (en) AOI character defect detection method and device based on industrial machine vision
CN107543828B (en) Workpiece surface defect detection method and system
US7162089B2 (en) Method for segmenting and recognizing an image in industry radiation imaging
EP0853293A1 (en) Subject image extraction method and apparatus
CN110766095B (en) Defect detection method based on image gray level features
CN106920245B (en) Boundary detection method and device
CN109911481B (en) Cabin frame target visual identification and positioning method and system for metallurgical robot plugging
CN110334760B (en) Optical component damage detection method and system based on RESUnet
Elias et al. JUDOCA: Junction detection operator based on circumferential anchors
CN110765992A (en) Seal identification method, medium, equipment and device
CN111126393A (en) Vehicle appearance refitting judgment method and device, computer equipment and storage medium
CN115184380A (en) Printed circuit board welding spot abnormity detection method based on machine vision
CN112085700A (en) Automatic extraction method, system and medium for weld joint region in X-ray image
Chen et al. Image segmentation based on mathematical morphological operator
CN113989604A (en) Tire DOT information identification method based on end-to-end deep learning
Salotti et al. Evaluation of edge detectors: Critics and proposal
CN115984211A (en) Visual positioning method, robot and storage medium
JPH08161494A (en) Method for detecting line segment and its device
JP3460356B2 (en) Method and apparatus for detecting circle or ellipse
CN110298799B (en) PCB image positioning correction method
CN105930813B (en) A method of detection composes a piece of writing this under any natural scene
CN112819009A (en) Target identification and positioning method based on Harris corner detection and NCC matching
JP3651037B2 (en) Line segment detection method and apparatus
CN111784634A (en) Harris-CPDA-based corner detection method
JPH0531791B2 (en)

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040427

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040511

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040707

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040817

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040830

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080917

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090917

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees