JP3651037B2 - Line segment detection method and apparatus - Google Patents
Line segment detection method and apparatus Download PDFInfo
- Publication number
- JP3651037B2 JP3651037B2 JP31822294A JP31822294A JP3651037B2 JP 3651037 B2 JP3651037 B2 JP 3651037B2 JP 31822294 A JP31822294 A JP 31822294A JP 31822294 A JP31822294 A JP 31822294A JP 3651037 B2 JP3651037 B2 JP 3651037B2
- Authority
- JP
- Japan
- Prior art keywords
- line segment
- line
- pixels
- pixel
- weighting
- 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
Links
Images
Landscapes
- Image Analysis (AREA)
Description
【0001】
【産業上の利用分野】
本発明は、入力画像から線分を検出する線分検出方法およびその装置に関する。
【0002】
【従来の技術】
例えば自動車組立て工場における作業の自動化のためには部品のハンドリングが非常に重要な問題である。特に、組立て領域の自動化において必要とされているようなロボットによる多機能で正確な自動ハンドリングを実現するためには、対象物の画像の細線化処理を行なって線分を検出し、この線分から対象物の形状を精度良く抽出する技術が必要となってくる。
【0003】
従来の線分検出方法として、下記の方法が知られている。
(1) 入力画像に対して、エッジ検出、2値化、細線化等の前処理を行い、細線画像を得る。
(2) 上記細線画像に含まれる全てのセグメントについて、以下の処理(3) 〜(7)を行なう。ここで、「セグメント」とは、線幅1の、連続した画素列であって、分岐の無いものを意味する。
(3) 任意のセグメントの端点からk個の画素n1 〜nk (kの初期値として、例えばk=3とする)に対して、最小二乗法等を適用して直線を当てはめる。得られた直線をL1 とする。
(4) (k+1)番目の画素nk+1 が直線L1 に含まれるか否かを判別する。すなわち、画素n1 〜nk+1 に対して、最小二乗法等を適用して直線を当てはめる。得られた直線をL2 とする。
(5) 直線L1 の傾きα1 と直線L2 の傾きα2 とを比較し、|α1 −α2 |の値が所定のしきい値以下であれば、画素nk+1 は直線L1 上にあると判定し、|α1 −α2 |の値が所定のしきい値よりも大きければ、画素nk+1 は直線L1 上にないと判定する。
(6) 画素nk+1 が直線L1 上にあれば、画素n1 〜nk+1 に当てはまる直線をL2 として、処理(4) へ戻る。画素nk+1 が直線L1 上になければ、画素n1 〜nk は1本の線分と見なし、画素nk+1 を端点とし、処理(3) へ戻って新たに直線を検出する。
(7) 処理(3) 〜(6) をセグメントの終点に達するまで反復する。
【0004】
また、線分検出方法としては、上述以外に、画像情報から物体の輪郭を抽出して輪郭点座標を求め、該輪郭点座標からハフ(Hough )変換を行なって関数ρ=xicosθ+yisinθで表される正弦波に変換し、パラメータθ,ρに従って2次元ヒストグラムを作成し、該ヒストグラム上のピーク点を検出することにより、上記輪郭点座標の示す線分情報を検出する方法がある(特開昭64−74680号公報参照)。
【0005】
【発明が解決しようとする課題】
ところで、上述の処理(1) 〜(7) からなる従来の線分検出方法には、次のような問題点があり、それが原因で、正確な線分抽出が困難であった。すなわち、(1)ノイズの影響や量子化誤差のために、本来同一線分を構成する画素が、図5に示すように、同一直線上に位置しない。特に、上述の処理(5) で用いられるしきい値が小さいと、このような同一線分上にあるべき画素が、同一線分上にないものと判断され、多数の線分に細分化されてしまう。
(2)問題点(1)を解決しようとしてしきい値を大きくすると、曲線上の画素等に対しても線分が当てはめられ、図6に示すように、誤った線分検出結果を得ることになる。
【0006】
また、ハフ変換を用いる方法は、複雑な処理を必要とし、使用メモリ量と処理コストの面で問題があった。
【0007】
そこで、本発明は、上記問題点を解決するためになされたもので、入力画像から得られる線画画像からの正確な線分検出を容易になし得る線分検出方法およびその装置を提供することを目的とする。
【0008】
【課題を解決するための手段】
本発明による線分検出方法は、入力画像から得られる線画画像中の線画から、複数の画素によって構成される第1の線分を抽出し、次いで新たな画素を取り込んで、上記第1の線分を構成する上記複数の画素と上記新たな画素とによって構成される第2の線分を抽出し、上記第1の線分と上記第2の線分との一致度を判定する線分検出方法において、
上記線分抽出処理における上記画素に対する上記線分の始端からの離れ度合いに応じた重み付けと、上記一致度判定処理における上記第1の線分の長さに応じた重み付けとのうち、少なくとも上記一致度判定処理における重み付けを行なうとともに、
上記一致度判定処理を、上記第1および第2の線分間の誤差を所定のしきい値と比較することによって行ない、上記一致度判定処理における重み付けを、上記誤差に対して上記第1の線分の長さを乗算することによって行なうことを特徴とする。
【0009】
上記線分抽出処理における重み付けは、上記線分の始端から離れた画素の重みを軽くすることによって行なうことができる。
【0010】
上記線分抽出処理は最小二乗法を適用して行なうことができる。
【0011】
本発明による線分検出装置は、入力画像から得られる線画画像中の線画から、複数の画素によって構成される第1の線分を抽出し、次いで新たな画素を取り込んで、上記第1の線分を構成する上記複数の画素と上記新たな画素とによって構成される第2の線分を抽出する線分抽出部と、
該線分抽出部により抽出された上記第1および第2の線分が同一直線を形成するか否かを該第1および第2の線分間の誤差を所定のしきい値と比較することによって判別する直線判別部とを備え、
上記線分抽出部において上記画素に対して上記線分の始端からの離れ度合いに応じた重み付けを行う機能と、上記直線判別部において上記第1および第2の線分間の誤差に対して上記第1の線分の長さを乗算することによって重み付けを行う機能とのうち、少なくとも上記直線判別部において重み付けを行う機能が付与されていることを特徴とする。
【0012】
【作用および発明の効果】
本発明の線分検出方法およびその装置によれば、曲線に対して誤って直線を当てはめたり、本来1本の線分が細分化されたりするような問題が解消され、正確な線分検出が可能になる。
【0013】
特に、本発明の線分検出方法は、2つの線分の一致度判定処理において、線分探索開始直後では、線分候補点の小さなばらつきでも線分のパラメータの大きなばらつきとなるが、線分の長さを重み付けることによって、2本の線分の検出誤差を相対的に小さくすることができる。またこれとは逆に、線分探索が進むにつれて、線分候補点が大きくばらついても線分パラメータには小さなばらつきとしかならないが、線分の長さを重み付けることによって、上記検出誤差を相対的に大きくすることができる。
【0014】
したがって、本発明によれば、2つの線分の一致度判定を安定的かつ正確に行なうことができる利点がある。
【0015】
なお、上述の線分抽出処理において、線分の始端から離れた画素の重みを軽くする場合には、曲がった部分での直線の引っ張りを小さく押さえることができる。このため、線分のパラメータ検出をより正確に行なうことができる。
【0016】
【実施例】
以下、図面を参照して本発明の実施例について説明する。
【0017】
図1は、本発明による線分検出装置の構成を示すブロック図で、前処理部1、線分抽出部2および直線判別部3によって構成されている。
【0018】
上記前処理部1は、入力画像に対して、エッジ検出、2値化、細線化およびラベル付け等の前処理を施して、線分候補点を抽出する機能を有する。上記線分抽出部2は、線分候補点に対して最小二乗法を適用して直線を当てはめる機能を有する。上記直線判別部3は、2つの線分が一致するか否か、すなわち2つの線分が同一直線を形成するか否かを判別する機能を有する。
【0019】
次に、上記線分検出装置によって実行される処理の1例について、図2のフロ−チャ−トを参照して説明する。
【0020】
(I)前処理
入力画像に対して、エッジ検出、2値化、細線化およびラベル付け等の各処理を順に行ない、ラベル付けされた線分候補点(画素)を得る(S1)。
【0021】
(II)線分抽出
ラベル1が付された線分候補点群の端点からi番目の点(画素)の座標を(xi ,yi )としたとき、1番目からn番目(例えばn=3)までの点(画素)で規定される線分を1次の最小二乗法で算出する(S2〜S4)。
【0022】
ただし、線分の始端から離れた終端部分のいくつかの点の重みを軽くして最小二乗法を適用する。例えば、終端の20%の点の重みを軽くする場合は、1番目から 0.8n番目未満までの点の重みを1とし、0.8n番目からn番目までの点の重みを例えば0.5とする。そして実際には、下式から直線の方程式y=ax+bを計算する。wi は画素の座標値に対する重み付け係数である。
【0023】
【数1】
【0024】
例えば、n=3であれば、1番目と2番目の点の重みを1とし、3番目の点の重みを0.5とする。また、n=6であれば、1番目から4番目までの点の重みのみを1とし、5番目と6番目の点の重みを0.5とする。
【0025】
(III )直線判別(一致度判定)
1番目からn番目までの点で規定される線分L1 を
a1 x+b1 y+c1 =0とし、
1番目からn+1番目までの点で規定される線分L2 を
a2 x+b2 y+c2 =0とする。
【0026】
線分L1 とL2 のパラメータをベクトルΛ1 =(a1 ,b1 ,c1 ),Λ2 =(a2 ,b2 ,c2 )で表し、2本の線分L1 とL2 間のパラメータの誤差をe=(Λ1 −Λ2 )(Λ1 −Λ2 )T LL1 とする。ただし、LL1 は線分L1 の長さを表す。
【0027】
次に、線分L1 とL2 が一致するか否か、すなわち、線分L1 とL2 が同一直線を形成するか否かを上記誤差eの値によって判別する(S5)。すなわち、上記誤差eが所定のしきい値よりも小さければ、線分L1 とL2 は同一直線であると見做し(S6:YES)、1番目からn+1番目までの点で線分L2 :a2 x+b2 y+c2 =0が規定される。また、上記誤差eが所定のしきい値よりも大きければ、線分L1 とL2 は同一直線上にないと見做し(S6:NO)、1番目からn番目までの点で線分L1 :a1 x+b1 y+c1 =0が規定され、n+1番目の点は異なる線分の端点とする。
【0028】
(IV)候補点群の全ての点について処理(II)〜(III )を反復する(S7〜S9)。
【0029】
(V)次のラベルへ移動し、処理(II)〜(IV)を反復する(S10,S11)。
【0030】
なお、直線判別(一致度判定)の方法として、上記2本の線分L1 とL2 のパラメータ誤差を求める方法の他に、図3に示すように、線分L1 の傾きα1 と線分L2 の傾きα2 との角度差によって求めることができる。
【0031】
なお、本実施例では、上記(I)の前処理において、入力画像に対しエッジ検出、2値化、細線化およびラベル付け等の各処理を順に行ない、かつ上記(II)の線分検出において、線画画像に含まれる任意のセグメントの端点からk個の画素n1 〜nk に対して当てはめられた第1の線分と、上記端点からk+1個の画素n1 〜nk+1 に対して当てはめられた第2の線分とのパラメータ誤差が所定のしきい値以下の場合に、画素nk+1 が上記第1の線分の延長線上にあると判定しているが、これに代わり、入力画像を微分して検出したエッジにおける各画素の濃度勾配のベクトル(方向および大きさ)を求め、互いに隣接する画素nk と画素nk+1 の濃度勾配のベクトルの差を所定のしきい値よりも小さい場合に、画素nk+1 が上記第1の線分の延長線上にあると判定するようにしても良い。
【0032】
すなわち、図4に示すように、座標(x0 ,y0 )を有する1つの画素n0 の8近傍の画素の濃度をf1 〜f8 とすると、画素p0 の水平方向の濃度勾配uおよび垂直方向の濃度勾配vはそれぞれ下式で表される。
【0033】
u=(f3 +f4 +f5 )−(f1 +f7 +f8 )
v=(f5 +f6 +f7 )−(f1 +f2 +f3 )
また、画素n0 (x0 ,y0 )の濃度勾配のベクトルの方向を示す直線をy=k×(x−x0 )+y0 とすると、上記ベクトルの方向を表す係数kおよび上記ベクトルの大きさP0 はそれぞれ下記の式で表される。
【0034】
k = tan-1(v/u)
P0 =√(u2 +v2 )
このような画素の濃度勾配のベクトルの方向および大きさを求める演算を画素nk と画素nk+1 について行なって、両画素の濃度勾配のベクトルの方向および大きさの差がそれぞれ所定のしきい値以内である場合に、画素n1 〜画素nk を含む線分と、画素n1 〜画素nk+1 を含む線分とが同一直線上にあると判定すれば良い。そして、その判定時に互いに隣接する画素の濃度勾配のベクトルの方向および大きさの差に対して、上述と同様に線分の長さを乗算して重み付けを行なえば良い。
【0035】
さらに、画素n1 〜画素nk を含む線分の延長線に対して画素nk+1 から垂線を引き、この垂線の長さに関し同様の重み付けを行なった上で所定のしきい値と比較して、画素n1 〜画素nk を含む線分と、画素n1 〜画素nk+1 を含む線分とが同一直線上にあると判定するようにしても良い。
【図面の簡単な説明】
【図1】 本発明による線分検出装置の構成の1例を示すブロック図
【図2】 本発明による線分検出方法における処理の流れを表すフロ−チャ−ト
【図3】 同 作用の説明図
【図4】 画素の濃度勾配を該画素の8近傍の画素の濃度から求める方法の説明図
【図5】 従来の線分検出方法の問題点の説明図
【図6】 従来の線分検出方法の問題点の説明図
【符号の説明】
1 前処理部
2 線分抽出部
3 直線判別部[0001]
[Industrial application fields]
The present invention relates to a line segment detection method and apparatus for detecting a line segment from an input image.
[0002]
[Prior art]
For example, handling of parts is a very important problem for automating operations in an automobile assembly factory. In particular, in order to realize multi-function and accurate automatic handling by a robot as required in the automation of the assembly area, the line image is detected by thinning the image of the object, and the line segment is detected from this line segment. A technique for accurately extracting the shape of the object is required.
[0003]
The following methods are known as conventional line segment detection methods.
(1) Preprocessing such as edge detection, binarization, thinning, etc. is performed on the input image to obtain a thin line image.
(2) The following processes (3) to (7) are performed for all 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.
(3) A straight line is applied to the k pixels n 1 to n k (for example, k = 3 as an initial value of k) from an end point of an arbitrary segment by applying the least square method or the like. The resulting straight line to L 1.
(4) The (k + 1) th pixel n k + 1 is a straight line L 1 It is discriminated whether it is included. That is, a straight line is applied to the pixels n 1 to n k + 1 by applying the least square method or the like. The resulting straight line and L 2.
(5) lines L 1 of comparing the gradient alpha 2 of inclination alpha 1 and the line L 2, | α 1 -α 2 | If the value is below a predetermined threshold value, the pixel n k + 1 linear It determines that on L 1, | α 1 -α 2 | if the value is greater than a predetermined threshold, the pixel n k + 1 is determined not on the straight line L 1.
(6) If the pixel n k + 1 is on the straight line L 1 , the straight line applicable to the pixels n 1 to n k + 1 is set as L 2 and the process returns to the 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 set as an end point, and the process returns to the process (3) to detect a new straight line. To do.
(7) Repeat steps (3) to (6) until the end point of the segment is reached.
[0004]
As a line segment detection method, in addition to the above, the contour point coordinates are obtained by extracting the contour of the object from the image information, the Hough transform is performed from the contour point coordinates, and the function ρ = xicos θ + yisin θ is expressed. There is a method of detecting line segment information indicated by the above contour point coordinates by converting into a sine wave, creating a two-dimensional histogram in accordance with parameters θ and ρ, and detecting a peak point on the histogram (Japanese Patent Laid-Open No. 64). -74680).
[0005]
[Problems to be solved by the invention]
By the way, the conventional line segment detection method comprising the above processes (1) to (7) has the following problems, which makes it difficult to accurately extract line segments. That is, (1) pixels that originally constitute the same line segment are not located on the same straight line as shown in FIG. 5 due to the influence of noise and quantization error. In particular, if the threshold value used in the above process (5) is small, such a pixel that should be on the same line segment is judged not to be on the same line segment, and is subdivided into a number of line segments. End up.
(2) When the threshold value is increased in order to solve the problem (1), the line segment is also applied to the pixels on the curve, and an erroneous line segment detection result is obtained as shown in FIG. become.
[0006]
Further, the method using the Hough transform requires complicated processing, and has a problem in terms of the amount of memory used and processing cost.
[0007]
Accordingly, the present invention has been made to solve the above problems, and provides a line segment detection method and apparatus capable of easily performing accurate line segment detection from a line drawing image obtained from an input image. Objective.
[0008]
[Means for Solving the Problems]
In the line segment detection method according to the present invention, a first line segment composed of a plurality of pixels is extracted from a line drawing in a line drawing image obtained from an input image, and then a new pixel is taken in. Line segment detection for extracting a second line segment composed of the plurality of pixels constituting the segment and the new pixel and determining a degree of coincidence between the first line segment and the second line segment In the method
At least the coincidence among the weighting according to the degree of separation from the start of the line segment with respect to the pixel in the line segment extraction process and the weighting according to the length of the first line segment in the coincidence degree determination process While performing weighting in the degree determination process,
The coincidence degree determination process is performed by comparing an error between the first and second line segments with a predetermined threshold, and weighting in the coincidence degree determination process is performed on the first line with respect to the error. It is performed by multiplying the length of minutes .
[0009]
The weighting in the line segment extraction process can be performed by reducing the weight of a pixel away from the start end of the line segment.
[0010]
The line segment extraction process can be performed by applying the least square method .
[0011]
The line segment detection apparatus according to the present invention extracts a first line segment composed of a plurality of pixels from a line drawing in a line drawing image obtained from an input image, and then takes in a new pixel to obtain the first line segment. A line segment extraction unit that extracts a second line segment composed of the plurality of pixels constituting the segment and the new pixel;
Whether or not the first and second line segments extracted by the line segment extraction unit form the same straight line is compared with an error in the first and second line segments with a predetermined threshold value. A straight line discriminating unit for discriminating,
A function of performing weighting according to the distant degree from the beginning of the segment with respect to the pixels in the line segment extraction unit, the in pairs to the error between the first and second line segments in the linear discriminator Among the functions of performing weighting by multiplying the length of the first line segment , at least the function of performing weighting in the straight line discriminating unit is provided.
[0012]
[Operation and effect of the invention]
According to the line segment detection method and apparatus of the present invention, the problem that a straight line is erroneously applied to a curve or a single line segment is originally subdivided is solved, and accurate line segment detection is achieved. It becomes possible.
[0013]
In particular, the line segment detecting method of the present invention, the coincidence determination processing of the two line segments, immediately after the line search start, but a great variation in the line parameters in small variations of line candidate points, line segments By weighting the length of, the detection error of the two line segments can be made relatively small. On the other hand, as the line segment search progresses, even if the line segment candidate points vary widely, the line segment parameter has only a small variation, but by weighting the length of the line segment, the detection error is reduced. It can be relatively large.
[0014]
Therefore, according to the present invention, there is an advantage that the coincidence determination of two line segments can be performed stably and accurately.
[0015]
Note that, in the above-described line segment extraction process, when the weight of the pixel far from the start of the line segment is lightened, it is possible to reduce the pulling of the straight line at the bent portion. For this reason, the parameter detection of a line segment can be performed more accurately.
[0016]
【Example】
Embodiments of the present invention will be described below with reference to the drawings.
[0017]
FIG. 1 is a block diagram showing the configuration of a line segment detection apparatus according to the present invention, which is composed of a
[0018]
The
[0019]
Next, an example of processing executed by the line segment detection apparatus will be described with reference to the flowchart of FIG.
[0020]
(I) Preprocessing Each process such as edge detection, binarization, thinning, and labeling is sequentially performed on the input image to obtain labeled line segment candidate points (pixels) (S1).
[0021]
(II) Line segment extraction When the coordinates of the i-th point (pixel) from the end point of the line segment candidate point group with
[0022]
However, the least squares method is applied by reducing the weights of some points at the end portion away from the start end of the line segment. For example, when reducing the weight of the 20% point at the end, the weights of the points from the first to less than the 0.8nth are set to 1, and the weights of the points from the 0.8nth to the nth are set to 0.5, for example. To do. In practice, the linear equation y = ax + b is calculated from the following equation. w i is a weighting coefficient for the coordinate value of the pixel.
[0023]
[Expression 1]
[0024]
For example, if n = 3, the weight of the first and second points is 1, and the weight of the third point is 0.5. If n = 6, only the weights of the first to fourth points are set to 1, and the weights of the fifth and sixth points are set to 0.5.
[0025]
(III) Straight line discrimination (coincidence judgment)
Line segment L 1 defined by the 1st to nth points
a 1 x + b 1 y + c 1 = 0,
The line segment L 2 defined by the 1st to n + 1th points is
It is assumed that a 2 x + b 2 y + c 2 = 0.
[0026]
The parameters of the line segments L 1 and L 2 are represented by vectors Λ 1 = (a 1 , b 1 , c 1 ), Λ 2 = (a 2 , b 2 , c 2 ), and two line segments L 1 and L The parameter error between the two is e = (Λ 1 −Λ 2 ) (Λ 1 −Λ 2 ) T LL 1 . However, LL 1 represents the length of the line segment L 1 .
[0027]
Next, whether or not the line segments L 1 and L 2 match, that is, whether or not the line segments L 1 and L 2 form the same straight line is determined based on the value of the error e (S5). That is, if the error e is smaller than a predetermined threshold value, the line segments L 1 and L 2 are regarded as being the same straight line (S6: YES), and the line segment L at the first to n + 1th points. 2: a 2 x + b 2 y + c 2 = 0 is defined. If the error e is larger than a predetermined threshold value, it is assumed that the line segments L 1 and L 2 are not on the same straight line (S6: NO), and the line segments are from the first to the nth points. L 1 : a 1 x + b 1 y + c 1 = 0 is defined, and the (n + 1) th point is an end point of a different line segment.
[0028]
(IV) The processes (II) to (III) are repeated for all points in the candidate point group (S7 to S9).
[0029]
(V) Move to the next label and repeat the processes (II) to (IV) (S10, S11).
[0030]
As a method of linear discriminant (coincidence determination), the other methods for obtaining the parameter error of the line segment L 1 and L 2 of the two above, as shown in FIG. 3, the inclination alpha 1 of the line segment L 1 It can be determined by the angle difference between the line segment L 2 and the slope α 2 .
[0031]
In the present embodiment, in the pre-processing (I), edge detection, binarization, thinning, and labeling are sequentially performed on the input image, and the line detection (II) is performed. The first line segment applied to k pixels n 1 to n k from the end points of any segment included in the line drawing image, and k + 1 pixels n 1 to n k + 1 from the end points The pixel n k + 1 is determined to be on the extension line of the first line segment when the parameter error with the second line segment applied is equal to or less than a predetermined threshold value. Instead, the vector (direction and magnitude) of the density gradient of each pixel at the edge detected by differentiating the input image is obtained, and the difference between the density gradient vectors of the adjacent pixels n k and n k + 1 is determined as a predetermined value. It is smaller than the threshold value, extending the pixel n k + 1 is the first line segment It may be determined to be in line.
[0032]
That is, as shown in FIG. 4, when the density of pixels near eight of one pixel n 0 having coordinates (x 0 , y 0 ) is f 1 to f 8 , the density gradient u in the horizontal direction of the pixel p 0 is set. The vertical concentration gradient v is expressed by the following equations.
[0033]
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, if a straight line indicating the direction of the density gradient vector of the pixel n 0 (x 0 , y 0 ) is y = k × (x−x 0 ) + y 0 , the coefficient k indicating the direction of the vector and the vector The magnitude P 0 is expressed by the following formulas.
[0034]
k = tan -1 (v / u)
P 0 = √ (u 2 + v 2 )
Such a calculation for obtaining the direction and magnitude of the density gradient vector of the pixel is performed for the pixel n k and the pixel n k + 1 , and the difference between the direction and magnitude of the density gradient vector of both pixels is predetermined. If it is within the threshold value, it may be determined that the line segment including the pixels n 1 to n k and the line segment including the pixels n 1 to n k + 1 are on the same straight line. Then, at the time of the determination, weighting may be performed by multiplying the difference in the direction and size of the density gradient vectors of adjacent pixels by the length of the line segment as described above.
[0035]
Further, a perpendicular line is drawn from the pixel n k + 1 to the extension line of the line segment including the pixels n 1 to n k , the same weighting is applied to the length of the perpendicular line, and a predetermined threshold value and ratio are compared. In comparison, it may be determined that the line segment including the pixels n 1 to n k and the line segment including the pixels n 1 to n k + 1 are on the same straight line.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an example of the configuration of a line segment detection apparatus according to the present invention. FIG. 2 is a flow chart showing the flow of processing in the line segment detection method according to the present invention. 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. FIG. 5 is an explanatory diagram of problems of a conventional line segment detection method. FIG. Explanatory diagram of method problems [Explanation of symbols]
1
Claims (4)
上記線分抽出処理における上記画素に対する上記線分の始端からの離れ度合いに応じた重み付けと、上記一致度判定処理における上記第1の線分の長さに応じた重み付けとのうち、少なくとも上記一致度判定処理における重み付けを行なうとともに、
上記一致度判定処理を、上記第1および第2の線分間の誤差を所定のしきい値と比較することによって行ない、上記一致度判定処理における重み付けを、上記誤差に対して上記第1の線分の長さを乗算することによって行なうことを特徴とする線分検出方法。Extracting a first line segment constituted by a plurality of pixels from a line drawing in the line drawing image obtained from the input image, then taking in a new pixel, and the plurality of pixels constituting the first line segment; In the line segment detection method for extracting the second line segment constituted by the new pixel and determining the degree of coincidence between the first line segment and the second line segment,
At least the coincidence among the weighting according to the degree of separation from the start of the line segment with respect to the pixel in the line segment extraction process and the weighting according to the length of the first line segment in the coincidence degree determination process While performing weighting in the degree determination process,
The coincidence degree determination process is performed by comparing an error between the first and second line segments with a predetermined threshold, and weighting in the coincidence degree determination process is performed on the first line with respect to the error. A method for detecting a line segment, which is performed by multiplying the length of a minute .
該線分抽出部により抽出された上記第1および第2の線分が同一直線を形成するか否かを該第1および第2の線分間の誤差を所定のしきい値と比較することによって判別する直線判別部とを備え、
上記線分抽出部において上記画素に対して上記線分の始端からの離れ度合いに応じた重み付けを行う機能と、上記直線判別部において上記第1および第2の線分間の誤差に対して上記第1の線分の長さを乗算することによって重み付けを行う機能とのうち、少なくとも上記直線判別部において重み付けを行う機能が付与されていることを特徴とする線分検出装置。Extracting a first line segment constituted by a plurality of pixels from a line drawing in the line drawing image obtained from the input image, then taking in a new pixel, and the plurality of pixels constituting the first line segment; A line segment extractor for extracting a second line segment constituted by the new pixel;
Whether or not the first and second line segments extracted by the line segment extraction unit form the same straight line is compared with an error in the first and second line segments with a predetermined threshold value. A straight line discriminating unit for discriminating,
A function of performing weighting according to the distant degree from the beginning of the segment with respect to the pixels in the line segment extraction unit, the in pairs to the error between the first and second line segments in the linear discriminator A line segment detection device , wherein at least a function of performing weighting in the straight line discriminating unit is provided among functions of performing weighting by multiplying the length of the first line segment .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP31822294A JP3651037B2 (en) | 1994-12-21 | 1994-12-21 | Line segment detection method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP31822294A JP3651037B2 (en) | 1994-12-21 | 1994-12-21 | Line segment detection method and apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH08180183A JPH08180183A (en) | 1996-07-12 |
JP3651037B2 true JP3651037B2 (en) | 2005-05-25 |
Family
ID=18096800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP31822294A Expired - Fee Related JP3651037B2 (en) | 1994-12-21 | 1994-12-21 | Line segment detection method and apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3651037B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4978437B2 (en) * | 2007-11-19 | 2012-07-18 | 富士ゼロックス株式会社 | Image processing apparatus and image processing program |
CN104700388A (en) * | 2013-12-09 | 2015-06-10 | 富士通株式会社 | Method and device for extracting distorted lines from images |
-
1994
- 1994-12-21 JP JP31822294A patent/JP3651037B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH08180183A (en) | 1996-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0149457B1 (en) | Method of identifying contour lines | |
US5629989A (en) | Image line-segment extracting apparatus | |
CN110766095A (en) | Defect detection method based on image gray level features | |
JP2000011089A (en) | Binarizing method for optical character recognition system | |
Louloudis et al. | Text line detection in unconstrained handwritten documents using a block-based Hough transform approach | |
CN115115637B (en) | Cloth defect detection method based on image pyramid thought | |
CN111027343A (en) | Bar code area positioning method and device | |
CN115184380A (en) | Printed circuit board welding spot abnormity detection method based on machine vision | |
CN111091071B (en) | Underground target detection method and system based on ground penetrating radar hyperbolic wave fitting | |
CN113989604A (en) | Tire DOT information identification method based on end-to-end deep learning | |
CN115239661A (en) | Mechanical part burr detection method and system based on image processing | |
JP3651037B2 (en) | Line segment detection method and apparatus | |
CN116596921B (en) | Method and system for sorting incinerator slag | |
CN106530292B (en) | A kind of steel strip surface defect image Fast Identification Method based on line scan camera | |
CN115619813A (en) | SEM image foreground extraction method and device, computer equipment and storage medium | |
CN115984639A (en) | Intelligent detection method for fatigue state of part | |
JP2946095B2 (en) | Line segment extraction device | |
JPH11219435A (en) | White line detector for automobile | |
JP3596055B2 (en) | Line segment detection method and device | |
Cung et al. | Multiscale edge detection and classification in range images | |
CN117373050B (en) | Method for identifying drawing pipeline with high precision | |
CN115063402B (en) | Cable foreign matter detection method, system, terminal and medium based on sliding analysis | |
Mahata et al. | Precision skew detection through principal axis | |
Johannesen et al. | Using weighted minutiae for fingerprint identification | |
JP4231476B2 (en) | An image processing method for collating an input image inputted with a printed matter or a sticker label of a container with a master image registered in advance |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20040805 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20041026 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20041222 |
|
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: 20050201 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050214 |
|
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: 20090304 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100304 Year of fee payment: 5 |
|
LAPS | Cancellation because of no payment of annual fees |