JPH04277876A - Method and device for vectorizing linear graphic - Google Patents

Method and device for vectorizing linear graphic

Info

Publication number
JPH04277876A
JPH04277876A JP3119540A JP11954091A JPH04277876A JP H04277876 A JPH04277876 A JP H04277876A JP 3119540 A JP3119540 A JP 3119540A JP 11954091 A JP11954091 A JP 11954091A JP H04277876 A JPH04277876 A JP H04277876A
Authority
JP
Japan
Prior art keywords
interest
point
main point
sub
contour information
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
JP3119540A
Other languages
Japanese (ja)
Other versions
JP2782977B2 (en
Inventor
Naoya Tanaka
直哉 田中
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 JP3119540A priority Critical patent/JP2782977B2/en
Publication of JPH04277876A publication Critical patent/JPH04277876A/en
Application granted granted Critical
Publication of JP2782977B2 publication Critical patent/JP2782977B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

PURPOSE:To obtain a enough result concerning accuracy as well while suppressing calculation cost low. CONSTITUTION:This device is provided with a main attention point detecting means 5 to sample a contour while moving forward on a contour information train obtained by trace, a sub attention point detecting means 6 to detect a point on the contour closest to the main attention point with a black picture element between as a sub attention point, a discriminating means 8 to discriminate whether a core line is extracted or the position of the main attention point is detected again by comparing a distance between the both attention points with a prescribed threshold value, a core line extracting means 10 to calculate a midpoint between the both attention points as a point expressing the core line based on the discriminated result and to store the point in a core line information storing means 11, and a main attention point estimating means 9 to predict the appearance of branched structure based on the discriminated result, to estimate a branch in a smoothly continuous direction from the extracted core line information and to newly set the main attention point.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、イメージスキャナ等で
量子化して得た線図形、例えば各種の設計図面のラスタ
データをベクトルデータに変換する線図形ベクトル化方
法および装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a line figure vectorization method and apparatus for converting line figures obtained by quantization using an image scanner or the like, such as raster data of various design drawings, into vector data.

【0002】0002

【従来の技術】従来、イメージスキャナ等で入力した図
面を入力して図形を短線分の集合で近似したベクトルデ
ータに変換する処理として、次に述べるようなさまざま
な方法が提案されている。
2. Description of the Related Art Conventionally, various methods as described below have been proposed as a process for inputting a drawing input using an image scanner or the like and converting the figure into vector data in which the figure is approximated by a set of short line segments.

【0003】第1の方法は、図形の細線化処理を用いて
得られた細線化画像を追跡してベクトルデータを生成す
る方法である。細線化処理はディジタル画像上で図形を
周辺の黒画素から1画素だけ内側に消去する操作を線幅
が1画素になるまで繰り返し行う処理である。線幅1の
線画像は容易に追跡することができるので、追跡時に近
似処理を施し、ベクトルデータを得ることができる。細
線化の代表的なアルゴリズムについては文献“Thin
ing  algrithms  onrectang
ular,  hexagonal  and  tr
iangular  arrays”(E.S.Deu
tsch,  C.ACM,vol.15,no.9,
1972,pp.827−837)等の中で述べられて
いる。
The first method is to generate vector data by tracing a thinned image obtained by thinning a figure. The thinning process is a process of repeatedly erasing a figure on a digital image by one pixel from the surrounding black pixels until the line width becomes one pixel. Since a line image with a line width of 1 can be easily traced, approximation processing can be performed during tracing to obtain vector data. For typical algorithms for thinning, see the document “Thin”.
ing algorithms on rectang
ular, hexagonal and tr
angular arrays” (E.S.Deu
tsch, C. ACM, vol. 15, no. 9,
1972, pp. 827-837) and others.

【0004】第2の方法として、ソフトウェア上での処
理速度を重視し、ディジタル画像上で図形の輪郭追跡を
行った後、輪郭画像を短線分近似したデータを利用する
方法がある。この短線分データでは、黒画素(図形部分
)を挟んで対向する短ベクトルペアが約180°の方向
差を持つという性質から短ベクトルペアを検出し、この
短ベクトルペアの中点位置を算出することにより、図形
の芯線検出を行う。この場合、輪郭の近似短線分集合か
ら黒画素を挟んで対向する短ベクトルペアを検索する処
理に極めて大きな演算を要するが、輪郭線近似短線分デ
ータをBD木を用いて管理することにより総当たりで検
索することを回避して、効率を高める方法が提案されて
いる。詳細には文献“多次元データ構造を用いた図面処
理”(大沢,坂内,電子通信学会論文集(D)J68−
D,No.4)に述べられている。
[0004] A second method is to place emphasis on processing speed on software, and after tracing the outline of a figure on a digital image, use data obtained by approximating the outline image with short line segments. In this short line segment data, short vector pairs are detected based on the property that pairs of short vectors that face each other with a black pixel (graphic part) in between have a direction difference of about 180 degrees, and the midpoint position of these short vector pairs is calculated. By doing this, the core lines of the figure are detected. In this case, extremely large calculations are required to search for a pair of short vectors facing each other across a black pixel from a set of approximate short line segments of the contour. A method has been proposed to improve efficiency by avoiding searching in . For details, refer to the document “Drawing processing using multidimensional data structures” (Osawa, Sakauchi, Proceedings of the Institute of Electronics and Communication Engineers (D) J68-
D.No. 4).

【0005】また、第3の方法として、図形の黒画素領
域をはみ出さない最大円弧を図形黒画素領域内で移動さ
せて中心点の軌跡を検出する方法が報告されている。こ
の方法に関しては精度が高いものの演算コストが極めて
大きいので、演算コスト低減のために最大円弧の代わり
に最大矩形を利用して同様な処理を行う方法が報告され
ている。
Furthermore, as a third method, a method has been reported in which the locus of the center point is detected by moving the largest circular arc that does not extend beyond the black pixel area of the figure within the black pixel area of the figure. Although this method has high accuracy, the calculation cost is extremely high, so a method has been reported in which similar processing is performed using the maximum rectangle instead of the maximum circular arc in order to reduce the calculation cost.

【0006】[0006]

【発明が解決しようとする課題】上記の従来方法として
第1の方法では、画像のラスタスキャンを、消去する画
素の層数だけ繰り返し行わなければならず、演算コスト
が膨大になり、実用的な時間で処理するためには専用ハ
ードウェアを必要とする上、細線化歪の影響で図形の角
が鈍り、鋭角なコーナー部分の構造が十分保存されない
という問題点がある。
[Problems to be Solved by the Invention] In the first conventional method described above, the raster scan of the image must be repeated as many times as the number of layers of pixels to be erased, resulting in an enormous calculation cost and making it impractical to use. In addition to requiring dedicated hardware to process in time, there is a problem in that the corners of the figure become blunt due to the effect of thinning distortion, and the structure of sharp corners is not sufficiently preserved.

【0007】また、第2の方法では、膨大な輪郭線近似
短ベクトルを基にしたペアベクトル探索の精度が十分で
ないという問題点がある。つまり、輪郭線近似短ベクト
ル間の距離と相互の方向関係のみを手がかりとする探索
では、局所的な輪郭線の凹凸が大きく影響し、特に複雑
な構造を有する画像において、ペアベクトル検出不可能
となる場合が多くなるのである。
Furthermore, the second method has a problem in that the accuracy of the pair vector search based on a huge number of contour line approximation short vectors is not sufficient. In other words, in a search that uses only the distance and mutual directional relationship between contour approximation short vectors as clues, the local unevenness of the contours has a large influence, and pair vectors may not be detected, especially in images with complex structures. This is often the case.

【0008】第3の方法は、第1,第2の方法に較べ、
高い精度が得られるが非常に大きな演算量を要する。こ
れは最大円を矩形にしても同様である。
[0008] Compared to the first and second methods, the third method has the following advantages:
Although high accuracy can be obtained, it requires a very large amount of calculation. This is the same even if the largest circle is a rectangle.

【0009】本発明の目的は、上記の問題を解決し、演
算量を比較的小さく抑えながらも高精度のベクトルデー
タを生成する線図形ベクトル化方式および装置を提供す
ることにある。
SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned problems and provide a line graphic vectorization method and device that generates highly accurate vector data while keeping the amount of calculations relatively small.

【0010】0010

【課題を解決するための手段】本発明は、線図形をイメ
ージスキャナ等で量子化して得た2値ラスタデータの白
画素と黒画素の境界を全て右回りあるいは全てその逆回
りに追跡して抽出した輪郭情報について、任意の輪郭画
素を主着目点とし、主着目点から図形を挟んで最短の距
離に位置する輪郭画素を副着目点とした時、主着目点を
移動しながら対応する副着目点を検索し、両着目点の中
間点を結ぶ曲線を芯線として検出する線図形ベクトル化
方法において、主着目点と副着目点との距離が所定値内
である時は、主着目点を前記輪郭情報のデータ並び順に
移動し、副着目点を前記輪郭情報のデータ並びと逆順に
移動することにより両着目点を検出し、前記両着目点間
の距離が所定値を超えた場合には、次に続く主着目点の
位置を、検出済みの芯線の近似多項式から推定して、推
定結果に基づいて新たな主着目点を検出することを特徴
とする。
[Means for Solving the Problems] The present invention traces all boundaries between white pixels and black pixels of binary raster data obtained by quantizing line figures using an image scanner or the like clockwise or vice versa. Regarding the extracted contour information, when an arbitrary contour pixel is set as the main point of interest and a contour pixel located at the shortest distance from the main point of interest across the figure is set as the sub-point of interest, the corresponding sub-point of interest is moved while moving the main point of interest. In a line figure vectorization method that searches for a point of interest and detects a curve connecting the midpoint of both points of interest as a core line, when the distance between the main point of interest and the sub-point of interest is within a predetermined value, the main point of interest is Both points of interest are detected by moving in the data order of the contour information and moving the sub-point of interest in the reverse order of the data order of the contour information, and if the distance between the two points of interest exceeds a predetermined value, , the position of the next main point of interest is estimated from the approximate polynomial of the detected core line, and a new main point of interest is detected based on the estimation result.

【0011】また本発明は、線図形をイメージスキャナ
等で量子化して得た2値ラスタデータの白画素と黒画素
の境界を全て右回りあるいは全てその逆回りに追跡して
抽出した輪郭情報について、任意の輪郭画素を主着目点
とし、主着目点から図形を挟んで最短の距離に位置する
輪郭画素を副着目点とした時、主着目点を移動しながら
対応する副着目点を検索し、両着目点の中間点を芯線と
して検出するように構成された線図形ベクトル化装置に
おいて、画像を入力して2値のラスタデータを得る画像
入力手段と、上記ラスタデータを記憶する画像記憶手段
と、ラスタデータから輪郭情報を検出する輪郭情報検出
手段と、検出した輪郭情報を記憶する輪郭情報記憶手段
と、輪郭情報から主着目点を輪郭情報のデータ並び順に
一定間隔で抽出する主着目点抽出手段と、対応する副着
目点を決定するために、前記輪郭情報記憶手段から一つ
前の副着目点を始点として前記輪郭情報のデータ並びと
逆順にデータを取り出し、距離算出手段を用いて両着目
点間の距離が最短となる点を検出する副着目点検出手段
と、得られた副着目点と対応する主着目点間の距離と所
定しきい値とを比較し、所定しきい値内であれば、処理
を芯線抽出手段へ移し、所定しきい値を超えていれば、
主着目点位置推定手段に処理を移す判定手段と、前記判
定手段の結果に従い、検出済み芯線から主着目点を推定
する主着目点推定手段と、判定手段の結果に従い、前記
両着目点間の中点を芯線上の点として抽出する芯線抽出
手段と、検出された芯線情報を記憶する芯線情報記憶手
段を備えることを特徴とする。
The present invention also provides contour information extracted by tracing all the boundaries between white pixels and black pixels of binary raster data obtained by quantizing a line figure using an image scanner or the like in a clockwise direction or in the opposite direction. , when an arbitrary contour pixel is set as the main point of interest and a contour pixel located at the shortest distance across the figure from the main point of interest is set as the sub-point of interest, the corresponding sub-point of interest is searched for while moving the main point of interest. , a line figure vectorization device configured to detect the midpoint between both points of interest as a core line, comprising an image input means for inputting an image to obtain binary raster data, and an image storage means for storing the raster data. , a contour information detection means for detecting contour information from raster data, a contour information storage means for storing the detected contour information, and a main point of interest for extracting the main points of interest from the contour information at regular intervals in the order in which the data of the contour information is arranged. In order to determine the extraction means and the corresponding sub-point of interest, data is extracted from the contour information storage means in the reverse order of the data arrangement of the contour information, starting from the previous sub-point of interest, and using the distance calculation means. A sub-point of interest detection means detects a point where the distance between both points of interest is the shortest, and a distance between the obtained sub-point of interest and the corresponding main point of interest is compared with a predetermined threshold value. If within, the process is transferred to skeleton extraction means, and if it exceeds a predetermined threshold,
a determining means for transferring the processing to the main point of interest position estimation means; a main point of interest estimating means for estimating the main point of interest from the detected core line according to the result of the determining means; The present invention is characterized by comprising skeleton extraction means for extracting midpoints as points on the skeleton, and skeleton information storage means for storing detected skeleton information.

【0012】0012

【実施例】請求項1の線図形ベクトル化方法について、
図を用いて説明する。図2、図3および図4は本発明の
作用を説明する図である。
[Example] Regarding the line figure vectorization method according to claim 1,
This will be explained using figures. FIGS. 2, 3, and 4 are diagrams for explaining the operation of the present invention.

【0013】本発明のラスタ−ベクトル変換では右回り
か左回りかのどちらかで全ての輪郭黒画素を追跡して得
た輪郭情報を利用する方法をとっているが、今、輪郭情
報が検出されているとして説明を行う。ここで述べてい
る輪郭情報とは輪郭画素の座標値とその画素の属する物
体のラベル値を追跡で検出された順に一列に並べた配列
データである。また、黒画素を挟んで最短距離を成す輪
郭上の2つの画素を、主着目点と副着目点と呼ぶ。この
両着目点の検出は、輪郭上をトレースしながら一定間隔
で主着目点を検出して行く過程で各主着目点に対応する
副着目点を順次検索すればできる。この方法では、この
時の処理を効率良く行う方法について述べる。両着目点
が検出できれば、それらの中点座標を算出することによ
り芯線データを抽出できる。以下、分岐点が現れない部
分に対する処理方法と、分岐点がある部分に対する処理
方法について順に説明する。 (分岐の無い部分での芯線化)副着目点を検索する処理
は一般に演算コストの非常にかかる処理であるが、分岐
構造の無い部分に対し、直接ラスタデータを参照せず、
輪郭情報のデータ並び順を利用して検索範囲を限定し、
演算コストを削減する。主着目点検出は、輪郭情報の配
列データの内容を順方向に一定間隔で読み出すことによ
り行う。また、副着目点検出は、一つ前の副着目点から
逆順に一定範囲内で座標値データを読み出し、対応する
主着目点との距離を算出し、最小値を取るデータを検出
することにより行う。
The raster-vector conversion of the present invention uses contour information obtained by tracking all contour black pixels in either a clockwise or counterclockwise direction. This will be explained as follows. The contour information mentioned here is array data in which the coordinate values of contour pixels and the label values of objects to which the pixels belong are arranged in a line in the order in which they are detected by tracking. Furthermore, two pixels on the contour that are the shortest distance apart with a black pixel in between are called a main point of interest and a sub-point of interest. These two points of interest can be detected by sequentially searching for sub-points of interest corresponding to each main point of interest while tracing the contour and detecting the main points of interest at regular intervals. In this method, a method for efficiently performing this process will be described. If both points of interest can be detected, skeleton data can be extracted by calculating the coordinates of their midpoint. Hereinafter, a processing method for a portion where a branch point does not appear and a processing method for a portion where a branch point exists will be explained in order. (Creating skeleton lines in areas with no branching) The process of searching for sub-points of interest is generally very computationally expensive; however, for areas without branching structures, it is possible to
Limit the search range by using the data arrangement order of contour information,
Reduce computational costs. The main point of interest is detected by reading out the contents of the array data of the contour information at regular intervals in the forward direction. In addition, sub-point of interest detection is performed by reading the coordinate value data within a certain range in reverse order from the previous sub-point of interest, calculating the distance to the corresponding main point of interest, and detecting the data that takes the minimum value. conduct.

【0014】以上の処理で具体的にどのようなデータが
抽出されるかを示すために図2を使って説明する。ここ
で、{a}は輪郭画素の集合であり、要素として座標値
a(x,y)をとる。また、図2で記号○で示される画
素は、輪郭画素、記号●で示される画素は輪郭画素の中
の主着目点、記号◎で示される画素は副着目点である。 記号×で示される点は検出された芯線通過位置を示す点
列である。aiは主着目点座標値であり、ajはこれに
対応する副着目点座標値である。上記輪郭情報において
aiはi番目のデータであり、ajはj番目のデータで
ある。図では、輪郭情報をデータ並び順に一定間隔T(
図ではT=4)で読み出して得られる主着目点の位置が
ai,ai+T,ai+2Tとして記されている。ここ
で、Tの値は入力図形および画像データの解像度に依存
して決まる値である。おおよそ平均線幅より若干長い値
を設定する。
[0014] In order to specifically show what kind of data is extracted in the above processing, a description will be given using FIG. 2. Here, {a} is a set of contour pixels, and takes a coordinate value a(x,y) as an element. Further, in FIG. 2, the pixels indicated by the symbol ○ are contour pixels, the pixels indicated by the symbol ● are the main points of interest among the contour pixels, and the pixels indicated by the symbol ◎ are the sub-points of interest. The points indicated by the symbol x are a sequence of points indicating the detected skeleton passing positions. ai is the coordinate value of the main point of interest, and aj is the coordinate value of the corresponding sub-point of interest. In the above contour information, ai is the i-th data, and aj is the j-th data. In the figure, contour information is arranged at regular intervals T (
In the figure, the positions of the main points of interest obtained by reading at T=4) are indicated as ai, ai+T, and ai+2T. Here, the value of T is a value determined depending on the resolution of the input figure and image data. Set a value that is approximately slightly longer than the average line width.

【0015】輪郭情報のi番目のデータから順にT間隔
でデータを読み出し、主着目点座標値ai,ai+T,
ai+2Tを検出した時、それぞれ対応する副着目点は
、輪郭情報データ並びの逆順に以下の条件で検索される
。 〈検索条件〉aiからk番目の副着目点は、以下の式で
示される範囲内で最小距離dkをとる点である。
Data is read out in order from the i-th data of the contour information at intervals of T, and the coordinate values of the main point of interest ai, ai+T,
When ai+2T is detected, the corresponding sub-points of interest are searched in the reverse order of the outline information data arrangement under the following conditions. <Search Conditions> The kth sub-point of interest from ai is a point that takes the minimum distance dk within the range shown by the following formula.

【0016】[0016]

【数1】[Math 1]

【0017】[0017]

【0018】ただし、aiとajの座標値をそれぞれ(
xai,yai)、(xaj,yaj)とした時、
However, if the coordinate values of ai and aj are respectively (
xai, yai), (xaj, yaj),

【数
2】
[Math 2]

【0019】[0019]

【0020】である。aj−mkは輪郭情報でajから
mk個遡ったデータである。
[0020] aj-mk is contour information and is data that is traced back mk times from aj.

【0021】分岐等の構造が現れない区間で、つまり図
2では3組の主着目点と副着目点が順次検出されている
In the section where structures such as branches do not appear, that is, in FIG. 2, three sets of main points of interest and sub-points of interest are sequentially detected.

【0022】芯線を表す点列は以下の数3で算出する。[0022] The sequence of points representing the core line is calculated using Equation 3 below.

【0023】[0023]

【数3】[Math 3]

【0024】[0024]

【0025】ただし、図2ではk=0,1,2をとる。However, in FIG. 2, k=0, 1, and 2.

【0026】以上の方法により、分岐構造の無い部分に
おいては輪郭追跡結果の情報(輪郭情報)のデータ並び
順を利用して、少ない候補を対象とする距離計算(数1
)と中点位置計算(数3)のみで芯線抽出が可能である
。 (分岐のある部分での芯線化)次に、分岐のある部分に
対する処理について説明する。数1の値dkが所定のし
きい値Dを越えた場合には、それまでに抽出した芯線を
表す点列から近似曲線を求め、これを基に次の検索方向
を決定することが可能である。これにより、分岐構造が
あってもそれまで抽出した芯線が滑らかにつながる方向
に芯線抽出を続けて行うことができる。図2,図3およ
び図4を利用して具体的に説明する。
By the above method, distance calculation (Equation 1
) and midpoint position calculation (Equation 3), skeleton lines can be extracted only. (Creating a core line in a part with a branch) Next, processing for a part with a branch will be explained. When the value dk in Equation 1 exceeds a predetermined threshold value D, it is possible to obtain an approximate curve from the sequence of points representing the core line extracted so far and determine the next search direction based on this. be. Thereby, even if there is a branch structure, skeleton extraction can be continued in the direction in which the skeletons extracted so far are smoothly connected. This will be explained in detail using FIGS. 2, 3, and 4.

【0027】今、芯線を表す点列f0,f1,f2が抽
出済みであるとする。Dを予め経験的に定めたしきい値
であるとすると、数1が
Assume now that a sequence of points f0, f1, f2 representing skeleton lines has been extracted. If D is a predetermined threshold value, then equation 1 becomes

【数4】[Math 4]

【0028】[0028]

【0029】を満たせばk番目の中点は分岐点にさしか
かっていると判定できる。図2で、k=3の時、数4が
満たされたとする。抽出済み点列fk、k={0,1,
2}の近似曲線
If the following is satisfied, it can be determined that the kth midpoint approaches a branch point. In FIG. 2, it is assumed that Equation 4 is satisfied when k=3. Extracted point sequence fk, k={0,1,
2} approximate curve

【数5】[Math 5]

【0030】[0030]

【0031】を最小2乗近似により求め、これを推定芯
線Fとする(図3参照)。
##EQU1## is determined by least squares approximation, and this is defined as the estimated core line F (see FIG. 3).

【0032】次に、近似曲線Fがf2の先で輪郭画素と
交わる点を検出し、検出輪郭画素の輪郭情報データ中で
の位置を求め、分岐の無い部分での芯線化処理に従い、
芯線を表す2点
Next, the point where the approximate curve F intersects with the contour pixel at the end of f2 is detected, the position of the detected contour pixel in the contour information data is determined, and according to the core line processing in the part where there is no branch,
Two points representing the core line

【数6】[Math 6]

【0033】[0033]

【0034】を算出する。これは、仮の芯線であるが、
検証のためにこの2点を結ぶ線分をベクトルとみなし以
下の処理を行う。
Calculate . This is a temporary core wire,
For verification purposes, the line segment connecting these two points is regarded as a vector, and the following processing is performed.

【0035】図3の推定芯線F上で、On the estimated core line F in FIG.

【数7】[Math 7]

【0036】[0036]

【0037】をとり、Take [0037],

【数8】[Math. 8]

【0038】[0038]

【0039】と仮の主着目点より抽出した[0039] was extracted from the tentative main point of interest.

【数9】[Math. 9]

【0040】[0040]

【0041】が以下の条件式(数10)を満たすかどう
かを調べる。
It is checked whether [0041] satisfies the following conditional expression (Equation 10).

【0042】[0042]

【数10】[Math. 10]

【0043】[0043]

【0044】ただし、θTは値0.5程度のしきい値で
ある。条件式(数10)が満たされない場合は、主着目
点と副着目点との交換、近傍の別の輪郭画素への仮の主
着目点移動等を行い、条件を満たす点を検索する。条件
式が満たされる場合は、仮の主着目点および芯線情報を
正式なデータと見なして芯線抽出処理を続ける。図3の
例では芯線画素列が図4のように検出できる。
However, θT is a threshold value of about 0.5. If the conditional expression (Equation 10) is not satisfied, a point that satisfies the condition is searched for by exchanging the main point of interest with the sub-point of interest, temporarily moving the main point of interest to another nearby contour pixel, etc. If the conditional expression is satisfied, the temporary main point of interest and skeleton information are regarded as formal data, and skeleton extraction processing continues. In the example of FIG. 3, skeleton pixel arrays can be detected as shown in FIG.

【0045】以上の方法により、線図形中で分岐構造の
無い部分では、輪郭抽出処理で得られた輪郭情報データ
のデータ並び順を利用して、少ない候補に対する距離計
算のみで芯線抽出が可能である。また、分岐構造部分で
は、交差する線分を越えて滑らかに連続する方向に線抽
出が可能である。よって、従来方法で問題となる処理速
度と芯線抽出精度の点において、両者のバランスの良い
線図形ベクトル化方式およびその装置を提供することが
できる。
[0045] With the above method, in a part of a line figure that does not have a branching structure, core lines can be extracted by using the data arrangement order of the contour information data obtained in the contour extraction process and only by calculating distances for a small number of candidates. be. Furthermore, in the branch structure portion, it is possible to extract lines in a direction that continues smoothly beyond the intersecting line segments. Therefore, in terms of processing speed and core line extraction accuracy, which are problems in conventional methods, it is possible to provide a line figure vectorization method and an apparatus therefor that have a good balance between the two.

【0046】次に、請求項2の線図形ベクトル化装置の
実施例について図を用いて説明する。図1は線図形ベク
トル化装置の一実施例を示す図である。
Next, an embodiment of the line graphic vectorization apparatus according to the second aspect will be described with reference to the drawings. FIG. 1 is a diagram showing an embodiment of a line graphic vectorization device.

【0047】この線図形ベクトル化装置は、画像入力手
段1,画像記憶手段2,輪郭情報検出手段3,輪郭情報
記憶手段4,主着目点抽出手段5,副着目点検出手段6
,距離算出手段7,判定手段8,主着目点位置推定手段
9,芯線抽出手段10,芯線情報記憶手段11により構
成されている。
This line figure vectorization device includes an image input means 1, an image storage means 2, a contour information detection means 3, a contour information storage means 4, a main point of interest extraction means 5, and a sub point of interest detection means 6.
, a distance calculation means 7, a determination means 8, a main point of interest position estimation means 9, a skeleton extraction means 10, and a skeleton information storage means 11.

【0048】画像入力手段1は、紙面の線図形を読み取
って2値ラスタデータに変換する。紙面に光を照射し、
反射光を1次元CCDアレイ素子で光電変換し、A/D
コンバータで変換することによりディジタルデータを得
る構成をとる。ディジタルデータは、さらにコンパレー
タ等により適当なしきい値で2値化する。CCDアレイ
素子の機械走査により、2次元のラスタデータを得るこ
とができる構成になっている。得られたデータは画像記
憶手段2へ送られて保存される。
The image input means 1 reads line figures on paper and converts them into binary raster data. Shine light onto the paper,
The reflected light is photoelectrically converted by a one-dimensional CCD array element, and A/D
It is configured to obtain digital data by converting it with a converter. The digital data is further binarized using a comparator or the like using an appropriate threshold. The configuration is such that two-dimensional raster data can be obtained by mechanical scanning of the CCD array element. The obtained data is sent to the image storage means 2 and stored.

【0049】画像記憶手段2は、画像入力手段1で得た
2値ラスタデータを記憶する。画像記憶手段は、メモリ
により構成される。
The image storage means 2 stores the binary raster data obtained by the image input means 1. The image storage means is constituted by a memory.

【0050】輪郭情報検出手段3は、画像記憶手段2か
らラスタデータを読み取り、横,縦方向にスキャンを行
い、白画素から黒画素あるいは黒画素から白画素へ変化
する位置の黒画素を開始点として、右回りあるいは左回
りに黒画素を追跡して輪郭情報を検出する。ここで、輪
郭情報とは物体単位でラベル付けされた輪郭画素の座標
値列である。CPUおよび図5で示される処理手順を有
するプログラムメモリおよび、ワークメモリ等により構
成できる。図5の処理手順を論理素子により構成するこ
とも可能である。輪郭情報は輪郭情報記憶手段4に書き
込まれる。
The contour information detection means 3 reads the raster data from the image storage means 2, scans it in the horizontal and vertical directions, and sets the black pixel at the position where the white pixel changes from a white pixel to a black pixel or from a black pixel to a white pixel as a starting point. , black pixels are tracked clockwise or counterclockwise to detect contour information. Here, the contour information is a sequence of coordinate values of contour pixels labeled for each object. It can be configured by a CPU, a program memory having the processing procedure shown in FIG. 5, a work memory, and the like. It is also possible to configure the processing procedure of FIG. 5 using logic elements. The contour information is written into the contour information storage means 4.

【0051】輪郭情報記憶手段4は、輪郭情報検出手段
3で得られた輪郭情報を記憶する。輪郭情報記憶手段は
、メモリによって構成される。
The contour information storage means 4 stores the contour information obtained by the contour information detection means 3. The contour information storage means is constituted by a memory.

【0052】主着目点抽出手段5は、輪郭情報から主着
目点を抽出する。輪郭情報記憶手段4へのアクセス回路
を有し、その中で主着目点を検出し、そのデータの記憶
されるアドレスを出力する機能を持つ。処理の詳細につ
いては、請求項1の実施例の通りである。CPUと処理
手順を記憶したプログラムメモリとワークメモリを中心
とした回路として構成される。
The main point of interest extraction means 5 extracts the main point of interest from the contour information. It has an access circuit to the contour information storage means 4, and has a function of detecting the main point of interest therein and outputting the address where the data is stored. The details of the processing are as in the embodiment of claim 1. It is configured as a circuit centered around a CPU, a program memory that stores processing procedures, and a work memory.

【0053】副着目点検出手段6は、主着目点と図形を
挟んで存在する輪郭画素の中で最も近い距離にあるもの
を検出する。主着目点検出手段5から、主着目点のデー
タアドレスを受取り、これをもとに輪郭情報における座
標データ参照し、副着目点を求める機能を有する。最小
距離をとる画素の座標値が記憶されるデータアドレスお
よび検出距離値を出力する。処理手順の詳細については
請求項1の実施例に基づく。CPUおよび上記処理手順
を記憶したプログラムメモリ,ワークメモリ等から構成
される。
The sub-point-of-interest detection means 6 detects the closest contour pixel between the main point of interest and the figure. It has a function of receiving the data address of the main point of interest from the main point of interest detection means 5, and based on this, referring to the coordinate data in the contour information to find the sub-point of interest. A data address where the coordinate value of the pixel having the minimum distance is stored and a detected distance value are output. Details of the processing procedure are based on the embodiment of claim 1. It consists of a CPU, a program memory that stores the above processing procedures, a work memory, etc.

【0054】距離算出手段7は、主着目点と副着目点間
の距離を算出する。副着目点検出手段6から比較する2
つの画素の座標値を受取り、距離計算をして値を返す機
能を有する。ALU等により構成される。
The distance calculating means 7 calculates the distance between the main point of interest and the sub-point of interest. Comparison from sub-point of interest detection means 6 2
It has the function of receiving the coordinate values of two pixels, calculating the distance, and returning the value. It is composed of ALU, etc.

【0055】判定手段8は、副着目点検出手段6で得ら
れた副着目点と対応する主着目点間の距離値をしきい値
と比較して、正しい対応点であるかどうかを判定する。 副着目点検出手段6から主着目点と副着目点間の距離値
を受取って記憶するレジスタを有する。また、請求項1
の実施例で述べたしきいD値を記憶するレジスタを有し
、両レジスタ値を比較するコンパレータと、コンパレー
タの出力により、主着目点位置推定手段9と芯線抽出手
段10のどちらかに処理を移す制御回路を有する。交差
して存在する線分が存在した場合でも影響を受けずに滑
らかに連続する一本の直線方向に芯線を抽出するために
必要な手段である。
The determining means 8 compares the distance value between the secondary point of interest obtained by the secondary point of interest detection means 6 and the corresponding main point of interest with a threshold value, and determines whether or not they are correct corresponding points. . It has a register that receives and stores the distance value between the main point of interest and the sub-point of interest from the sub-point of interest detection means 6. Also, claim 1
It has a register for storing the threshold D value mentioned in the embodiment, a comparator for comparing both register values, and a process is performed on either the main point of interest position estimating means 9 or the skeleton extracting means 10 according to the output of the comparator. It has a control circuit that moves. This is a necessary means for extracting core lines in a smoothly continuous straight line direction without being affected even if there are line segments that intersect.

【0056】主着目点位置推定手段9は、判定手段8に
より起動され、主着目点抽出手段5をアクセスして次の
主着目点位置を推定する機能を有する。この手段の詳細
な処理内容は請求項1の実施例で述べられている通りで
あるが、CPUおよび上記処理手順を記憶したプログラ
ムメモリ,ワークメモリ等から構成される。
The main point of interest position estimating means 9 is activated by the determining means 8 and has a function of accessing the main point of interest extraction means 5 and estimating the next position of the main point of interest. The detailed processing content of this means is as described in the embodiment of claim 1, and is composed of a CPU, a program memory storing the above processing procedure, a work memory, etc.

【0057】芯線抽出手段10も、判定手段8により起
動され、芯線の通る点の座標値を計算する。この処理は
主着目点と副着目点の中点を算出する。詳細に付いては
請求項1の記述の通りである。座標値を記憶するレジス
タおよびALUから構成される。
The skeleton extraction means 10 is also activated by the determination means 8 and calculates the coordinate values of the points through which the skeleton passes. This process calculates the midpoint between the main point of interest and the sub-point of interest. The details are as described in claim 1. It consists of a register that stores coordinate values and an ALU.

【0058】芯線情報記憶手段11は、芯線抽出手段1
0で算出された芯線情報を記憶するメモリで構成される
The skeleton information storage means 11 includes the skeleton extraction means 1
It is composed of a memory that stores skeleton information calculated as 0.

【0059】以上の構成によりシステムを実現できる。A system can be realized with the above configuration.

【0060】[0060]

【発明の効果】本発明によれば、線図形中で分岐構造の
無い部分では、輪郭抽出処理で得られた輪郭情報データ
のデータ並び順を利用して、少ない候補に対する距離計
算のみで芯線抽出が可能である。また、分岐構造部分で
は、交差する線分を越えて滑らかに連続する方向に芯線
抽出が可能である。よって、従来方法で問題となる処理
コストと芯線抽出精度の問題点において、ソフトウェア
処理でも十分可能な演算コスト内で、実用上十分な精度
を保つことから、両者のバランスのとれた線図形ベクト
ル化方式およびその装置を提供することができる。
According to the present invention, in a part of a line figure that does not have a branching structure, core lines can be extracted by only calculating distances for a small number of candidates by using the data arrangement order of contour information data obtained in contour extraction processing. is possible. Furthermore, in the branch structure portion, core lines can be extracted in a smoothly continuous direction beyond the intersecting line segments. Therefore, with regard to the problems of processing cost and core line extraction accuracy that are problems with conventional methods, software processing can maintain sufficient accuracy for practical use within the computation cost, making it possible to convert line figures into vectors with a good balance between the two. A method and an apparatus thereof can be provided.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明の線図形ベクトル化装置の一実施例を示
す機能ブロック図である。
FIG. 1 is a functional block diagram showing an embodiment of a line graphic vectorization device of the present invention.

【図2】線図形ベクトル化方式を説明するための図であ
る。
FIG. 2 is a diagram for explaining a line graphic vectorization method.

【図3】線図形ベクトル化方式を説明するための図であ
る。
FIG. 3 is a diagram for explaining a line graphic vectorization method.

【図4】線図形ベクトル化方式を説明するための図であ
る。
FIG. 4 is a diagram for explaining a line graphic vectorization method.

【図5】輪郭情報検出の処理手順を示すフローチャート
である。
FIG. 5 is a flowchart showing a processing procedure for detecting contour information.

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

1  画像入力手段 2  画像記憶手段 3  輪郭情報検出手段 4  輪郭情報記憶手段 5  主着目点抽出手段 6  副着目点検出手段 7  距離算出手段 8  判定手段 9  主着目点位置推定手段 10  芯線抽出手段 11  芯線情報記憶手段 1 Image input means 2 Image storage means 3 Contour information detection means 4 Contour information storage means 5 Main point of interest extraction means 6 Sub-point of interest detection means 7 Distance calculation means 8 Judgment means 9 Main point of interest position estimation means 10 Core wire extraction means 11 Core wire information storage means

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】線図形をイメージスキャナ等で量子化して
得た2値ラスタデータの白画素と黒画素の境界を全て右
回りあるいは全てその逆回りに追跡して抽出した輪郭情
報について、任意の輪郭画素を主着目点とし、主着目点
から図形を挟んで最短の距離に位置する輪郭画素を副着
目点とした時、主着目点を移動しながら対応する副着目
点を検索し、両着目点の中間点を結ぶ曲線を芯線として
検出する線図形ベクトル化方法において、主着目点と副
着目点との距離が所定値内である時は、主着目点を前記
輪郭情報のデータ並び順に移動し、副着目点を前記輪郭
情報のデータ並びと逆順に移動することにより両着目点
を検出し、前記両着目点間の距離が所定値を超えた場合
には、次に続く主着目点の位置を、検出済みの芯線の近
似多項式から推定して、推定結果に基づいて新たな主着
目点を検出することを特徴とする線図形ベクトル化方法
Claim 1: Concerning contour information extracted by tracing all the boundaries between white pixels and black pixels of binary raster data obtained by quantizing a line figure with an image scanner or the like in a clockwise direction or in the opposite direction, arbitrary information can be obtained. When the outline pixel is the main point of interest and the outline pixel located at the shortest distance across the figure from the main point of interest is the sub-point of interest, the corresponding sub-point of interest is searched while moving the main point of interest, and both points of interest are In a line figure vectorization method that detects a curve connecting midpoints of points as a core line, when the distance between the main point of interest and the sub-point of interest is within a predetermined value, the main point of interest is moved in the data arrangement order of the contour information. Then, both points of interest are detected by moving the sub-point of interest in the reverse order of the data arrangement of the contour information, and if the distance between the two points of interest exceeds a predetermined value, the next main point of interest is detected. A line figure vectorization method characterized by estimating a position from an approximate polynomial of a detected core line and detecting a new main point of interest based on the estimation result.
【請求項2】線図形をイメージスキャナ等で量子化して
得た2値ラスタデータの白画素と黒画素の境界を全て右
回りあるいは全てその逆回りに追跡して抽出した輪郭情
報について、任意の輪郭画素を主着目点とし、主着目点
から図形を挟んで最短の距離に位置する輪郭画素を副着
目点とした時、主着目点を移動しながら対応する副着目
点を検索し、両着目点の中間点を芯線として検出するよ
うに構成された線図形ベクトル化装置において、画像を
入力して2値のラスタデータを得る画像入力手段と、上
記ラスタデータを記憶する画像記憶手段と、ラスタデー
タから輪郭情報を検出する輪郭情報検出手段と、検出し
た輪郭情報を記憶する輪郭情報記憶手段と、輪郭情報か
ら主着目点を輪郭情報のデータ並び順に一定間隔で抽出
する主着目点抽出手段と、対応する副着目点を決定する
ために、前記輪郭情報記憶手段から一つ前の副着目点を
始点として前記輪郭情報のデータ並びと逆順にデータを
取り出し、距離算出手段を用いて両着目点間の距離が最
短となる点を検出する副着目点検出手段と、得られた副
着目点と対応する主着目点間の距離と所定しきい値とを
比較し、所定しきい値内であれば、処理を芯線抽出手段
へ移し、所定しきい値を超えていれば、主着目点位置推
定手段に処理を移す判定手段と、前記判定手段の結果に
従い、検出済み芯線から主着目点を推定する主着目点推
定手段と、判定手段の結果に従い、前記両着目点間の中
点を芯線上の点として抽出する芯線抽出手段と、検出さ
れた芯線情報を記憶する芯線情報記憶手段を備えること
を特徴とする線図形ベクトル化装置。
Claim 2: Any contour information extracted by tracing the boundaries between white pixels and black pixels of binary raster data obtained by quantizing line figures using an image scanner or the like in a clockwise or reverse direction. When the outline pixel is the main point of interest and the outline pixel located at the shortest distance across the figure from the main point of interest is the sub-point of interest, the corresponding sub-point of interest is searched while moving the main point of interest, and both points of interest are A line figure vectorization device configured to detect midpoints of points as skeleton lines includes an image input means for inputting an image to obtain binary raster data, an image storage means for storing the raster data, and a raster A contour information detection means for detecting contour information from data, a contour information storage means for storing the detected contour information, and a main point of interest extraction means for extracting the main points of interest from the contour information at regular intervals in the order in which the data of the contour information is arranged. In order to determine the corresponding sub-point of interest, data is retrieved from the contour information storage means in the reverse order of the data arrangement of the contour information, starting from the previous sub-point of interest, and the distance calculation means is used to calculate both points of interest. A sub-point of interest detecting means detects a point where the distance between them is the shortest, and a distance between the obtained sub-point of interest and the corresponding main point of interest is compared with a predetermined threshold, and if the distance is within the predetermined threshold. For example, a determination means that transfers the processing to the skeleton extraction means, and if it exceeds a predetermined threshold value, transfers the processing to the main point of interest position estimation means, and a determination means that estimates the main point of interest from the detected skeleton according to the result of the determination means. a main point of interest estimating means for estimating a main point of interest; a skeleton extracting means for extracting a midpoint between the two points of interest as a point on a skeleton according to the result of the determining means; and a skeleton information storage means for storing detected skeleton information. A line figure vectorization device featuring:
JP3119540A 1991-03-05 1991-03-05 Line figure vectorization method and apparatus Expired - Fee Related JP2782977B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3119540A JP2782977B2 (en) 1991-03-05 1991-03-05 Line figure vectorization method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3119540A JP2782977B2 (en) 1991-03-05 1991-03-05 Line figure vectorization method and apparatus

Publications (2)

Publication Number Publication Date
JPH04277876A true JPH04277876A (en) 1992-10-02
JP2782977B2 JP2782977B2 (en) 1998-08-06

Family

ID=14763821

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3119540A Expired - Fee Related JP2782977B2 (en) 1991-03-05 1991-03-05 Line figure vectorization method and apparatus

Country Status (1)

Country Link
JP (1) JP2782977B2 (en)

Also Published As

Publication number Publication date
JP2782977B2 (en) 1998-08-06

Similar Documents

Publication Publication Date Title
Bailey An efficient euclidean distance transform
US5245674A (en) Image processing using distance as a function of direction
JP2915894B2 (en) Target tracking method and device
AU2012344005A1 (en) Method and device for following an object in a sequence of at least two images
CN113793370A (en) Three-dimensional point cloud registration method and device, electronic equipment and readable medium
Cho et al. Fast color fiducial detection and dynamic workspace extension in video see-through self-tracking augmented reality
IL123566A (en) Detecting of relief contours in a pair of stereoscopic images
CN113033233A (en) Positioning method and device of geometric deformation QR (quick response) code and storage medium
Carmichael et al. Unconstrained registration of large 3D point sets for complex model building
JPH04277876A (en) Method and device for vectorizing linear graphic
Park et al. Image corner detection using radon transform
Zhang et al. A stereo matching algorithm based on multiresolution and epipolar constraint
CN116863176B (en) Image template matching method for digital intelligent manufacturing
Wang Design and Implementation of Artificial Intelligence Image Detection System Based on Plane Features
CN118397257B (en) SAR image ship target detection method and device, electronic equipment and storage medium
Einizinab et al. Global localization for Mixed Reality visualization using wireframe extraction from images
Benoit et al. Towards direct recovery of shape and motion parameters from image sequences
JPH02264373A (en) Graphic recognizing device
JP2650443B2 (en) Line figure vectorization method
JP2620094B2 (en) How to measure figure patterns
KR20230057944A (en) Method and computing device for apparatus for global localization of mobile robots
Beaulieu et al. Segmentation of range images by piecewise approximation with shape constraints
CN110334372A (en) A kind of BIM augmented reality emulation mode based on drawing registration
Tefera et al. Geometrical approach for corner detection
Miyatake Extraction of roads from topological maps using a parallel extraction algorithm

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees