JPH0250278A - Closed loop graphic detecting device - Google Patents
Closed loop graphic detecting deviceInfo
- Publication number
- JPH0250278A JPH0250278A JP63200357A JP20035788A JPH0250278A JP H0250278 A JPH0250278 A JP H0250278A JP 63200357 A JP63200357 A JP 63200357A JP 20035788 A JP20035788 A JP 20035788A JP H0250278 A JPH0250278 A JP H0250278A
- Authority
- JP
- Japan
- Prior art keywords
- segment
- point
- pattern
- end point
- loop
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 claims description 66
- 238000000605 extraction Methods 0.000 claims description 52
- 238000001514 detection method Methods 0.000 claims description 32
- 239000000470 constituent Substances 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 24
- 230000015654 memory Effects 0.000 description 24
- 239000000284 extract Substances 0.000 description 13
- 230000014509 gene expression Effects 0.000 description 7
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000007704 transition Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
この発明は文字図形の認識例えば論理回路図等の図面に
記載された文字図形の認識において閉ループ図形を検出
するための装置に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to an apparatus for detecting closed-loop figures in the recognition of characters and figures, for example, characters and figures depicted in drawings such as logic circuit diagrams.
(従来の技術)
従来の閉ループ図形検出装置における閉ループ検出処理
では、図面等の情報媒体の2値画像を線の巾が1となる
ように細線化することによって、細線化画像を作成する
。そして線幅1の線を所定の条件に従ってセグメントI
こ分割し各セグメント毎にセグメントの位置、長さ、角
度、連結性等の情報から成るベクトルデータを抽出する
(細線化画像のベクトルデータへの変換)。(Prior Art) In closed-loop detection processing in a conventional closed-loop figure detection device, a thinned image is created by thinning a binary image of an information medium such as a drawing so that the line width is 1. Then, a line with a line width of 1 is divided into segments I according to predetermined conditions.
For each segment, vector data consisting of information such as the position, length, angle, connectivity, etc. of the segment is extracted (conversion of the thinned image to vector data).
そして抽出されたベクトルデータに基づきセグメントの
線種(線種としでは例えば水平方向、垂直方向或は斜め
方向のM線や、円或は円弧や、楕円或は楕円弧等を挙げ
ることが出来る)の認識を行ない、さらにセグメント相
互のw4接関係から閉ループを構成するセグメントを検
出しく閉ループの検出)、閉ループを構成するセグメン
トの線種から閉ループの形状を判定していた。Then, based on the extracted vector data, the line type of the segment (for example, the line type can be a horizontal, vertical or diagonal M-line, a circle or arc, an ellipse or an elliptical arc, etc.) recognition is performed, and the segments constituting a closed loop are detected from the w4 tangent relationship between the segments (closed loop detection), and the shape of the closed loop is determined from the line types of the segments constituting the closed loop.
(発明が解決しようとする課題)
しかしなから上述した従来装置における閉ループ検出処
理では、閉ループ検出のために2−値画像の細線化を行
なう0図面等で用いられるシンボルの中には直線部と曲
線部との接合部を有するシンボルや、分岐或は交差を有
するシンボルもあるが、これら接合部、分岐及び交差は
細線化処理によって歪みやすく、特に接合部、分岐或は
交差を多く有するシンボルではシンボルの形状がはなは
だしく歪められることもあるので、歪みを補正するため
の処理も必要となる。この歪みの補正処理は・複雑な処
理でありまた処理時間も長くなり、従って補正処理のた
めに閉ループ検出処理の高速化が図れないという問題点
があった。また補正処理を行なうための手段を設けるこ
と1こよって製画構成が複雑化するという問題点があっ
た。(Problem to be Solved by the Invention) However, in the closed-loop detection processing in the conventional device described above, some symbols used in drawings, etc., which thin the binary image for closed-loop detection, have straight parts. There are symbols that have joints with curved parts, and symbols that have branches or intersections, but these joints, branches, and intersections are easily distorted by line thinning, especially in symbols that have many joints, branches, or intersections. Since the shape of the symbol may be severely distorted, processing to correct the distortion is also required. This distortion correction process is a complicated process and requires a long processing time, so there is a problem in that the speed of the closed loop detection process cannot be increased due to the correction process. Furthermore, there is a problem in that the provision of means for performing correction processing complicates the image production structure.
ざらイこ上述した従来装置における閉ループ検出処理で
は、各セグメント毎lこ検出された大量のベクトルデー
タを一次元的にすなわち検出されたセグメントの順に並
べで記憶する。そして、セグメントの線種を認識する処
理やセグメント相互の隣Wi関係を調べる処理を行なう
際には、位置、長さ、角度、連結性等の情報のなかから
それぞれの処理に必要な情報を検索するため、これら−
次元的に並べられた大量のベクトルデータを逐一読出す
、そして検索した情報に基づいて線種を認識し或はll
I禮閉係を調べていた。従って大量のべりトルデータを
逐一読出すことによって必要な情報を検索するので、デ
ータ処理量が多くなり、よって処理時間が長くなるとい
う問題点があった。In the closed-loop detection process in the conventional apparatus described above, a large amount of vector data detected for each segment is stored one-dimensionally, that is, in the order of the detected segments. When performing processing to recognize the line type of segments or to investigate the adjacent Wi relationship between segments, the information necessary for each process is searched from information such as position, length, angle, connectivity, etc. In order to do these −
Read out a large amount of dimensionally arranged vector data one by one, and recognize the line type based on the retrieved information.
I was investigating the closing clerk. Therefore, since the necessary information is retrieved by reading out a large amount of detailed data one by one, there is a problem that the amount of data to be processed increases, and therefore the processing time increases.
この発明の目的は上述した従来の問題点を解決するため
、従来よりも単純な処理及び構成で閉ループを検出しま
た閉ループ検出処理に用いる情報を従来よりも低減出来
る閉ループ図形検出装置を提供することにある。SUMMARY OF THE INVENTION In order to solve the above-mentioned conventional problems, it is an object of the present invention to provide a closed-loop figure detection device that can detect closed loops with simpler processing and configuration than conventional ones, and can reduce the amount of information used for closed-loop detection processing compared to conventional ones. It is in.
(課題を解決するための手段)
この目的の達成を図るため、この発明の閉ループ図形検
出装置は、
少なくとも閉ループ図形を含む情報媒体を光電変換し、
かつ量子化することにより黒ビット及び白ビットで表さ
れるディジタル信号の環パタンを作成し、この環パタン
を所定の複数の方向に走査し、それぞれの走査方向のス
トローク成分をサブパタンとして抽出するサブパタン抽
出手段と、サブパタン抽出時の走査方向におけるサブパ
タンの始端点及び終端点の座標を抽出するセグメント抽
出手段と、
サブパタンの始端点及び終端点を結ぶ線分を当該サブパ
タンを表すセグメントとし、このセグメントのなかから
閉ループ図形を構成する起点セグメント、所定個数の中
間セグメント及び終点セグメントを順次に検索するため
、検索されたセグメントの端点の近傍領域内に端点を有
するセグメントを順次に検索する閉ループセグメント検
索手段とを備えて成ることを特徴とする。(Means for Solving the Problems) In order to achieve this object, the closed loop figure detection device of the present invention photoelectrically converts an information medium containing at least a closed loop figure,
A sub-pattern that creates a ring pattern of a digital signal represented by black bits and white bits by quantizing it, scans this ring pattern in a plurality of predetermined directions, and extracts stroke components in each scanning direction as a sub-pattern. an extraction means; a segment extraction means for extracting the coordinates of the starting point and ending point of the subpattern in the scanning direction when extracting the subpattern; A closed-loop segment search means for sequentially searching for segments having endpoints within a region near the endpoints of the searched segments in order to sequentially search for a starting point segment, a predetermined number of intermediate segments, and an endpoint segment constituting a closed-loop figure. It is characterized by comprising the following.
この発明の実施に当っては、サブパタンを、サブパタン
抽出時の走査方向に連続する図形構成画素から成る画素
群であってこの連続の長さlが所定の長さとなる画素群
によって構成されるストローク成分とするのが好適であ
る。この場合、サブパタンを、連続の長さlが!≧Nw
(但し、Nは定数及びWは環パタンにおける線巾)とな
る図形構成画素群によって構成されるストローク成分と
するのがさらに好適である。In carrying out the present invention, a subpattern is defined as a pixel group consisting of continuous figure constituent pixels in the scanning direction at the time of subpattern extraction, and the continuous length l is a predetermined length. Preferably, it is a component. In this case, the subpattern has a continuous length l! ≧Nw
(However, N is a constant and W is the line width in the ring pattern.) It is more preferable to use a stroke component constituted by a group of figure constituent pixels.
またこの発明の実施に当っては、セグメント抽出手段を
、サブパタン抽出−時の走査方向と所定の角度を成す方
向にサブパタンを走査し、各走査列毎に得る白ビットか
ら黒ビットへの変化点の座標位置及びその個数、並びに
黒ビットから白ビットへの変化点の座標位置及びその個
数とに基づいてサブパタンの始端点及び終端点の座標を
抽出する手段とするのが好適である。Further, in carrying out the present invention, the segment extraction means scans the subpattern in a direction forming a predetermined angle with the scanning direction during subpattern extraction, and the change point from white bit to black bit is obtained for each scanning line. Preferably, the means extracts the coordinates of the starting point and ending point of the sub-pattern based on the coordinate position and number of points of change from black bits to white bits, and the coordinate position and number of points of change from black bits to white bits.
またこの発明の実施に当っては、セグメント抽出手段を
、各セグメントの始端点及び終端点の座標を、座標の原
点との位M闇係に閉連させてしかも各走査方向別に保存
する手段とするのが好適である。Further, in carrying out the present invention, the segment extracting means is configured to include means for storing the coordinates of the starting point and the ending point of each segment in close relation to the origin of the coordinates, and for each scanning direction. It is preferable to do so.
またこの発明の実施に当っては、閉ループセグメント検
索手段を、起点セグメントを検索する処理と、検索され
た起点セグメントの一方の端点の近傍領域内に一方の端
点を有する中間セグメントを検索する処理と、検索され
た中間セグメントの他方の端点の近傍領域内に一方の端
点を有すると共に前記起点セグメントの他方の端点の近
傍領域内に他方の端点を有する終点セグメントを検索す
る処理とを行なう手段とするのが好適である。Further, in carrying out the present invention, the closed loop segment search means includes a process of searching for a starting point segment, and a process of searching for an intermediate segment having one end point within a region near one end point of the found starting point segment. , searching for an end point segment that has one end point within a region near the other end point of the searched intermediate segment and has the other end point within a region near the other end point of the origin segment. is preferable.
ざらにこの発明の実施に当っては、閉ループセグメント
検索手段を、起点セグメントを検索する処理と、検索さ
れた起点セグメントの一方の端点の近傍領域内に一方の
端点を有する中間セグメントを検索する処理と、検索さ
れた中間セグメントの他方の端点の近傍9i域内に一方
の端点を有する次の中間セグメントを検索する処理を所
定回数行なう処理と、所定個数目に検索された中間セグ
メントの他方の端点の近傍領域内に一方の端点を有する
と共に起点セグメントの他方の端点の近傍領域内に他方
の端・点を有する終点セグメントを検索する処理とを行
なう手段とするのが好適である。In general, in implementing the present invention, the closed-loop segment search means includes a process of searching for a starting point segment, and a process of searching for an intermediate segment having one end point within a neighborhood area of one end point of the found starting point segment. and a process of searching for the next intermediate segment having one end point within the neighborhood 9i of the other end point of the retrieved intermediate segment a predetermined number of times; Preferably, the means performs a process of searching for an end point segment that has one end point in a neighboring region and has the other end/point in a neighboring region of the other end point of the starting point segment.
(作用)
上述した構成のこの発明の閉ループ図形検出装置によれ
ば、環パタンを所定の複数の方向に走査し、それぞれの
走査方向にあけるストローク成分をサブパタンとしで抽
出し、このサブパタンの始端点及び終端点を結ぶ線分を
セグメントとして検出することによって、環パタンを表
すセグメントを各走査方向別に検出する。(Operation) According to the closed-loop figure detection device of the present invention configured as described above, a ring pattern is scanned in a plurality of predetermined directions, stroke components in each scanning direction are extracted as subpatterns, and the starting end point of this subpattern is extracted. By detecting the line segments connecting the and end points as segments, segments representing the ring pattern are detected in each scanning direction.
サブパタンの始端点及び終端点を結ぶ線分をセグメント
として検出するので、原パタンの分岐や、交差や、接合
部の部分の形状をセグメントにおいて従来よりも忠実に
歪みなく表わすことが出来る。また、原パタンの直線部
分の直進性を従来よりも忠実にセグメントに反映させる
ことが出来る。Since the line segment connecting the starting point and ending point of the sub-pattern is detected as a segment, the shapes of branches, intersections, and joints of the original pattern can be expressed more faithfully and without distortion than before in the segment. Furthermore, the straightness of the straight line portion of the original pattern can be more faithfully reflected in the segments than before.
ざらにこの発明の閉ループ図形検出装置によれば、検索
されたセグメントの端点の近傍領域内に端点を有するセ
グメントを順次に検索することによって、閉ループを構
成する起点セグメント、中間セグメント及び終点セグメ
ントを順次検出する。検索されたセグメントの端点の近
傍領域内に端点を有するセグメントを検索する処理は単
純であり、また上述のようなセグメントを検出する処理
も単純であるので、閉ループ図形の検出処理を従来より
も単純化することが出来る。Roughly speaking, according to the closed-loop figure detection device of the present invention, by sequentially searching for segments having endpoints within the vicinity of the endpoints of the searched segments, the starting point segment, intermediate segment, and end point segment constituting a closed loop are sequentially searched. To detect. The process of searching for a segment whose endpoint is within the vicinity of the endpoint of the searched segment is simple, and the process of detecting segments as described above is also simple, making the process of detecting closed-loop shapes simpler than before. can be converted into
(実施例) 以下、図面を参照しこの発明の実施例につき説明する。(Example) Embodiments of the present invention will be described below with reference to the drawings.
尚、図面はこの発明が理解出来る程度に概略的に示され
ているにすぎず、従って図に示される構成成分の配設位
置、入出力信号の流れ、形状、寸法及び位M関係は図示
例に限定されるものではない。Note that the drawings are merely shown schematically to the extent that this invention can be understood, and therefore, the arrangement positions of the components shown in the drawings, the flow of input/output signals, the shapes, dimensions, and positional relationships are merely examples shown in the drawings. It is not limited to.
第1図はこの実施例の構成を概略的に示す機能ブロック
図である。FIG. 1 is a functional block diagram schematically showing the configuration of this embodiment.
同図にも示すように、この実施例の閉ループ図形検出装
置は、サブパタン抽出手段10、セグメント抽出手段1
2及び閉ループセグメント検索手段14を備える。サブ
パタン抽出手段10は少なくとも閉ループ図形を含む情
報媒体の量子化された光電変換信号で表される環パタン
を所定の複数の方向に走査し、それぞれの走査方向のス
トローク成分をサブパタンとして抽出し、セグメント抽
出手段12はサブパタン抽出時の走査方向におけるサブ
パタンの始端点及び終端点の座標を抽出する。閉ループ
検索手段14はサブパタンの始端点及び終端点を結ぶ線
分を当該サブパタンを表すセグメントとし、このセグメ
ントのなかから閉ループ図形を構成する起点セグメント
、所定個数の中間セグメント及び終点セグメントを順次
に検索するため、検索されたセグメントの端点の近傍領
域内に端点を有するセグメントを順次に検索する。As shown in the figure, the closed-loop figure detection device of this embodiment includes sub-pattern extraction means 10, segment extraction means 1
2 and closed loop segment search means 14. The sub-pattern extraction means 10 scans a ring pattern represented by a quantized photoelectric conversion signal of an information medium including at least a closed-loop figure in a plurality of predetermined directions, extracts stroke components in each scanning direction as a sub-pattern, and extracts a segment. The extraction means 12 extracts the coordinates of the starting point and ending point of the subpattern in the scanning direction at the time of subpattern extraction. The closed-loop search means 14 uses a line segment connecting the starting point and the ending point of a sub-pattern as a segment representing the sub-pattern, and sequentially searches among these segments for a starting point segment, a predetermined number of intermediate segments, and an ending point segment that constitute a closed-loop figure. Therefore, segments having endpoints within the vicinity of the endpoints of the searched segments are sequentially searched.
ざらにこの実施例の閉ループ図形検出装置は、原パタン
を保存するための原パタンメモリ16と、環パタンにお
ける線幅Wを算出する線中計算手段18と、各走査方向
別にサブパタンを保存するサブパタン記憶手段20と、
各走査方向別にセグメントを記憶するセグメント記憶手
段22と、ざらに閉ループを構成するセグメントの情報
例えば始端点及び終端点座標を記憶する閉ループデータ
メモリ24とを備えている。Roughly speaking, the closed-loop figure detection device of this embodiment includes an original pattern memory 16 for storing the original pattern, a line calculation means 18 for calculating the line width W in the ring pattern, and a sub-pattern for storing sub-patterns for each scanning direction. storage means 20;
It includes a segment storage means 22 that stores segments for each scanning direction, and a closed loop data memory 24 that stores information on segments that roughly constitute a closed loop, such as the coordinates of the start point and end point.
以下、より詳細にこの実施例につき説明する。This embodiment will be explained in more detail below.
〈環パタン〉
図示しない光電変換部は論理回路図等の情報媒体からの
光信号を光電変換し量子化された電気信号に変換し、こ
の量子化された電気信号で表される環パタンか原パタン
メモリ16及び線巾計算手段18に同時に入力される。<Ring pattern> A photoelectric conversion unit (not shown) photoelectrically converts an optical signal from an information medium such as a logic circuit diagram into a quantized electrical signal, and converts the ring pattern or original signal represented by this quantized electrical signal into a quantized electrical signal. It is simultaneously input to the pattern memory 16 and line width calculation means 18.
この実施例にあっては、環パタンを例えば2値の量子化
された電気信号とし文字図形を黒ビットで及び文字図形
の背景部(情報媒体の地の部分)を白ヒ・ントで表現す
る。In this embodiment, the ring pattern is, for example, a binary quantized electrical signal, and the character figures are expressed with black bits, and the background part of the character figure (the ground part of the information medium) is expressed with white bits. .
第2図は原パタンの説明に供する図である0図示の原パ
タンPは例えば線図形パタンP1及び背景パタンP2と
から成る。尚、図示例では説明の便宜を図るため環パタ
ンは線図形パタン及び背景パタンかう成るパタンとした
が、線図形パタンのみならず文字その他のパタンを含む
パタンでも良い。FIG. 2 is a diagram for explaining the original pattern. The original pattern P shown in FIG. 2 is composed of, for example, a line figure pattern P1 and a background pattern P2. In the illustrated example, for convenience of explanation, the ring pattern is a pattern consisting of a line figure pattern and a background pattern, but it may be a pattern that includes not only line figure patterns but also characters and other patterns.
原パタンの各画素位置はメモリ16上に任意好適に設定
されるx−y座標系で表現され、メモリ16はこのx−
y座標系で表現される位置の画素の原パタンの読出しが
自在に行なえるメモリとなっており、従って原パタンの
メモリ16からの読出しをx、y座標を用いて自在に行
なえる。Each pixel position of the original pattern is expressed in an x-y coordinate system arbitrarily set on the memory 16, and the memory 16 is
The memory 16 is a memory from which the original pattern of a pixel at a position expressed in the y coordinate system can be freely read out, and therefore the original pattern can be freely read out from the memory 16 using the x and y coordinates.
〈線巾計算手段〉
線中計算手段18は周知のフィルタ回路と同様にシフト
レジスタ構成となっており、入力される原バタシに閉し
て例えば(2X2)の窓のすべての点が黒ビットとなる
点の個数Qと原パタン中の全黒ビ・ント数Aとを計数し
、次に示す周知の近似式(1)に基づいて線巾Wを計算
する。<Line Width Calculation Means> The line width calculation means 18 has a shift register configuration similar to a well-known filter circuit, and closes to the input original data so that, for example, all points in a (2×2) window become black bits. The number of points Q and the number A of all black bits in the original pattern are counted, and the line width W is calculated based on the following well-known approximation formula (1).
w= 1/ (1−(Q/A)) −(1)くサブ
パタン抽出手段〉
第3図はサブパタン抽出の説明に供する図であり、図の
(A)、(B)、(C)及び(D)はそれぞれ第2図に
示す原パタンかう抽出された垂直サブパタン、水平サブ
パタン、右斜めサブパタン及び左斜めサブパタンを示す
。w= 1/ (1-(Q/A)) - (1) Sub-pattern extraction means> Figure 3 is a diagram for explaining sub-pattern extraction, and (A), (B), (C) and (D) shows a vertical sub-pattern, horizontal sub-pattern, right diagonal sub-pattern, and left diagonal sub-pattern extracted from the original pattern shown in FIG. 2, respectively.
この実施例では環パタンの走査方向を例えば垂直(y軸
に平行な方向)、水平方向(X軸に平行な方向)、右斜
め上り45°方向及び左斜め上り456方向の四方向と
し、従ってサブパタン抽出手段10は、環パタンを垂直
方向に走査することによって垂直サブパタンVSP (
第3図(A)9照)v!油抽出るVSP抽出手段10a
と、環パタンを水平方向(X軸に平行な方向)に走査す
ることによって水平サブパタンH3P (第3図(8)
?照)を抽出するH5P抽出手段10bと、原パタンを
右斜め456方向に走査することによって右斜めサブパ
タンR3P (第3図(C)参照)を抽出するR3P抽
出手段10cと、環パタンを左斜め456方向に走査す
ることによって左斜めサブパタンLSP(第3図(D)
9照)を抽出するLSP抽出手段+Odとを備えて成る
。In this embodiment, the scanning directions of the ring pattern are, for example, four directions: vertical (parallel to the y-axis), horizontal (parallel to the The sub-pattern extraction means 10 scans the ring pattern in the vertical direction to extract a vertical sub-pattern VSP (
Figure 3 (A) 9) v! VSP extraction means 10a for extracting oil
By scanning the ring pattern in the horizontal direction (direction parallel to the X-axis), the horizontal sub-pattern H3P (Fig. 3 (8)
? H5P extraction means 10b extracts the ring pattern R3P (refer to FIG. 3(C)); R3P extraction means 10c extracts the right diagonal sub-pattern R3P (see FIG. 3(C)) by scanning the original pattern diagonally to the right in 456 directions; By scanning in 456 directions, the left diagonal sub-pattern LSP (Fig. 3(D)
9).
しかもこの実施例のサブパタン抽出手段10は、サブパ
タン抽出時の走査方向に連続する図形構成画素から成る
画素群であってこの連続の長さβが所定の長さの画素群
(例えば!≧Nw(但し、Nは定数)となる長ざlの図
形構成画素群)(こよっで構成されるストローク成分を
当該走査方向におけるサブパタンとして抽出する。Moreover, the sub-pattern extracting means 10 of this embodiment is a pixel group consisting of continuous figure constituent pixels in the scanning direction at the time of sub-pattern extraction, and the continuous length β is a pixel group of a predetermined length (for example, !≧Nw( (N is a constant) A stroke component consisting of a figure-constituting pixel group with a length l) is extracted as a sub-pattern in the scanning direction.
より具体的に説明すれば、vSP抽出手段10aは、メ
モリ16の原パタンにつき垂直方向の全面走査を行ない
、当該垂直方向の走査線上で連続して検出される黒ビッ
トを検出する。そして走査線上で連続する黒ビットから
成る黒ビツト群のうち長さlが所定の長き例えばβ≧N
wとなる黒ビツト群を取出しvSPメモリ20aに保存
する。その結果、第3図(八)1こも示すような、垂直
走査方向のストローク成分である垂直サブパタンのみを
原パタンかう抽出することが出来る。More specifically, the vSP extraction means 10a scans the entire original pattern in the memory 16 in the vertical direction, and detects black bits that are continuously detected on the scanning line in the vertical direction. Among the black bit groups consisting of consecutive black bits on the scanning line, the length l is a predetermined length, for example, β≧N
The black bit group corresponding to w is extracted and stored in the vSP memory 20a. As a result, only vertical sub-patterns, which are stroke components in the vertical scanning direction, can be extracted from the original pattern, as shown in FIG. 3(8).
VSP抽出手段10aと同様にして、H3P抽出手段1
0bは水平サブパタンを抽出してH8Pメモリ20bに
保存し、R3P抽出手段10cは右斜めサブパタンを抽
出してR3Pメモリ20cに保存し、ざらにLSP抽出
手段10dは左斜めサブパタンを抽出してLSPメモリ
20dに保存する。Similarly to the VSP extraction means 10a, the H3P extraction means 1
0b extracts the horizontal sub-pattern and stores it in the H8P memory 20b, the R3P extraction means 10c extracts the right diagonal sub-pattern and stores it in the R3P memory 20c, and roughly the LSP extraction means 10d extracts the left diagonal sub-pattern and stores it in the LSP memory. Save to 20d.
連結する黒ビツト群から成る線分が主走査方向例えば水
平方向となす角をeとするとき、従来知られているよう
に黒ビツト群の長さlはβ”=nw(但しn=1/Si
nθ)で表される。従って例えば、水平及び垂直方向に
は!≧N、W(但しN、=1/Sinθ1)となる長さ
pの黒ビット群を、また右斜め及び左斜め方向にはβ≧
N2w(但しN2=1/Sinθ2)となる長さβの黒
ビット群を取り出すようにしく但しθ1+θ2≦45°
)、el及びθ2を任意好適な値(例えば131=02
=、22.5’ )に設定することによって、すべて
の線分をいずれかのサブパタンに分類して抽出すること
が出来る。When the angle between the line segment consisting of the connected black bit groups and the main scanning direction, for example, the horizontal direction, is e, the length l of the black bit group is β''=nw (however, n=1/ Si
nθ). Thus, for example, in the horizontal and vertical directions! ≧N, W (however, N, = 1/Sinθ1), a black bit group of length p, and β≧ in the right diagonal and left diagonal directions.
Try to extract a black bit group of length β such that N2w (N2=1/Sinθ2), however, θ1+θ2≦45°
), el and θ2 to arbitrary suitable values (for example, 131=02
=, 22.5'), all line segments can be classified and extracted into one of the sub-patterns.
くサブパタン記憶手段〉
この実施例では垂直、水平、右斜め45°及び左斜め4
5°方向の四方向の各走査方向別に抽出されたサブパタ
ンを走査方向別に記憶するため、サブパタン記憶手段2
0ヲ、VSPメモリ20a、H3Pメモリ20b1日S
Pメモリ20c及びLSPメモリ20dから構成してい
る。sub-pattern storage means> In this embodiment, vertical, horizontal, right diagonal 45 degrees, and left diagonal 4
In order to store subpatterns extracted for each of the four scanning directions in the 5° direction for each scanning direction, the subpattern storage means 2 is used.
0wo, VSP memory 20a, H3P memory 20b 1st S
It consists of a P memory 20c and an LSP memory 20d.
各メモリ20a〜20d上にはx−y座標系がそれぞれ
任意好適に設定されており、各サブパタンの画素位置が
x−y座標系で表現され、各サブパタンの保存及び読出
しをx、y座標を用いて自在に行なえるようにしている
。An x-y coordinate system is arbitrarily set on each memory 20a to 20d, and the pixel position of each sub-pattern is expressed in the x-y coordinate system, and the storage and reading of each sub-pattern is performed using x and y coordinates. I use it so that I can do it freely.
抽出されたサブパタンをメモリ20a、20b、20c
mは20dへ保存する際には、抽出されたサブパタン
の原バタシメモリ1.6上での画素位置と対応する画素
位置にサブパタンが保存される。The extracted sub-patterns are stored in memories 20a, 20b, 20c.
When m is stored in 20d, the subpattern is stored at a pixel position corresponding to the pixel position on the original memory 1.6 of the extracted subpattern.
〈セグメント抽出手段〉
この実施例のセグメント抽出手段■2は、特公昭60−
55868号公報に開示されている方法を応用してサブ
パタンのセグメントを抽出する。すなわちセグメント抽
出手段12は、サブパタン抽出時の走査方向と所定の角
度を成す方向(例えば直交する方向)にサブパタンを走
査し、各走査列毎に得る白ビットから黒ビットへの変化
点の座標位置及びその個数、並びに黒ビットから白ビッ
トへの変化点の座標位置及びその個数とに基づいてサブ
パタンの始端点及び終端点(以下、単に始点及び終点と
称す)の座標を抽出する。<Segment extraction means> Segment extraction means (2) of this embodiment is the
Segments of sub-patterns are extracted by applying the method disclosed in Japanese Patent No. 55868. In other words, the segment extraction means 12 scans the subpattern in a direction forming a predetermined angle (for example, perpendicular to the scanning direction at the time of subpattern extraction), and obtains the coordinate position of the point of change from white bit to black bit for each scanning line. The coordinates of the starting point and ending point (hereinafter simply referred to as the starting point and ending point) of the sub-pattern are extracted based on the coordinate position and the number of points of change from black bits to white bits.
しかもこの実施例では垂直、水平、右斜め45°及び左
斜め45°方向の四方向の各走査方向別のサブパタンの
始点及び終点の座標を抽出するため、セグメント抽出手
段12を垂直サブパタンの始点及び終点の座標を抽出す
るVSEG抽出手段12aと、水平サブパタンの始点及
び終点の座標を抽出するH3EG抽出手段+2bと、右
斜めサブパタンの始点及び終点の座標を抽出するR3E
G抽出手段12cと、左斜めサブパタンの始点及び終点
の座標を抽出するLSEG抽出手段+2dとから構成し
ている。Furthermore, in this embodiment, in order to extract the coordinates of the starting point and ending point of the sub-pattern in each of the four scanning directions of vertical, horizontal, 45° diagonal right and 45° left diagonal, the segment extracting means 12 is used to extract the coordinates of the starting point and ending point of the vertical sub-pattern. VSEG extracting means 12a for extracting the coordinates of the end point, H3EG extracting means +2b for extracting the coordinates of the start point and end point of the horizontal sub-pattern, and R3E extracting the coordinates of the start point and end point of the right diagonal sub-pattern.
It consists of a G extraction means 12c and an LSEG extraction means +2d for extracting the coordinates of the starting point and end point of the left diagonal sub-pattern.
VSEG抽出手段12aは垂直サブパタン抽出時の走査
方向と例えば90°の角度を成す方向すなわち水平方向
に垂直サブパタンを走査し、水平方向の走査線上で白ビ
ットから黒ビットに変化したときの黒ビット(以下黒変
化点と称す)の座標と、黒ビットから白ビットに変化し
たときの白ビット(以下白変化点と称す)の座標とを各
走査線毎に検出し、走査を終えた走査線において検出さ
れた黒変化点及び白変化点の座標と、当該走査を終えた
走査線の一ライン前の走査線において検出された黒変化
点及び白変化点の座標とに基づいて垂直サブパタンの始
点及び終点の座標を抽出する。The VSEG extraction means 12a scans the vertical sub-pattern in a direction that makes an angle of, for example, 90 degrees with the scanning direction when extracting the vertical sub-pattern, that is, in the horizontal direction, and extracts the black bit ( The coordinates of the black bit (hereinafter referred to as the black change point) and the coordinates of the white bit (hereinafter referred to as the white change point) when the black bit changes to the white bit are detected for each scanning line, and the The starting point and the starting point of the vertical sub-pattern are determined based on the coordinates of the detected black change point and white change point and the coordinates of the black change point and white change point detected in the scanning line one line before the scanning line that has finished the scanning. Extract the coordinates of the end point.
VSEG抽出手段12aと同様にしで、H8EG抽出手
段+2bは例えば垂直方向に垂直サブパタンを走査する
ことによって、R5EG抽出手段12cは例えば左斜め
45°方向に右斜めサブパタンを走査すること、ざらに
LSEG抽出手段+2dは例えば右斜め45°方向に左
斜めサブパタンを走査することによって各サブパタンの
始点及び終点の座標を抽出する。Similarly to the VSEG extracting means 12a, the H8EG extracting means +2b scans a vertical sub-pattern in the vertical direction, and the R5EG extracting means 12c scans a right diagonal sub-pattern, for example, in a 45° left diagonal direction, roughly extracting LSEG. The means +2d extracts the coordinates of the starting point and ending point of each sub-pattern by scanning the left diagonal sub-pattern in a right diagonal direction of 45°, for example.
走査線か1本のストロークを横切ることを想定した場合
、当該走査線上では白ビットの次に黒ビットが連続して
検出され連続する黒ビットの次に白ビットが検出され、
従って黒変化点の次に連続して黒ビットが検出されたの
ち白変化点が検出される。従って変化点が検出されるこ
とはストロークが検出されたとみなすことが出来、ざら
に黒変化点の次に連続して黒ビットが検出されたのち白
変化点が検出されるときの黒白変化点をある特定のスト
ロークに関する黒白変化点として検出すれば、走査線が
複数本のストロークを横切る場合でも各ストローク別に
黒白変化点を検出出来ることがわかる。Assuming that a scanning line or one stroke is crossed, on the scanning line, a black bit is detected successively after a white bit, a white bit is detected after a continuous black bit, and so on.
Therefore, after the black bit is detected consecutively after the black change point, the white change point is detected. Therefore, the detection of a change point can be regarded as the detection of a stroke, roughly speaking, the black-white change point is when a black bit is detected consecutively after a black change point, and then a white change point is detected. It can be seen that if the black-and-white change point is detected for a particular stroke, the black-and-white change point can be detected for each stroke even when a scanning line crosses a plurality of strokes.
また走査ヲ終えたばかりの行を走査行と称し、当該走査
行の一ライン前の行を前行と称するものとすると、前行
で検出されなかったストロークであって走査行で検出さ
れたストロークの、走査行における変化点が、走査行で
新たに出現したストロークの始点の変化点である。また
前行で検出されたストロークであって走査行で検出され
なかったストロークの、前行における変化点が、走査行
で消滅したストロークの終点の変化点となる。Also, if the line that has just been scanned is called the scanning line, and the line one line before the scanning line is called the previous line, then the strokes that were not detected in the previous line but are the same as the strokes detected in the scanning line. , the change point in the scan line is the change point of the starting point of a newly appearing stroke in the scan line. Further, the change point in the previous line of the stroke detected in the previous line but not detected in the scanning line becomes the change point of the end point of the stroke that disappeared in the scanning line.
ストロークの連続性は次の関係式(2a)及び(2b)
に基づいて判定することが出来る。関係式(2a)及び
(2b)を満足する黒白変化点は同一ストロークの変化
点、及び満足しない場合は異なるストロークの変化点と
する。The continuity of the stroke is expressed by the following relational expressions (2a) and (2b)
Judgment can be made based on. A black-and-white change point that satisfies relational expressions (2a) and (2b) is a change point of the same stroke, and if not, a change point of a different stroke.
XaYm≦X mV (lll+ + + ”−・
(2a)Xwvm≦X BY(111+11 − (
2b )但し、Ym行において検出された黒変化点のX
座標及び白変化点のX座標を×8□及びXWVmとし、
またYm行の次のラインのYCm+1)行において検出
された黒変化点のX座標及び白変化点のX座標をXWV
(□1.及びXI’/Tm。1.とする。XaYm≦X mV (lll+ + + ”-・
(2a) Xwvm≦X BY(111+11 − (
2b) However, the X of the black change point detected in the Ym row
The coordinates and the X coordinate of the white change point are ×8□ and XWVm,
In addition, the X coordinate of the black change point and the X coordinate of the white change point detected in the line YCm+1), which is the next line after the Ym line, are
(□1. and XI'/Tm.1.
以下、垂直サブパタンの始点及び終点の抽出を一例とし
て、始点及び終点の抽出につき説明する。Hereinafter, extraction of the start point and end point of a vertical sub-pattern will be explained using extraction of the start point and end point as an example.
第4図(A)〜(8)はサブパタンの始点及び終点の抽
出の説明に供する図である。FIGS. 4(A) to 4(8) are diagrams for explaining extraction of the starting point and ending point of a sub-pattern.
第4図(A)に示すような垂直パタンか検出され、この
パタンを原点OからX座標が正の値となる方向へ主走査
し及び原点○からy座標が正の値となる方向へ副走査す
るものとする。A vertical pattern as shown in Fig. 4 (A) is detected, and this pattern is scanned in the main direction from the origin O in the direction where the shall be scanned.
第4図(A)に示すパタンを走査してゆくと走査開始行
から71行の一ライン前の行までは黒白変化点は検出さ
れず、71行の走査線においてはじめて黒白変化点(2
個の変化点)が検出される。As the pattern shown in FIG. 4(A) is scanned, no black-white change point is detected from the scanning start line to the line one line before the 71st line, and the black-white change point (2
change points) are detected.
71行の一ライン前までの行では変化点が検出されてい
ないので、71行で検出されたストロークの変化点はス
トロークの始点の変化点となる。Since no change point has been detected in the lines up to one line before the 71st line, the stroke change point detected in the 71st line becomes the change point of the stroke starting point.
71行で出現したストロークをストローク1として、こ
のストローク]の始点の座標がVSEGテーブル22a
に保存される。Assuming that the stroke that appeared in line 71 is stroke 1, the coordinates of the starting point of this stroke are shown in the VSEG table 22a.
Saved in
ストロークの始点を例えば始点の黒白変化点の中点座標
で表現すれば、71行の走査線上で検出された黒変化点
の座標が(Xsv+ 、Yy+)及び白変化点の座標が
(Xwv+ % Yv+)であるとき(但し、Y□は7
1行の走査線の副走査座標である)、ストローク]の始
点のX座標は(XaVI +xwy+)/2及びY座標
はYVIとなる。If the start point of a stroke is expressed, for example, by the coordinates of the midpoint of the black and white change point at the start point, the coordinates of the black change point detected on the 71st scanning line are (Xsv+, Yy+) and the coordinates of the white change point are (Xwv+ % Yv+ ) (however, Y□ is 7
The X coordinate of the starting point of the stroke is (XaVI +xwy+)/2, and the Y coordinate is YVI.
ざらにVSEG抽出手段12aは71行以下の走査を行
なうが、この際VSEG抽出手段12aは関係式(2a
)及び(2b)に基づいてストロークの連続性を判定す
る。VSEG抽出手段12aはストロークの連続性の判
定に基づいて、ストローク別に走査行及び前行の変化点
の座標を保存する。Roughly speaking, the VSEG extracting means 12a scans 71 lines or less, but at this time, the VSEG extracting means 12a uses the relational expression (2a
) and (2b) to determine the continuity of the stroke. The VSEG extracting means 12a stores the coordinates of the change points of the scanning line and the previous line for each stroke based on the determination of the continuity of the strokes.
ざらに垂直サブパタンの走査を進めると、71行から7
2行の一ライン前の行までは、ストローク1の変化点の
みが検出される。If we roughly scan the vertical sub-patterns, we will see 7 from line 71.
Only the change point of stroke 1 is detected up to the line one line before the second line.
72行の走査では変化点個数が4個になり、新しいスト
ロークが出現したことがわかる。このとき前行(72行
の一ライン前の行)で検出された変化点と走査行(72
行)で検出された変化点とにおいて間係式(2a)及び
(2b)を満足する変化点の組と満足しない変化点の組
とを検出出来、従って関係式(2a)及び(2b)に基
づいて前行で検出されなかったストロークであって走査
行で検出された新たなストO−りすなわちストローク2
を検出することが出来る。この新たなストローク2の始
点の座標を始点の黒白変化点の座標から求めVSEGテ
ーブル22aに保存する。In scanning 72 lines, the number of change points is 4, indicating that a new stroke has appeared. At this time, the change point detected in the previous line (the line one line before line 72) and the scanning line (72
It is possible to detect a set of changing points that satisfy the relational equations (2a) and (2b) and a set of changing points that do not satisfy the relational equations (2a) and (2b), and therefore, the relational equations (2a) and (2b) A new stroke detected in the scanning row that was not detected in the previous row based on the stroke, that is, stroke 2
can be detected. The coordinates of the starting point of this new stroke 2 are determined from the coordinates of the black-white transition point of the starting point and are stored in the VSEG table 22a.
ざらに垂直サブパタンの走査を進めると72行から73
行の一ライン前の行まではストローク]及び2の変化点
が検出される。Roughly scanning the vertical subpatterns, we get from line 72 to line 73.
Stroke up to the line one line before the line] and 2 change points are detected.
73行の走査では、ストローク2の変化点が2個になる
。このとき前行(73行の一ライン前の行)で検出され
た変化点と走査行(73行)で検出された変化点とにお
いて関係式(2a)及び(2b)を満足する変化点の組
と満足しない変化点の組とを検出出来、従って関係式(
2a)及び(2b)に基づいて前行で検出されたストロ
ークであって走査行で検出されなかった(消滅した)ス
トロークすなわちストローク1を検出することが出来る
。この消滅したストローク1の終点の座標が求められV
SEGテーブル22aに保存される。終点の座標は例え
ば終点における黒白変化点の中点座標で表現される。In scanning 73 lines, there are two change points for stroke 2. At this time, the change point that satisfies relational expressions (2a) and (2b) between the change point detected in the previous row (the line one line before the 73rd row) and the change point detected in the scanning row (73rd row) The set and the set of unsatisfied change points can be detected, and therefore the relational expression (
Based on 2a) and (2b), it is possible to detect the stroke detected in the previous line but not detected (disappeared) in the scanning line, that is, stroke 1. The coordinates of the end point of this disappeared stroke 1 are determined and V
It is saved in the SEG table 22a. The coordinates of the end point are expressed, for example, by the coordinates of the midpoint of the black-white transition point at the end point.
さらに垂直サブパタンの走査を進めると73行からY4
行の一ライン前の行まではストローク2の変化点のみが
検出され、Y4行の走査では変化点が検出されなくなる
。前行(Y4行の一ライン前の行)では変化点が検出さ
れ、走査行(Y4行)では変化点が検出されないので、
前行で検出されたストロークの終点すなわちストローク
2の終点を前行の変化点から求めVSEGテーブル22
aに保存する。Further scanning of the vertical sub-pattern causes Y4 to start from line 73.
Only the changing point of stroke 2 is detected up to the previous line, and no changing point is detected when scanning the Y4 line. A change point is detected in the previous row (one line before the Y4 row), but no change point is detected in the scan row (Y4 row), so
The end point of the stroke detected in the previous row, that is, the end point of stroke 2, is determined from the change point of the previous row in the VSEG table 22.
Save to a.
また第4図(B)に示すように、ある走査範囲では重な
り合わずある走査範囲では重なり合うストローク3及び
4が垂直パタンとして検出されたとする0図示例のスト
ローク3及び4は、71行から73行の一ライン前の行
までは重なり合わずY3行々\らY4行の一ライン前の
行まででは重なり合う。Further, as shown in FIG. 4(B), strokes 3 and 4 that overlap in a certain scanning range but overlap in a certain scanning range are detected as a vertical pattern.The strokes 3 and 4 in the illustrated example are from line 71 to line 73. The lines up to the line one line before the line do not overlap, but the lines up to the line one line before the Y3 line and Y4 line overlap.
第4図(B)に示すパタンの走査を行なうと73行で変
化点個数が2個になる。走査行(73行)の変化点と前
行(73行の一ライン前の行)の変化点とにおいて間係
式(2a)及び(2b)を満足する変化点を調べると、
前行において異なるストロークの変化点がいずれも走査
行の変化点に間して関係式(2a)及び(2b)を満足
することがわかり、従って連続していることがわかる。When the pattern shown in FIG. 4(B) is scanned, the number of change points becomes two in 73 lines. Examining the change points that satisfy the relationship equations (2a) and (2b) between the change point in the scanning row (line 73) and the change point in the previous row (the line one line before row 73),
It can be seen that the change points of different strokes in the previous line satisfy the relational expressions (2a) and (2b) between the change points of the scanning line, and therefore it can be seen that they are continuous.
すなわち前行において別々に検出されたストロークが走
査行において重なり合っていることが分る。この場合に
は、より先に検出されるストロークすなわちストローク
3は走査行において未だ消滅せず、残りのストローク4
は走査行において消滅したとみなして、前行におけるス
トローク4の変化点からストローク4の終点の座標を求
めVSEGテーブル22aに保存する。その結果、Y3
行以下の走査で検出される変化点はストローク3の変化
点として検出される。That is, it can be seen that the strokes detected separately in the previous row overlap in the scanning row. In this case, the earlier detected stroke, stroke 3, has not yet disappeared in the scanning line, and the remaining stroke 4
is assumed to have disappeared in the scanning line, and the coordinates of the end point of stroke 4 are determined from the change point of stroke 4 in the previous line and stored in the VSEG table 22a. As a result, Y3
The change point detected by scanning the rows and below is detected as the change point of stroke 3.
水平サブパタン、右斜めサブパタン及び左斜めサブパタ
ンの始点及び終点の抽出も、上述の垂直サブパタンの場
合と同様にして抽出される。The starting points and end points of the horizontal sub-pattern, right diagonal sub-pattern, and left diagonal sub-pattern are also extracted in the same manner as in the case of the vertical sub-pattern described above.
サブパタンの始点及び終点を結ぶ線分がそのサブパタン
のセグメントである。A line segment connecting the start point and end point of a subpattern is a segment of that subpattern.
第5図はセグメント化された環パタンを示す図及び第6
図(A)〜(D)は検出されたセグメントの説明図であ
る。Figure 5 shows a segmented ring pattern and Figure 6 shows a segmented ring pattern.
Figures (A) to (D) are explanatory diagrams of detected segments.
上述のようにして各抽出手段12a〜+2dによって、
例えば第2図に示す環パタンから篤5図に示すような垂
直セグメント(VSEG)v+〜V?、水平セグメント
(H8EG)h、 〜hlo、右斜めセグメント(RS
E G ) r +〜r2及び左斜めセグメント(L
SEG)β1〜β2が検出される。As described above, by each extraction means 12a to +2d,
For example, from the ring pattern shown in Fig. 2, a vertical segment (VSEG) v+~V? , horizontal segment (H8EG) h, ~hlo, right diagonal segment (RS
E G ) r + ~ r2 and left diagonal segment (L
SEG) β1-β2 are detected.
第6図において実線及び破線の矢印でそれぞれ示す方向
はセグメントを抽出するための走査におけるサブパタン
の主走査方向及び副走査方向を概略的に示している。こ
れら図からもわかるように、副走査方向に順次に走査す
るとき、サブパタンの端点のうち先に検出される端点(
始端点)の変化点からセグメントの始点Sの座標を及び
サブパタンの端点のうち後に検出される端点(v!端点
)の変化点からセグメントの終点Eの座標が検出される
。後述する閉ループセグメント検出の処理においては、
これら各セグメントの始点及び終点の座標がセグメント
情報としで用いられる。In FIG. 6, the directions indicated by solid line and broken line arrows respectively schematically indicate the main scanning direction and sub-scanning direction of the sub-pattern in scanning for extracting segments. As can be seen from these figures, when scanning sequentially in the sub-scanning direction, the end point detected first among the end points of the sub-pattern (
The coordinates of the starting point S of the segment are detected from the changing point of the starting point (starting end point), and the coordinates of the end point E of the segment are detected from the changing point of the endpoint (v! endpoint) detected later among the endpoints of the sub-pattern. In the process of closed-loop segment detection described later,
The coordinates of the starting point and ending point of each of these segments are used as segment information.
従来行なわれている細線化処理では、分岐や、交差や、
直線及び曲線の接合部がある環パタンかうセグメントを
抽出した場合に、これら原バクンの分岐や、交差や、接
合部の部分の形状がセグメントにおいて忠実に表わされ
ずに歪められて表わされることが多かった。しかしなか
ら上述した説明からも明らかなように、この実施例では
、走査線上で連続して検出される黒ビットから成る黒ビ
ツト群によってサブパタンが構成され、このサブパタン
の始点及び終点を結ぶ線分をセグメントとする。これが
ため、原パタンの分岐や、交差や、接合部の部分の形状
をセグメントにおいて従来よりも忠実に歪みなく表わす
ことが出来る。Conventional thinning processing does not include branching, intersections,
When extracting a segment with a ring pattern in which straight lines and curved lines join, the shapes of the branches, intersections, and joints are often not faithfully represented in the segment, but are distorted. Ta. However, as is clear from the above explanation, in this embodiment, a sub-pattern is formed by a group of black bits that are continuously detected on a scanning line, and a line segment connecting the starting point and ending point of this sub-pattern is Let be a segment. Therefore, the shapes of branches, intersections, and joints of the original pattern can be expressed in segments more faithfully and without distortion than before.
また従来行なわれている細線化及び折線化された図形デ
ータを扱う製画では分岐点等で折線が切断され、NWA
成分が複数のセグメントに分断される場合が生じる。そ
の結果、目的とする形状の閉ループ図形の検出処理が複
雑化していた。一方、この実施例では、走査線上で連続
しで検出される黒ビットから成る黒ビツト群によってサ
ブパタンか構成され、このサブパタンの始点及び終点を
結ぶ線分をセグメントとする。これがため、環パタンの
直線部分の直進性を従来よりも忠実にセグメントに反映
させることが出来る。In addition, in the conventional drawing process that handles figure data that has been made into thin lines and broken lines, the broken lines are cut at branch points, etc., and NWA
There may be cases where a component is divided into multiple segments. As a result, the process of detecting a closed-loop figure having a target shape has become complicated. On the other hand, in this embodiment, a sub-pattern is formed by a group of black bits that are consecutively detected on a scanning line, and a line segment connecting the starting point and ending point of this sub-pattern is defined as a segment. Therefore, the straightness of the straight line portion of the ring pattern can be more faithfully reflected in the segments than before.
くセグメント記憶手段〉
第7図(A)〜(D)はセグメント記憶手段に保存され
るセグメントテーブルの一例を示す図でである。Segment Storage Means> FIGS. 7(A) to (D) are diagrams showing an example of a segment table stored in the segment storage means.
各セグメントの始点及び終点の座標は、各抽出手段12
a〜+2dによってそれぞれテーブル22a〜22bに
保存され、従って各走査方向別に保存される。これと共
に各セグメントの始点及び終点の座標は、各抽出手段1
2a〜+2dによって、座標の原点との位!関係に関連
させ例えば第7図にも示すように始点の検出順すなわち
原点により近い始点の順に並べて、保存される。The coordinates of the start point and end point of each segment are determined by each extraction means 12.
a to +2d are stored in the tables 22a to 22b, respectively, and are therefore stored for each scanning direction. Along with this, the coordinates of the starting point and ending point of each segment are determined by each extraction means 1.
By 2a~+2d, the place with the origin of the coordinates! In relation to the relationship, for example, as shown in FIG. 7, the starting points are arranged and saved in the order of detection of the starting points, that is, in the order of the starting points closest to the origin.
セグメントの始点及び終点の座標は、座標の原点0どの
位!fl係に関連させて任意好適に並べて保存するのが
良い、原点○により近い始点の順に並べて始点及び終点
の座標を保存することに加え、原点0により近い終点の
順に始点及び終点の座標を保存するようにしても良い、
セグメントの座標は原点0により遠い或は近い始点の順
に並べて、或はまた原点○よつ遠い或は近い終点の順に
並べて始点及び終点の座標を保存するようにしても良い
。How far are the coordinates of the start and end points of the segment from the coordinate origin 0? It is better to arrange and save the coordinates of the start point and end point in the order of the start point closest to the origin ○, as well as save the coordinates of the start point and end point in the order of the end point closer to the origin 0. You can also do as follows.
The coordinates of the segments may be arranged in the order of starting points that are farther or closer to the origin 0, or alternatively, the coordinates of the starting and ending points may be saved in order of starting points that are farther or closer to the origin ○.
このように原点○どの位MK係に関連させて保存しかつ
各セグメントを走査方向別に保存することによって、後
述する閉ループセグメントの検索処理においてセグメン
トの検索範囲を限定出来、従ってセグメントの検索個数
を減少させることが出来るので閉ループセグメントの検
索処理の高速化を図れる。In this way, by storing the origin in relation to the MK relation and storing each segment by scanning direction, it is possible to limit the segment search range in the closed-loop segment search process described later, thereby reducing the number of segments to be searched. Therefore, it is possible to speed up the search process for closed loop segments.
〈閉ループセグメント検索手段〉
この実施例の閉ループセグメント検索手段14は、閉ル
ープセグメントの検索処理において三角形状の閉ループ
を構成するセグメントを検索するため、起点セグメント
を検索する処理と、検索された起点セグメントの一方の
端点の近傍領域内に一方の端点を有する中間セグメント
を検索する処理と、検索された中間セグメントの他方の
端点の近傍領域内に一方の端点を有すると共に起点セグ
メントの他方の端点の近傍領域内に他方の端点を有する
終点セグメントを検索する処理とを行なう、これに加え
この実施例の閉ループセグメント検索手段14は、閉ル
ープセグメントの検索処理においてn角形状(nはn≧
4の自然数)例えば4角形状の閉ループを構成するセグ
メントを検索するため、起点セグメントを検索する処理
と、検索された起点セグメントの一方の端点の近傍領域
内に一方の端点を有する中門セグメントを検索する処理
と、検索された中間セグメントの他方の端点の近傍領域
内に一方の端点を有する次の中間セグメントを検索する
処理を所定回数だけ(n−3回だけ、例えばn=4のと
きは1回だけ)行なう処理と、所定個数口(n−2個目
)に検索された中間セグメントの他方の端点の近傍領域
内に一方の端点を有すると共に起点セグメントの他方の
端点の近傍領域内に他方の端点を有する終点セグメント
を検索する処理とを行なう、尚、このn角形状の閉ルー
プを構成するセグメントの検索では、起点セグメント及
び終点セグメントが各1個ずつと、中間セグメントが総
計でn−2個検出される。<Closed Loop Segment Search Means> The closed loop segment search means 14 of this embodiment searches for segments constituting a triangular closed loop in the closed loop segment search process. A process of searching for an intermediate segment that has one endpoint within a neighborhood area of one endpoint, and a neighborhood area that has one endpoint within a neighborhood area of the other endpoint of the searched intermediate segment and the other endpoint of the origin segment. In addition, the closed loop segment search means 14 of this embodiment searches for an end point segment having the other end point within the closed loop segment.
(Natural number 4) For example, in order to search for segments that constitute a rectangular closed loop, there is a process of searching for a starting point segment, and a middle gate segment having one end point within the vicinity of one end point of the searched starting point segment. The search process and the process of searching for the next intermediate segment that has one end point within the vicinity of the other end point of the searched intermediate segment are repeated a predetermined number of times (n-3 times, for example, when n=4, One end point is within the vicinity of the other end point of the intermediate segment searched for a predetermined number of times (n-2), and the process is performed only once) In addition, in the search for segments that constitute this n-gon-shaped closed loop, there is one starting segment, one ending segment, and a total of n- intermediate segments. Two are detected.
第1図にも示すように、この実施例の閉ループセグメン
ト検索手段14は主として上述の閉ループセグメント検
索処理を司どるCPUl4aと閉ループ検索のための検
索情報を保存する検索辞書14bとを備えて成る。As shown in FIG. 1, the closed loop segment retrieval means 14 of this embodiment mainly includes a CPU 14a which controls the above-described closed loop segment retrieval processing, and a search dictionary 14b which stores retrieval information for closed loop retrieval.
検索辞書14bには、検索しようとする閉ループ図形の
形状に関連させて予め定められた検索情報が保存されて
いる。The search dictionary 14b stores predetermined search information related to the shape of the closed loop figure to be searched.
第8図は検索情報の記述の一例を示す図、であり、−例
として枠型ループ、台形ループ及び三角形ループの検索
情報を示した図である。また第9図は検索情報を用いて
検出される閉ループの形状の一例を示す図である。FIG. 8 is a diagram showing an example of the description of search information, and is a diagram showing search information of a frame-shaped loop, a trapezoidal loop, and a triangular loop as an example. Further, FIG. 9 is a diagram showing an example of the shape of a closed loop detected using search information.
第8図に示す枠型ループの検索情報を用いて第9図(A
)に示す形状の閉ループが、台形ループの検索情報を用
いて第9図CB)に示す形状の閉ループが、及び三角形
ループの検索情報を用いて第9図(C)に示す形状の閉
ループが検出される。第9図において点線で示す矩形領
域はセグメントの端点の近傍領域を示している。Figure 9 (A
) is detected using the trapezoidal loop search information, a closed loop with the shape shown in FIG. 9(C) is detected using the trapezoidal loop search information, and a closed loop with the shape shown in FIG. 9(C) is detected using the triangular loop search information. be done. In FIG. 9, a rectangular area indicated by a dotted line indicates an area near the end point of the segment.
検索情報は、次の(3)〜(5)に示す式を用いて表さ
れている。高、検索情報及び検索情報の記述の仕方を以
下に述べるものに限定するものではない。The search information is expressed using the following formulas (3) to (5). However, the search information and the method of describing the search information are not limited to those described below.
!L (ρ1 、ρ2)=(SEI)Nl −・・
(3)し (β 3 、 β 4)”Cl−02
[Δ X1Δx2. Δyt、 Δy2 ]
” = (SF3 )″ N2”N3 −(4
)
L (β5 、β6 )″ C3−04[Δx3゜Δx
4. Δya、 Δy4] :05 −ca
[Δx5゜Δx6. Δy5. Δy6] ”
= (SE3 )”N4.N5”N6 −(5)
ここで、β1〜β6はセグメントの長さを指定するため
の数値、SEI〜SE3はセグメントの種類を指定する
記号(垂直セグメントを指定する場合は記号V、水平セ
グメントを指定する場合は記号H1右斜めセグメントを
指定する場合は記号R及び左斜めセグメントを指定する
場合は記号りが用いられる)、N1〜N6はセグメント
に付される名称、01〜C6はセグメントの始点S又は
終点Eを指定する記号、及びΔX1〜Δx6及びΔy1
〜Δy6は検索領域(セグメントの端点の近傍領域)を
指定するための数値を表す。! L (ρ1, ρ2)=(SEI)Nl −・・
(3) (β 3 , β 4)”Cl-02
[ΔX1Δx2. Δyt, Δy2 ]
" = (SF3)"N2"N3 - (4
) L (β5, β6)'' C3-04[Δx3゜Δx
4. Δya, Δy4] :05-ca
[Δx5゜Δx6. Δy5. Δy6]”
= (SE3)"N4.N5"N6 - (5) Here, β1 to β6 are numerical values to specify the length of the segment, and SEI to SE3 are symbols to specify the type of segment (when specifying a vertical segment is the symbol V, symbol H is used to designate a horizontal segment, symbol R is used to designate a right diagonal segment, and symbol ji is used to designate a left diagonal segment), N1 to N6 are the names given to the segments, 01 to C6 are symbols specifying the start point S or end point E of the segment, and ΔX1 to Δx6 and Δy1
~Δy6 represents a numerical value for specifying a search area (nearby area of an end point of a segment).
式(3)は長ざρが121≦β≦β2となるセグメント
を記号SEIで指定されるセグメントのなかから検索し
、検索したセグメントに対し名称N1を与える処理を表
す(起点セグメントの検索処理、後述の第10図(A)
参照)。Equation (3) represents the process of searching for a segment whose length ρ satisfies 121≦β≦β2 from among the segments specified by the symbol SEI, and giving the name N1 to the searched segment (search process of the origin segment, Figure 10 (A) described below
reference).
式(4)は名称N2f与えたセグメントの端点C2の近
傍領域[Δxi、Δx2.Δy+、Δy2]内に端点C
1を有するセグメントであって長ざlがβ3≦β≦β4
となるセグメントを、記号SE2で指定されるセグメン
トのなかから検索し、検索したセグメントに対し名称N
2を与える処理を表す(中間セグメントの検索処理、後
述の第10図(B)、(C)?照)、端点C2(7)X
座標をXC2及びy座標’FrVc2とすれば、端点C
2の近傍領域はX座標がXC2−ΔX1以上XC2+△
X2以下であって及びy座標がVC2−△y1以上VC
2+Δy2以下となる範囲の領域となる。Equation (4) calculates the neighborhood area [Δxi, Δx2. End point C within Δy+, Δy2]
1 and the length l is β3≦β≦β4
Search for the segment specified by the symbol SE2, and assign the name N to the searched segment.
2 (intermediate segment search process, see Figures 10 (B) and (C) below), the end point C2 (7)
If the coordinates are XC2 and y coordinate 'FrVc2, the end point C
The area near 2 has an X coordinate of XC2-ΔX1 or more XC2+Δ
X2 or less and y coordinate is VC2-△y1 or more VC
This is a region within a range of 2+Δy2 or less.
ざらに式(5)は名称N4を与えたセグメントの端点C
4の近傍領域[Δx3.Δx4.△y3.Δy4]内に
一方の端点C3を有しがっ名称N5を与えたセグメント
の端点C6の近傍領域[Δx5.Δx6.ΔV5.△y
6]内(こ他方の端点C5を有するセグメントであって
、長さlがβ5≦β≦16となるセグメントを、記号S
E3で指定されるセグメントのなかから検索し、検索し
たセグメントに対し名称N6を与える処理を表す(v!
点セグメントの検索処理、後述の第10図(D)’J照
)、端点04 (XC4,Vca”)の近傍領域はX
座標がXc’a−ΔX3以上Xc4+へX4以下であっ
て及びy座標がVca−Δy3以上Vca+Δy4以下
となる範囲の領域となる。同様に端点C5(Xcs、Y
es)の近傍領域はX座標が×(5−ΔX5以上XCl
5+ΔX6以下であって及びy座標が’/cfi−Δy
5以上yc、+Δy6以下となる範囲の領域となる。Roughly, equation (5) is the end point C of the segment given the name N4.
Neighboring area of 4 [Δx3. Δx4. △y3. [Δx5. Δx6. ΔV5. △y
6] (a segment having the other end point C5 and whose length l satisfies β5≦β≦16 is denoted by the symbol S
Represents the process of searching among the segments specified by E3 and giving the name N6 to the searched segment (v!
In the point segment search process, the area near the end point 04 (XC4, Vca") is X
This is a region where the coordinates are from Xc'a-ΔX3 to Xc4+ to X4 or less, and the y coordinate is from Vca-Δy3 to Vca+Δy4. Similarly, end point C5 (Xcs, Y
The area near es) has an X coordinate of ×(5−ΔX5 or more
5+ΔX6 or less and the y coordinate is '/cfi-Δy
The range is 5 or more yc and +Δy6 or less.
閉ループセグメント検索手段14は上述の(3)〜(5
)式によって表される処理の条件に適った起点セグメン
ト、中間セグメント及び終点セグメントが検出出来たと
き、これら検出された起点、中間及び終点セグメントに
関する情報(例えば各セグメントの始点S及び終点Eの
座標)を閉ループデータメモリ24に保存する。The closed loop segment search means 14 performs the above-mentioned (3) to (5).
) When a starting point segment, intermediate segment, and ending point segment that meet the processing conditions expressed by the expression ) is stored in the closed-loop data memory 24.
第10図(A)〜(D)は閉ループセグメント検索処理
の流れを示す図である。以下、第8図に示す枠型ループ
の検索情報を用いて行なう枠型ループの検索を一例とし
て閉ループ検索処理の流れにつき概略的に説明する。以
下の説明では第8図に示す検索情報を適宜参照されたい
。FIGS. 10(A) to 10(D) are diagrams showing the flow of closed loop segment search processing. Hereinafter, the flow of the closed-loop search process will be schematically explained using, as an example, a frame-shaped loop search performed using the frame-shaped loop search information shown in FIG. 8. In the following explanation, please refer to the search information shown in FIG. 8 as appropriate.
まず、第10図(A)にも示すように起点セグメントの
検索情報を用いて56≦β≦720の長ざρを有するセ
グメントを垂直セグメントのなかから検索し、検索した
垂直セグメント1こ対し名称W、を与える。この名称W
、を与えたセグメントを以下起点セグメントW、と称す
。First, as shown in FIG. 10(A), a segment having a length ρ of 56≦β≦720 is searched among the vertical segments using the search information of the starting point segment, and a name is given to one searched vertical segment. Give W. This name W
, is hereinafter referred to as the starting point segment W.
次に第10図(B)にも示すように中間セグメントの検
索情報を用いて起点セグメントW、の始点Sの近傍領域
[8,8,8,8]内に始点Sを有するセグメントであ
って56≦β≦720の長さlを有するセグメントを、
水平セグメントのなかから検索し、検索した水平セグメ
ントに対し名称W2を与える。この名称W2を与えたセ
グメントを以下中間セグメントW、と称す。Next, as shown in FIG. 10(B), using the search information of the intermediate segment, a segment having a starting point S within the vicinity area [8, 8, 8, 8] of the starting point S of the starting point segment W, A segment with length l of 56≦β≦720,
A search is made among the horizontal segments, and a name W2 is given to the searched horizontal segment. The segment given this name W2 will be referred to as an intermediate segment W hereinafter.
同様にして第10図(C)にも示すように次の中間セグ
メントの検索情報を用いて中間セグメントW2の終点S
の近傍領域[8,8,8,8]内に始点Sを有するセグ
メントであって56≦β≦720の長さlを有するセグ
メントを、垂直セグメントのなかから検索し、検索した
垂直セグメントに対し名称W3を与える。この名称w3
を与えたセグメントを以下中間セグメントw3と称す。Similarly, as shown in FIG. 10(C), the end point S of the intermediate segment W2 is searched using the search information of the next intermediate segment.
A segment having a starting point S within the neighborhood area [8, 8, 8, 8] and having a length l of 56≦β≦720 is searched among the vertical segments, and Give the name W3. This name w3
The segment that has been given is hereinafter referred to as intermediate segment w3.
次1こM2C図(D)1こも示すように終点セグメント
の検索情報を用いて起点セグメントw1の終点Eの近傍
領域[8,8,8,8]内に始点Sを有しかつ中間セグ
メントw3の終点Eの近傍領域[8,8,8,8]内に
終点Eを有するセグメントであって、56≦!≦720
の長ざlを有するセグメントを、水平セグメントのなか
から検索し、検索した水平セグメントに対し名称w4を
与える。As shown in the next M2C diagram (D) 1, using the search information of the end point segment, the start point S is within the vicinity area [8, 8, 8, 8] of the end point E of the start point segment w1, and the intermediate segment w3 A segment having an end point E within the neighborhood region [8, 8, 8, 8] of the end point E, and 56≦! ≦720
A segment having a length l is searched among the horizontal segments, and a name w4 is given to the searched horizontal segment.
そして検索されたW1〜w4の始点及び終点座標を閉ル
ープデータメモリ24に保存する。Then, the searched start point and end point coordinates of W1 to W4 are stored in the closed loop data memory 24.
尚、上述の例では、セグメントの長さを指定する数値及
び近傍領域を指定する数値を各セグメントにおいて等し
くしたが、各セグメント毎に異なる数値とすることが出
来る。Note that in the above example, the numerical value specifying the length of the segment and the numerical value specifying the neighboring area are the same for each segment, but they can be set to different values for each segment.
第11図(A)〜(8)は閉ループセグメント検索手段
の動作の流れの一例を示す図であり、第11図(A)は
三角形状の閉ループ検索処理に着目した動作の流れ及び
第11図(B)はn≧4のときのn角形状の閉ループ検
索処理1こ着目した動作の流れを示す。11(A) to (8) are diagrams showing an example of the flow of operation of the closed loop segment search means, and FIG. (B) shows the flow of operations focusing on n-gon closed loop search processing when n≧4.
閉ループセグメント検索手段14はセグメント抽出手段
12が各方向別のセグメントの抽出を終えると、検索辞
書+4bに保存されでいる検索情報を読み込み検索処理
を行なう。検索手段14はひとつのf!類の閉ループ検
索情報につき検索処理を終えると次の異なる閉ループの
検索情報を読み込み検索処理を行ない、よって辞書+4
bに保存されでいる全てのf!類の閉ループの検索情報
につき或は辞書14bに保存されている閉ループの検索
情報のなかから任意好適に選んだ検索情報につき、順次
に検索処理を行なう。When the segment extracting means 12 finishes extracting segments for each direction, the closed loop segment retrieval means 14 reads the retrieval information stored in the retrieval dictionary +4b and performs retrieval processing. The search means 14 is one f! When the search process is completed for the same closed-loop search information, the next different closed-loop search information is read and the search process is performed, so the dictionary +4
All f! stored in b! Search processing is sequentially performed for closed-loop search information of the same type or for search information arbitrarily and suitably selected from the closed-loop search information stored in the dictionary 14b.
以下、この発明の理解を深めるために、二角形状の閉ル
ープの検索処理の場合と、n角形状(n=4)の閉ルー
プ検索処理の場合とに分けて動作の流れにつき説明する
。Hereinafter, in order to deepen the understanding of the present invention, the flow of operations will be explained separately for the case of a closed-loop search process of a diagonal shape and the case of a closed-loop search process of an n-gon shape (n=4).
(三角形状の閉ループ検索処理)
第11図(A)にも示すように、閉ループセグメント検
索手段14は三角形状の閉ループの検索処理を開始する
と(S100) 、閉ループセグメント検索のための検
索情報例えば第8図に示す三角形ループの検索情報を読
み込み(S102) 、ざらに起点セグメント検索のた
めのセグメント情報(セグメントの始点及び終点座標)
を例えばVSEGテーブル22aから読み込み(S+0
4) 、起点セグメントに関する検索情報に基づいて読
み込んだセグメント情報が起点セグメントの条件を満足
するか否か判定する(S+06) 、条件を満足すれば
起点セグメントが検出され、及び条件を満足しなければ
起点セグメントが検出されないこととなる。(Triangular closed loop search process) As shown in FIG. 11(A), when the closed loop segment search means 14 starts the triangular closed loop search process (S100), it searches for search information for closed loop segment search, such as Read the search information for the triangular loop shown in Figure 8 (S102), and roughly search the segment information (start point and end point coordinates of the segment) for the start point segment search.
For example, read from the VSEG table 22a (S+0
4) Determine whether or not the segment information read based on the search information regarding the origin segment satisfies the conditions of the origin segment (S+06). If the conditions are satisfied, the origin segment is detected, and if the conditions are not satisfied, the origin segment is detected. The origin segment will not be detected.
1:起点セグメントを検出した場合
5106の次に、中間セグメント検索のためのセグメン
ト情報をLSEGテーブル22dから読み込み(S+0
8) 、中間セグメントに関する検索情報に基づいて読
み込んだセグメント情報が中間セグメントの条件を満足
するが否が判定する(SIIO) 、条件を満足すれば
中間セグメントが検出され、及び条件を満足しなければ
中間セグメントが検出されないこととなる。1: When a starting segment is detected Next to 5106, segment information for intermediate segment search is read from the LSEG table 22d (S+0
8) Determine whether the read segment information satisfies the intermediate segment condition based on the search information regarding the intermediate segment (SIIO). If the condition is satisfied, the intermediate segment is detected, and if the condition is not satisfied, the intermediate segment is detected. No intermediate segments will be detected.
1−1:中間セグメントを検出した場合3110の次に
、終点セグメント検索のためのセグメント情報を例えば
R3EGテーブル22cから読み込み(SiI2) 、
終点セグメントに関する検索情報に基づいて読み込んだ
セグメント情報が終点セグメントの条件を満足するが否
が判定する(SiI2) 、条件を満足すれば終点セグ
メントが検出され、及び条件を満足しなければ終点セグ
メントが検出されないこととなる。1-1: When an intermediate segment is detected Next to 3110, segment information for searching for an end point segment is read from, for example, the R3EG table 22c (SiI2),
It is determined whether the read segment information satisfies the conditions of the end point segment based on the search information regarding the end point segment (SiI2). If the condition is satisfied, the end point segment is detected, and if the condition is not satisfied, the end point segment is detected. It will not be detected.
終点セグメントが検出された場合、検出された起点、中
間及び終点セグメントは閉ループを構成するとみなされ
るので8114の次に、これらセグメントの始点及び終
点座標を閉ループデータメモリ24ニ保存しくSiI6
) 、次イテ例えばVSEGy−プル22aのセグメン
ト情報を全部読み込んだが否かによって起点セグメント
の検索を終了したか否かを判定する(SI+8) 、全
部読み込んでいなければ起点セグメントの検索@終了し
ていないので8104の処理に戻る。全部読み込んでい
れば起点セグメントの検索を終了しているので三角形状
の閉ループの検索処理を終了する(S+18) 。If an end point segment is detected, the detected start point, intermediate and end point segments are considered to constitute a closed loop, so next to 8114, the start point and end point coordinates of these segments are stored in the closed loop data memory 24.
), In the next iteration, for example, it is determined whether or not the search for the starting segment has been completed based on whether or not all of the segment information of the VSEGy-pull 22a has been read (SI+8), If not all has been read, the search for the starting segment is completed. Since there is no one, the process returns to step 8104. If all have been read, the search for the starting point segment has been completed, and the triangular closed loop search process ends (S+18).
また5114で終点セグメントが検出されなかった場合
5114の次に、例えばLS、EG子テーブル2aのセ
グメント情報を全部読み込んだか否かによって中間セグ
メントの検索1Fr終了したか否かを判定する(S+2
0)。全部読み込んでいなければ中間セグメントの検索
を終了しでいないので8108の処理に戻る。全部読み
込んでいれば中間セグメントの検索を終了しているので
3118の処理を行なう。Further, if the end point segment is not detected in 5114, next to 5114, it is determined whether or not the intermediate segment search 1Fr has been completed, for example, based on whether all the segment information in the LS and EG child tables 2a has been read (S+2
0). If the entire segment has not been read, the search for intermediate segments has not been completed, and the process returns to step 8108. If all of the segments have been read, the search for intermediate segments has been completed, so the process of 3118 is performed.
1−2:中間セグメントを検出しなかった場合5110
で中間セグメントを検出しなかった場合、5110の次
に8120で中間セグメントの検索を終了したか杏かを
判定し、その判定結果に応じた処理を行なう。1-2: 5110 when no intermediate segment is detected
If no intermediate segment is detected in step 5110, then in step 8120 it is determined whether the search for the intermediate segment has ended or not, and processing is performed in accordance with the determination result.
2:起点セグメント1fr検出しなかった場合3106
で起点セグメントを検出しなかった場合、5106の次
に8118で起点セグメントの検索を終了したか否かを
判定し、その判定結果に応じた処理を行なう。2: 3106 when starting segment 1fr is not detected
If the starting point segment is not detected at 5106, then at 8118, it is determined whether the search for the starting point segment has ended or not, and processing is performed according to the result of the determination.
(n角形状の閉ループ検索処理)
第11図(B)にも示すように、閉ループセグメント検
索手段14はn角形状例えばn=4の閉ループの検索処
理を開始すると(3200) 、閉ループセグメント検
索のための検索情報例えば第8図に示す台形ループの検
索情報を読み込み(5202)、ざらに起点セグメント
情報のためのセグメント情報を例えばVSEGテーブル
22aから読み込み(S204) 、起点セグメントに
関する検索情報に基づいて読み込んだセグメント情報が
起点セグメントの条件を満足するか否かによって起点セ
グメントを検出したか否かを判定する( 5206)。(N-gonal closed loop search process) As shown in FIG. 11(B), when the closed loop segment search means 14 starts the search process for a closed loop with an n-gon shape, for example, n=4 (3200), the closed loop segment search unit 14 starts the closed loop segment search process (3200). For example, the search information for the trapezoidal loop shown in FIG. It is determined whether a starting point segment has been detected based on whether the read segment information satisfies the conditions for a starting point segment (5206).
3:起点セグメントを検出した場合
5206の次に、iを初期化しく初期値=1)(S20
7)、中間セグメントN+検索のためのせグメント情報
を例えばLSEGテーブル22dから読み込み(S20
8) 、中間セグメントN□に間する検索情報に基づい
て読み込んだセグメント情報が中間セグメントの条件を
満足するが否が1こよって中間セグメントが検出された
か否かを判定する(3210)。3: When a starting point segment is detected Next to 5206, initialize i (initial value = 1) (S20
7), reads segment information for intermediate segment N+ search from, for example, the LSEG table 22d (S20
8) If the segment information read based on the search information between the intermediate segment N□ satisfies the intermediate segment condition, it is determined whether the intermediate segment is detected (3210).
3−1:中間セグメントを検出した場合5210の次に
、当該n角形状の中間セグメントの検索情報を全て読み
込んだが否か(i=n−2か否か)によって所定の中間
セグメントを全て検索したか否かを判定する(S212
) 。3-1: When an intermediate segment is detected Next to 5210, all the predetermined intermediate segments are searched depending on whether all the search information for the n-gonal intermediate segment has been read (whether or not i=n-2). It is determined whether or not (S212
).
全ての中間セグメントを検索していなければ、itlイ
ンクリメントしく5214) 、次の中間セグメントの
セグメント情報を例えばVSEGテーブル22aから読
み込み(S2Q8) 、5210の処理を行なう。If all intermediate segments have not been retrieved, itl is incremented (5214), the segment information of the next intermediate segment is read from, for example, the VSEG table 22a (S2Q8), and the process of 5210 is performed.
全ての中間セグメントを検索していれば5212の次に
、終点セグメント検索のためのセグメント情報を例えば
R5EGテーブル22cから読み込み(S21δ)、終
点セグメントに間する検索情報に基づいて読み込んだセ
グメント情報が終点セグメントの条件を満足するが否が
1こよって終点セグメントが検出されたが否かを判定す
る(52+8)。If all intermediate segments have been searched, next to 5212, segment information for searching for an end point segment is read from the R5EG table 22c, for example (S21δ), and the segment information read based on the search information between the end point segments is the end point. Whether the segment condition is satisfied or not is determined by 1 to determine whether the end point segment has been detected (52+8).
終点セグメントが検出された場合、検出された起点、中
間及び終点セグメントは閉ループを構成するとみなされ
るので8218の次に、゛これらセグメントの始点及び
終点座標を閉ループデータメモリ24に保存しく522
0) 、次いで例えばVSEGテーブル22aのセグメ
ント情報を全部読み込んだが否かによって起点セグメン
トの検索を終了したか否かを判定する(S222) 、
起点セグメントの検索を終了していなければ残りのセグ
メント情報を読み込むべく 5204の処理に戻る。起
点セグメントの検索を終了してればn角形状の閉ループ
の検索処理を終了する(S224) 。If an end point segment is detected, the detected start, intermediate, and end point segments are considered to constitute a closed loop, so next to step 8218, ``Save the start point and end point coordinates of these segments in the closed loop data memory 24 522.
0) Then, for example, it is determined whether the search for the starting segment has been completed based on whether all the segment information in the VSEG table 22a has been read (S222).
If the search for the starting segment has not been completed, the process returns to step 5204 to read the remaining segment information. If the search for the starting point segment has been completed, the n-gon closed loop search process is completed (S224).
また3218で終点セグメントが検出されなかった場合
、検索辞書+4bを逆に辿って再度中間セグメントの検
出ループ(5226,5228,5230,5208,
5210,5212,5214) 8行なうため、52
26(7)処理を行なう。If the end point segment is not detected at 3218, the search dictionary +4b is reversely traced and the intermediate segment detection loop (5226, 5228, 5230, 5208,
5210, 5212, 5214) 52 to do 8
26(7) Processing is performed.
5226では中間セグメントNlの検索を終了したか否
かを判定する(S226) 、例えばi=2とすればV
SEGテーブル22aのセグメント情報を全部読み込ん
だか否かによって第2番目の中間セグメントN2の検索
を終了したか否かを判定する。In step 5226, it is determined whether the search for the intermediate segment Nl has ended (S226). For example, if i=2, V
It is determined whether or not the search for the second intermediate segment N2 has been completed, depending on whether or not all the segment information in the SEG table 22a has been read.
中間セグメントN、の検索を終了していな1すれば残り
のセグメント情報につき当該中間セグメントN +の検
索を行なうべく 3208の処理に戻る。If the search for the intermediate segment N is not completed, the process returns to step 3208 to search for the remaining segment information for the intermediate segment N+.
当該中間セグメントNIの検索を終了していれば、当該
中音セグメントNl (例えばi=mとなる中間セグ
メント)のひとつ前の中間セグメントN、(例えばi=
m−1となる中間セグメント)の検索のためiを1だけ
減算しく5228) 、次いでi=oか否カヲ判定すル
(3230) 。If the search for the intermediate segment NI has been completed, the intermediate segment N immediately before the intermediate segment Nl (for example, the intermediate segment where i=m), (for example, the intermediate segment where i=m) is searched.
In order to search for the intermediate segment (m-1), i is subtracted by 1 (5228), and then it is determined whether or not i=o (3230).
i=0であれば、当該検索にかかる起点セグメントを含
む閉ループ図形は検出されなかったことを表すので、次
の起点セグメントを検索し次の起点セグメントを含む閉
ループ図形を検出するため、5222の処理に戻る。If i=0, it means that a closed loop figure including the starting point segment related to the search was not detected, so the process of 5222 is performed to search for the next starting point segment and detect the closed loop figure including the next starting point segment. Return to
i=0でなければ、ひとつ前の中間セグメントN、(例
えばi=m−1となる中間セグメント)の検索を終了し
たか否かを判定しく5226) 、5226の判定結果
に応じた処理を行なう。If i = 0, it is determined whether the search for the previous intermediate segment N (for example, the intermediate segment where i = m-1) has been completed (5226), and processing is performed according to the determination result of 5226. .
3−2:中間セグメントを検出しなかった場合8210
で中間セグメントを検出しなかった場合、検索中の当該
中間セグメントに間する全てのセグメント情報の読出し
を行なったか否かによって当該中間セグメントの検索を
終了したか否かを判定する(S226) 。3-2: 8210 when intermediate segment is not detected
If no intermediate segment is detected, it is determined whether the search for the intermediate segment is finished based on whether all segment information between the intermediate segment being searched has been read (S226).
当該中間セグメントの検索を終えたならば検索辞書+4
bを逆に辿ってひとつ前の中間セグメントの検索を行な
うため5228.5230の処理を行なう。After completing the search for the intermediate segment, search dictionary +4
Steps 5228 and 5230 are performed to search for the previous intermediate segment by tracing b backwards.
検索を終えていなければ、当該中間セグメントの検索の
ため残りのセグメント情報を読み込むべく3208の処
理に戻る。If the search has not been completed, the process returns to step 3208 to read the remaining segment information in order to search for the intermediate segment.
2:起点セグメントを検出しなかった場合5206で起
点セグメントを検出しなかった場合、5206の次に8
222で起点セグメントの検索を終了したか否かを判定
し、その判定結果に応じた処理を行なう。2: If the starting point segment is not detected If the starting point segment is not detected in 5206, then 8
At step 222, it is determined whether the search for the starting point segment has ended or not, and processing is performed in accordance with the determination result.
この発明は上述した実施例にのみ限定されるものではな
く、従って各構成成分の構成、動作、動作の流れ、動作
条件及び数値的条件は一例にすぎず従ってこの発明は上
述した実施例にのみ限定されるものではなく、各構成成
分の構成、動作、動作の流れ、動作条件及び数値的条件
を任意好適に変更することが出来る。This invention is not limited to the embodiments described above; therefore, the configuration, operation, flow of operation, operating conditions, and numerical conditions of each component are merely examples, and therefore, the invention is limited to the embodiments described above. The present invention is not limited to this, and the configuration, operation, flow of operation, operating conditions, and numerical conditions of each component can be changed as desired.
(発明の効果)
上述した説明からも明らかなように、この発明の閉ルー
プ図形検出処理によれば、それぞれの走査方向における
ストローク成分をサブパタンとし、このサブパタンの始
点及び終点を結ぶ線分をセグメントとして検出するので
、原パタンの分岐や、交差や、接合部の部分の形状をセ
グメントにおいで従来よりも忠実に歪みなく表わすこと
が出来る。従って歪み補正のための処理が必要とならず
閉ループ検出処理@簡単化出来るので装置構成を従来よ
りも簡素化出来る。(Effects of the Invention) As is clear from the above description, according to the closed-loop figure detection processing of the present invention, stroke components in each scanning direction are treated as sub-patterns, and line segments connecting the start and end points of these sub-patterns are treated as segments. Since the detection is performed, the shapes of branches, intersections, and joints of the original pattern can be represented in segments more faithfully and without distortion than before. Therefore, since processing for distortion correction is not required and closed loop detection processing can be simplified, the device configuration can be made simpler than before.
またサブパタンの始点及び終点を結ぶ線分をセグメント
として検出するので、原パタンのM線部分の直進性を従
来よりも忠実にセグメントに反映させることが出来る。Furthermore, since the line segment connecting the start point and end point of the sub-pattern is detected as a segment, the straightness of the M line portion of the original pattern can be more faithfully reflected in the segment than before.
従フて原パタンの直進性の保存が従来よりも良好である
ので、ループ図形の形状記述を従来よりも容易に行なえ
る。また直進性の保存が従来よりも良好であるので、検
出すべき閉ループ形状の検索条件を簡略化出来、従って
閉ループ図形検出処理を従来よりも単純化することが出
来る。Since the straightness of the follower pattern is better preserved than before, the shape description of loop figures can be more easily performed than before. Furthermore, since straightness is preserved better than before, the search conditions for the closed-loop shape to be detected can be simplified, and the closed-loop figure detection process can therefore be simpler than before.
ざらにこの発明の閉ループ図形検出処理によれば、検索
されたセグメントの端点の近傍領域内に端点を有するセ
グメントを順次に検索することによって、閉ループを構
成する起点セグメント、中間セグメント及び終点セグメ
ントを順次検出する。検索されたセグメントの端点の近
傍領域内に端点を有するセグメントを検索する処理は単
純であり、また上述のようなセグメントを検出する処理
も単純であるので、閉ループ図形の検出処理を従来より
も単純化し、検出処理の高速化を図れる。Roughly speaking, according to the closed-loop figure detection processing of the present invention, by sequentially searching for segments that have endpoints within the vicinity of the endpoints of the searched segments, the starting point segment, intermediate segment, and end point segment constituting a closed loop are sequentially detected. To detect. The process of searching for a segment whose endpoint is within the vicinity of the endpoint of the searched segment is simple, and the process of detecting segments as described above is also simple, making the process of detecting closed-loop shapes simpler than before. speed of detection processing.
第1図はこの発明の詳細な説明に供する機能ブロック図
、
第2図は環パタンの説明に供する図、
第3図(A)〜(D)はサブパタン抽出の説明に供する
図、
第4図(A)〜(B)はサブパタンの始点及び終点の抽
出原理の説明に供する図、
第5図はセグメント化された環パタンを示す図、
第6図(A)〜(D)はセグメントの説明に供する図、
第7図(A)〜(D)はセグメントテーブルの説明に供
する図、
第8図は検索情報の記述例を示す図、
第9図(A)〜(C)は検出される閉ループの形状の例
を示す図、
第10図(A)〜(D)は閉ループセグメント検索処理
の流れの一例を示す図、
第11図(A)〜(B)は閉ループセグメント検索手段
の動作の一例を示す図である。
0・・・サブパタン抽出手段
Oa・−v s p抽出手段
Ob・−HS P抽出手段
Oc・・・R8P抽出手段
Od・・・LSP抽出手段
2・・・セグメント抽出手段
2a−VSEG抽出手段
2b・・・H3EG抽出手段
2cmR8EG抽出手段
2d−LSEG抽出手段
4・・・閉セグメント検索手段
4a・・・CPU、 +4b−・・検索辞書。FIG. 1 is a functional block diagram for explaining the invention in detail; FIG. 2 is a diagram for explaining ring patterns; FIGS. 3(A) to (D) are diagrams for explaining sub-pattern extraction; FIG. (A) to (B) are diagrams for explaining the principle of extraction of the start and end points of subpatterns. Figure 5 is a diagram showing a segmented ring pattern. Figure 6 (A) to (D) is an explanation of segments. Figures 7 (A) to (D) are diagrams used to explain the segment table. Figure 8 is a diagram showing an example of description of search information. Figures 9 (A) to (C) are diagrams used to describe the segment table. 10(A) to 10(D) are diagrams showing an example of the flow of the closed loop segment search process, and FIGS. 11(A) to 11(B) are diagrams showing the operation of the closed loop segment search means. It is a figure showing an example. 0...Sub pattern extraction means Oa・-v sp extraction means Ob・-HS P extraction means Oc...R8P extraction means Od...LSP extraction means 2...Segment extraction means 2a-VSEG extraction means 2b. ...H3EG extraction means 2cmR8EG extraction means 2d-LSEG extraction means 4...Closed segment search means 4a...CPU, +4b-...Search dictionary.
Claims (7)
換し、かつ量子化することにより黒ビット及び白ビット
で表されるディジタル信号の原パタンを作成し、該原パ
タンを所定の複数の方向に走査し、それぞれの走査方向
のストローク成分をサブパタンとして抽出するサブパタ
ン抽出手段と、前記サブパタン抽出時の走査方向におけ
る前記サブパタンの始端点及び終端点の座標を抽出する
セグメント抽出手段と、 前記サブパタンの始端点及び終端点を結ぶ線分を当該サ
ブパタンを表すセグメントとし、該セグメントのなかか
ら閉ループ図形を構成する起点セグメント、所定個数の
中間セグメント及び終点セグメントを順次に検索するた
め、検索されたセグメントの端点の近傍領域内に端点を
有するセグメントを順次に検索する閉ループセグメント
検索手段とを備えて成ることを特徴とする閉ループ図形
検出装置。(1) Create an original pattern of a digital signal represented by black bits and white bits by photoelectrically converting and quantizing an information medium containing at least a closed-loop figure, and scan the original pattern in a plurality of predetermined directions. subpattern extracting means for extracting stroke components in each scanning direction as a subpattern; segment extraction means for extracting coordinates of a starting point and a terminal point of the subpattern in the scanning direction at the time of extracting the subpattern; and a starting point of the subpattern. The line segment connecting the sub-pattern and the terminal point is taken as the segment representing the sub-pattern, and in order to sequentially search for the starting point segment, a predetermined number of intermediate segments, and the ending point segment that constitute the closed loop figure from among the segments, the end point of the searched segment is 1. A closed-loop figure detection device comprising: closed-loop segment search means for sequentially searching for segments having endpoints within a neighboring region.
に連続する図形構成画素から成る画素群であって該連続
の長さlが所定の長さとなる画素群によって構成される
ストローク成分としたことを特徴とする請求項1に記載
の閉ループ図形検出装置。(2) The sub-pattern is a stroke component consisting of a pixel group consisting of continuous figure constituent pixels in the scanning direction at the time of sub-pattern extraction, the continuous length l of which is a predetermined length. The closed-loop figure detection device according to claim 1.
(但し、Nは定数及びwは前記原パタンにおける線巾)
となる図形構成画素群によって構成されるストローク成
分としたことを特徴とする請求項2に記載の閉ループ図
形検出装置。(3) The sub-pattern has the continuous length l≧Nw
(However, N is a constant and w is the line width in the original pattern)
3. The closed-loop figure detection device according to claim 2, wherein the stroke component is constituted by a group of figure constituent pixels.
サブパタンを走査し、各走査列毎に得る白ビットから黒
ビットへの変化点の座標位置及びその個数、並びに黒ビ
ットから白ビットへの変化点の座標位置及びその個数と
に基づいて前記サブパタンの始端点及び終端点の座標を
抽出する手段としたこと を特徴とする請求項1〜3のいずれか一項に記載の閉ル
ープ図形検出装置。(4) The segment extraction means scans the subpattern in a direction forming a predetermined angle with the scanning direction during subpattern extraction, and the coordinate position and number of points of change from white bits to black bits obtained for each scanning line; and means for extracting the coordinates of the starting point and the ending point of the sub-pattern based on the coordinate position and the number of points of change from black bits to white bits. Closed-loop figure detection device as described in .
点及び終端点の座標を、座標の原点との位置関係に関連
させてしかも各走査方向別に保存する手段としたことを
特徴とする請求項1〜4のいずれか一項に記載の閉ルー
プ図形検出装置。(5) The segment extraction means is characterized in that the coordinates of the starting point and ending point of each segment are stored in relation to the positional relationship with the origin of the coordinates and for each scanning direction. 5. The closed-loop figure detection device according to any one of 4 to 5.
ントを検索する処理と、検索された起点セグメントの一
方の端点の近傍領域内に一方の端点を有する中間セグメ
ントを検索する処理と、検索された中間セグメントの他
方の端点の近傍領域内に一方の端点を有すると共に前記
起点セグメントの他方の端点の近傍領域内に他方の端点
を有する終点セグメントを検索する処理とを行なう手段
としたこと を特徴とする請求項1〜5のいずれか一項に記載の閉ル
ープ図形検出装置。(6) The closed-loop segment search means includes a process of searching for a starting point segment, a process of searching for an intermediate segment having one end point within a region near one end point of the searched starting point segment, and a process of searching for the found intermediate segment. A method of searching for an end point segment having one end point within a region near the other end point of the starting point segment and having the other end point within a region near the other end point of the starting point segment. The closed-loop figure detection device according to any one of Items 1 to 5.
ントを検索する処理と、検索された起点セグメントの一
方の端点の近傍領域内に一方の端点を有する中間セグメ
ントを検索する処理と、検索された中間セグメントの他
方の端点の近傍領域内に一方の端点を有する次の中間セ
グメントを検索する処理を所定回数行なう処理と、所定
個数目に検索された中間セグメントの他方の端点の近傍
領域内に一方の端点を有すると共に前記起点セグメント
の他方の端点の近傍領域内に他方の端点を有する終点セ
グメントを検索する処理とを行なう手段としたことを特
徴とする請求項1〜6のいずれか一項に記載の閉ループ
図形検出装置。(7) The closed-loop segment search means includes a process of searching for a starting point segment, a process of searching for an intermediate segment having one end point within a region near one end point of the searched starting point segment, and a process of searching for the found intermediate segment. The process of searching for the next intermediate segment that has one end point within the vicinity area of the other end point of is performed a predetermined number of times, and 7. The means for searching for an end point segment having the other end point in a vicinity area of the other end point of the starting point segment. Closed loop figure detection device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63200357A JPH0250278A (en) | 1988-08-11 | 1988-08-11 | Closed loop graphic detecting device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63200357A JPH0250278A (en) | 1988-08-11 | 1988-08-11 | Closed loop graphic detecting device |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0250278A true JPH0250278A (en) | 1990-02-20 |
Family
ID=16422955
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63200357A Pending JPH0250278A (en) | 1988-08-11 | 1988-08-11 | Closed loop graphic detecting device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0250278A (en) |
-
1988
- 1988-08-11 JP JP63200357A patent/JPH0250278A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wenyin et al. | From raster to vectors: extracting visual information from line drawings | |
US4654873A (en) | System and method for segmentation and recognition of patterns | |
Lo et al. | Gray-scale Hough transform for thick line detection in gray-scale images | |
CA2401065C (en) | Document matching and annotation lifting | |
JPH0250278A (en) | Closed loop graphic detecting device | |
Ye et al. | Document image matching and annotation lifting | |
Miyatake et al. | Contour representation of binary images using run-type direction codes | |
US5426712A (en) | Method and apparatus for describing a character image based on its contours, and for classifying the character image for character recognition based on a resulting contour-based description of the character image | |
Pavlidis | Advanced Segmentation Techniques | |
KR100259804B1 (en) | Letter cognition method for guidepost shape | |
KR19990027482A (en) | How to set the relation of object structure straight lines in image in pattern recognition system | |
KR100295245B1 (en) | A parallel thinning method using weighted value | |
KR100266309B1 (en) | Closed Curve Extraction Method | |
JP2522511B2 (en) | Image contour tracking unit | |
Hashemi et al. | The effects of image enhancement in OCR systems: a prototype | |
JP2650443B2 (en) | Line figure vectorization method | |
JP3037504B2 (en) | Image processing method and apparatus | |
JPH0253192A (en) | Character string area detecting method | |
JPS59103178A (en) | Stroke extracting device of linear pattern | |
RAGNEMALM | Fast edge smoothing in binary images using Euclidean metric | |
JPH02206886A (en) | Symbol detecting device | |
EP0682319A2 (en) | Improvements in image processing | |
Ablameyko et al. | Binary Image Processing and the Raster to Vector Transformation | |
Ablameyko et al. | Modified distance transform of line patterns computed by ordered propagation | |
JP2688666B2 (en) | How to vectorize shapes |