JPS6174076A - Segment pattern preparing system - Google Patents

Segment pattern preparing system

Info

Publication number
JPS6174076A
JPS6174076A JP59194620A JP19462084A JPS6174076A JP S6174076 A JPS6174076 A JP S6174076A JP 59194620 A JP59194620 A JP 59194620A JP 19462084 A JP19462084 A JP 19462084A JP S6174076 A JPS6174076 A JP S6174076A
Authority
JP
Japan
Prior art keywords
point
line segment
pattern
segment pattern
memory
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
JP59194620A
Other languages
Japanese (ja)
Other versions
JPH0312347B2 (en
Inventor
Kenji Suzuki
健司 鈴木
Seiji Hata
清治 秦
Yukiro Tsuji
辻 征郎
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP59194620A priority Critical patent/JPS6174076A/en
Publication of JPS6174076A publication Critical patent/JPS6174076A/en
Publication of JPH0312347B2 publication Critical patent/JPH0312347B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To compress segment pattern data which becomes necessary in a high-speed polygonal approximation by reversing the later direction of travel from right to left when necessary and expressing a shape of two segment patterns with the data for one piece, in accordance with the direction of travel at the first crossover point. CONSTITUTION:A control part 100 controls a flow of the necessary processing to respective parts and an area characteristic is extracted by an area characteristic extracting 110 and an area characteristic memory 111. Here, a segment pattern is expressed by a two-dimensional arrangement of 3Xn, and this is stored in a memory 115 as pattern data. The second attached letter value of arrangement corresponds to an n number of points on a segment pattern expressed by a point row and the first attached letter corresponds to three directions of travel in respective points, namely, turning to the left, going straight and turning to the right. A flag, which shows with on and off that to compress a shaft symmetrical pattern, the point row is already turned to the right or to the left or continues to go straight only, is installed, and by limiting the direction turned first to one side, only one side of shaft symmetrical patterns is made and the data are compressed to half.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、画像処理による部品認識装置に用いられる線
分パターン作成方式に係り、特にディジタル画像上にお
いて所定の接続関係を有する輪郭画素列(輪郭点列)を
線分で近似する処理を高速で実行するのに好適な線分パ
ターン作成方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to a line segment pattern creation method used in a component recognition device using image processing. The present invention relates to a line segment pattern creation method suitable for performing a process of approximating a sequence of points) with line segments at high speed.

〔発明の背景〕[Background of the invention]

従来、画像処理の高速性、柔軟性のために部品パターン
を多角形近似して部品認識を行うことが提案されている
。この際に、すべての線分パターンを記憶しておき、部
品の輪郭点列をこれと照合することにより多角形の辺を
高速に抽出することが行われている。これについては、
例えば、昭和58年3月10日発行の昭和58年電気学
会全国大会講演論文集〔15上論文番号134Gニ[線
分化パターンマツチングによる部品認識でいる。
Conventionally, it has been proposed to perform component recognition by approximating a component pattern into a polygon for the purpose of high-speed and flexible image processing. At this time, all line segment patterns are stored and the sides of the polygon are extracted at high speed by comparing the contour point sequence of the part with this. Regarding this,
For example, in the Proceedings of the National Conference of the Institute of Electrical Engineers of Japan published on March 10, 1988 [15, paper number 134G], parts recognition is performed by line segmentation pattern matching.

しかし、このような従来の方法では、線分化処理で用い
る線分パターンデータは、ある長さ以内の直線パターン
をすべて含むため、メモリサイズが大きくなり、装置の
小型化並びに経済化の点で問題であった。
However, in such conventional methods, the line segment pattern data used in line segmentation processing includes all straight line patterns within a certain length, resulting in a large memory size, which poses a problem in terms of downsizing and economical equipment. Met.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、上記した従来の間頌点を解決し、高速
多角形近似において必要となる線分パターンデータを圧
縮し、小規模な画像処理装置でも実行を可能とする線分
パターン作成方式を提供することにある。
The purpose of the present invention is to solve the above-mentioned problems of the conventional art, to compress line segment pattern data necessary for high-speed polygonal approximation, and to provide a line segment pattern creation method that can be executed even by a small-scale image processing device. Our goal is to provide the following.

〔発明の概要〕[Summary of the invention]

線分パターンは2本1組で軸対称となっている。これを
進行方向系列として見ると、対応する各点において左右
を逆転したものになっている。そこで、本発明では、い
ずれか片方のみを保持し、最初の折れ点での進行方向に
従って、必要な時は以後の進行方向を左右逆転すること
で、2つの線分パターンの形状を1つ分のデータで表現
するようにしたものである。
The line segment pattern is axially symmetrical in pairs. When viewed as a traveling direction series, the left and right sides are reversed at each corresponding point. Therefore, in the present invention, by holding only one of the two line segment patterns and reversing the subsequent direction of movement from side to side according to the direction of movement at the first bending point, the shape of the two line segment patterns is divided into one part. The data is expressed as follows.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明の実施例を図に従って詳細に説明する。 Embodiments of the present invention will be described in detail below with reference to the drawings.

第1図は、本発明て係る画像処理装置の一実施例を示す
ブロック図である。
FIG. 1 is a block diagram showing an embodiment of an image processing apparatus according to the present invention.

ここで、100は、以下に述べる各部に対して所要の処
理の流れを制御する制御部である。r:J1〜104は
、前処理に係るもので、101は、入力制御部、102
は、画像メそり、+05は、前処理部、104は、領域
情報メモリである。105と106は、輪郭抽出処理に
係るもので、105は、輪郭抽出部、106は、輪郭メ
モリである。107〜109は、線分化処理に係るもの
で、107は、線分化処理部、115は線分パターンメ
モリ、108は、線分化情報メモリ、109は、辞書パ
ターンメモリである。110と111は、領域特徴抽出
処理に係るもので、110は、領域特徴抽出部、111
は、領域特徴メモリである。112〜114は、パター
ンマツチング処理罠係るもので112ハ共通領域抽出部
、113は、共通領域メモリ、114は、認識処理部で
ある。
Here, 100 is a control unit that controls the flow of required processing for each unit described below. r: J1 to 104 are related to preprocessing, 101 is an input control unit, 102
is an image memory, +05 is a preprocessing unit, and 104 is an area information memory. 105 and 106 are related to contour extraction processing; 105 is a contour extraction unit; and 106 is a contour memory. Reference numerals 107 to 109 relate to line segmentation processing; 107 is a line segmentation processing unit; 115 is a line segment pattern memory; 108 is a line segmentation information memory; and 109 is a dictionary pattern memory. 110 and 111 are related to region feature extraction processing, 110 is a region feature extraction unit, 111
is the region feature memory. Reference numerals 112 to 114 are related to pattern matching processing, and 112 is a common area extraction unit, 113 is a common area memory, and 114 is a recognition processing unit.

まず、入力された画像データは、入力制御部101でデ
ィジタル化および所定の閾値で2値化された後、濃淡画
像データ、2値画像データとして画像メモリ102に入
力、記憶される。
First, input image data is digitized and binarized using a predetermined threshold value by the input control unit 101, and then input and stored in the image memory 102 as grayscale image data and binary image data.

画像メモ1J102に記憶された画像データは、はじめ
に前処理部105によって画像上のどの領域を対象物体
領域とするかが決定された後、その領域の代表点の位置
情報が領域情報メモリ104に記憶される。
In the image data stored in the image memo 1J102, the preprocessing unit 105 first determines which area on the image is to be the target object area, and then the position information of the representative point of that area is stored in the area information memory 104. be done.

次に、輪郭抽出部105は、上記の代表点の位置情報に
基づいて探索始点を決定し、画像上の指定領域の輪郭画
素を順次に探索し、例えばその中心座標値を輪郭メモリ
106に記憶させる。
Next, the contour extraction unit 105 determines a search start point based on the position information of the representative point, sequentially searches for contour pixels in the specified area on the image, and stores, for example, the center coordinate value in the contour memory 106. let

その中心座標値により、線分化処理部107は輪郭画素
の中心を表わす点列を1点ずつたどりながら、線分パタ
ーンメモリ115にあらかじめ設定されている線分パタ
ーンデータと照合して線分に近似し、その線分の端点、
すなわち、その領域を多角形近似した当該各頂点座標を
順次に線分化情報メモリ10Bに記憶させる。その線分
化r前止は、辞書パターンの登録時には、辞書パターン
メモリ109へ移される。
Based on the center coordinate values, the line segmentation processing unit 107 approximates the line segment by tracing the point sequence representing the center of the contour pixel one by one and comparing it with the line segment pattern data preset in the line segment pattern memory 115. and the end point of the line segment,
That is, the coordinates of each vertex obtained by approximating the area to a polygon are sequentially stored in the line segmentation information memory 10B. The line segment r prefix is transferred to the dictionary pattern memory 109 when a dictionary pattern is registered.

また、領域特徴抽出部110&工、指定領域の特徴(例
えば面積1重心、慣性主軸、最大長1周囲長等)を線分
化情報メモリ108の内容から求め、領域特徴メモリ1
11に記憶させる。辞書パターン登録時には、その特徴
情報は辞書パターンメモリ109に記憶される。
In addition, the region feature extraction unit 110 & extracts features of the specified region (for example, area 1 center of gravity, principal axis of inertia, maximum length 1 perimeter, etc.) from the contents of the line segmentation information memory 108,
11 to be memorized. When registering a dictionary pattern, its characteristic information is stored in the dictionary pattern memory 109.

更に、共通領域抽出部112は、現時点で入力されたパ
ターン(線分化情報メモリ108に格納されているもの
)と辞書パターン(辞書パターンメモリ109に格納さ
れているもの)とを、両方の特徴が一致するように(例
えば、重心座標が一致するように、または慣性主軸方向
が一致するように等)、入カバターン側の座標変換をし
た後、両パターンの共通領域(種図形)を同様に頂点列
として求め、共通領域メモリ113に記録する。
Furthermore, the common area extracting unit 112 extracts the currently input pattern (stored in the line segmentation information memory 108) and the dictionary pattern (stored in the dictionary pattern memory 109) so that the characteristics of both After converting the coordinates on the input cover pattern side so that they match (for example, so that the barycenter coordinates match or the principal axis of inertia directions match), the common area (seed shape) of both patterns is similarly converted to a vertex. It is obtained as a column and recorded in the common area memory 113.

最後に1認識処理部114は、共通領域(種図形)の面
積を算出し、これと辞書パターンまたは入カバターンの
面積との比率を求め、その値が所定値以上になった場合
、両パターンは一致しているものと判定して、認識結果
を出力する。
Finally, the 1 recognition processing unit 114 calculates the area of the common area (seed figure), calculates the ratio of this to the area of the dictionary pattern or input pattern, and if the value exceeds a predetermined value, both patterns are It is determined that there is a match and the recognition result is output.

もし、両パターンが一致せず、しかも辞書パターンが複
数あるときは、第2.第5の辞書パターンとのマツチン
グ処理を同様に繰り返す。なお、認識処理部114では
、一致した両パターンの変換前の相対位置から入カバタ
ーンの位置。
If the two patterns do not match and there are multiple dictionary patterns, the second. The matching process with the fifth dictionary pattern is repeated in the same way. Note that the recognition processing unit 114 calculates the position of the input cover turn from the relative position before conversion of both matching patterns.

姿勢情報も出力する。Posture information is also output.

上記の一連の画像処理において、本発明の要部となる、
線分パターンメモリ115で用いられる線分パターンの
作成方法とそれを用いた処理について、次に説明する。
In the above series of image processing, the main part of the present invention is
Next, a method of creating a line segment pattern used in the line segment pattern memory 115 and processing using the same will be described.

線分化処理部107で実行される多角形近似は対象とす
る画像領域の輪郭を追跡し、連続する輪郭点列を直線と
見なせる時、その両端点を多角形の頂点とする処理であ
る。
The polygonal approximation performed by the line segmentation processing unit 107 is a process in which the outline of the target image area is traced, and when a series of continuous outline points can be regarded as a straight line, both end points thereof are set as the vertices of the polygon.

輪郭線の考え方には、第2図に示すように輪郭画素の中
心を輪郭線とする考え方(A)、(B)と領域画素と背
景画素の境界線を輪郭線とする考え方(C)、(D)の
2通りがあり、更に、連続する輪郭点の隣接状態には、
縦横の隣接だけを考える4連結(B) 、 (D)と、
斜めの隣接も考慮にいれる8連結(A) 、 (C)の
2通りがある。従って、輪郭線の追跡には(A)〜(D
)の計4通りの方法がある。但しこのうち境界8連結(
C)は、画素の値と一意に対応しないため意味が無い。
As shown in Figure 2, there are two ways to think about contour lines: (A) and (B), where the center of a contour pixel is the contour line, and (C), where the boundary line between area pixels and background pixels is the contour line. There are two ways (D), and the adjacency state of continuous contour points is as follows:
4-connection (B), (D) considering only vertical and horizontal adjacency,
There are two ways, 8-connection (A) and (C), which take diagonal adjacency into consideration. Therefore, for contour tracing, (A) to (D
) There are four methods in total. However, among these, 8 boundaries are connected (
C) is meaningless because it does not uniquely correspond to the pixel value.

各々の場合、追跡の方向には、第2図(cL)。In each case, the direction of tracking is shown in Figure 2 (cL).

(α・)、(A)、(Li)に示すような可能性がある
。以後は境界4連結(D)で輪郭線を追跡する場合につ
いて説明する。
There are possibilities as shown in (α・), (A), and (Li). Hereinafter, a case will be described in which a contour line is traced using boundary 4 connection (D).

輪郭点列の例を第5図に示す。各輪郭点は図中矢印で示
すように固有の進行方向を持っており、輪郭線の形状は
、この進行方向の列で表わされる。長さに制限を加える
と、ある条件のも □とで線分と見なされる点列は、有
限個数の進行方向列となる。線分と見なす条件は、例え
ば、中心線からの距離の許容最大値を定め、すべての点
がこれを満足する点列を線分とする、などが用いられる
。線分パターンの個数、長さが有限なので、すべての線
分パターンを、人工的に作ることができる。
An example of a contour point sequence is shown in FIG. Each contour point has its own direction of movement, as indicated by the arrow in the figure, and the shape of the contour line is represented by a column of this direction of movement. If a restriction is placed on the length, the sequence of points that are considered to be line segments under certain conditions □ becomes a finite number of sequences in the direction of travel. The condition for considering a line segment is, for example, that a maximum permissible distance from the center line is determined, and a line segment is a point sequence in which all points satisfy this value. Since the number and length of line segment patterns are finite, all line segment patterns can be created artificially.

線分パターンの表現形式、およびこれを用いた多角形近
似の例を第4図に示す。
FIG. 4 shows an example of a representation format of a line segment pattern and polygon approximation using the same.

線分パターンは、第4図(α)K示すように、5×ルの
2次元配列で表わされ、これがパターンデータとしてメ
モリ115に記憶される。配列の第2添字値は、点列で
表わされる線分パターン上のが個の点に対応し、第1添
字値は各点における3つの進行方向、すなわち、左折、
直進、右折に対応する。配列要素の内容は、ある点にお
いて進行方向が決まった時、その方向に進んだ時の次の
点の番号、即ちポインタである。例えば始点°0“にお
いて進行方向が右折と決まったとき、その方向に進んだ
ときの次の点の番号が°187”として示される。但し
、点列は直線とみなし得るものであるという制約がある
ために、各点において5つの進行方向がすべて許される
とは限らない。県止方向に対応する要素にはエンドマー
クENDが記入されており、輪郭線の追跡中にこれを検
出した時は、検出した点を線分の終了点と見なし、これ
を多角形の頂点とじて登録する。第4図(b)において
は、線分の始点Sにおいて→分パターンの始点102か
ら追跡を始め、点EでエンドマークENDを検出してこ
の点”533°を多角形の頂点とし、線分パターンのポ
インタを始点”01にもどして新しい線分の追跡を始め
る。図中、各点の番号は線分パターンの点番号である。
The line segment pattern is represented by a 5×2 two-dimensional array as shown in FIG. 4(α)K, and this is stored in the memory 115 as pattern data. The second subscript value of the array corresponds to the points on the line segment pattern represented by the dot sequence, and the first subscript value corresponds to the three directions of travel at each point, namely, left turn, left turn,
Supports going straight and turning right. The contents of the array element are the number, ie, the pointer, of the next point when the direction of movement is determined at a certain point. For example, when the direction of travel is determined to be a right turn at the starting point °0", the number of the next point when traveling in that direction is indicated as °187". However, since there is a restriction that the point sequence can be regarded as a straight line, all five traveling directions are not always allowed at each point. An end mark END is written in the element corresponding to the prefecture direction, and when this is detected while tracing the contour, the detected point is regarded as the end point of the line segment, and this is the apex of the polygon. and register. In Fig. 4(b), at the starting point S of the line segment, tracking starts from the starting point 102 of the → minute pattern, the end mark END is detected at point E, this point 533° is set as the vertex of the polygon, and the line segment Return the pattern pointer to the starting point "01" and begin tracing a new line segment. In the figure, the number of each point is the point number of the line segment pattern.

次に、この線分パターンを用いた多角形近似の手順を第
5図を用いて第4図を例にとり説明する。多角形近似は
、輪郭点を1点ずつ追跡しながら、同時に線分パターン
を各点での進行方向に従ってボ“インクを選択して追跡
する。まず、追跡開始点、例えば、第4図(b)の3点
を多角形の第1頂点として登録し、線分パターンのポイ
ンタを“0”にして初期設定する(ステップ501)。
Next, the procedure of polygon approximation using this line segment pattern will be explained using FIG. 5 and taking FIG. 4 as an example. In polygonal approximation, contour points are traced one by one, and at the same time, a line segment pattern is traced by selecting the ink according to the direction of movement at each point. First, the tracing starting point, for example, Fig. 4 (b ) are registered as the first vertices of the polygon, and the line segment pattern pointer is set to "0" for initialization (step 501).

以後、ステップ501〜507の処理をくり返す。まず
、追跡開始点SKおける進行方向を決定する(ステップ
502)。ここで、進行方向の決定方法について第5図
を用いて説明する。
Thereafter, the processes of steps 501 to 507 are repeated. First, the traveling direction at the tracking start point SK is determined (step 502). Here, a method for determining the traveling direction will be explained using FIG. 5.

第5図において、画素Aが部品領域に含まれているとす
る。まず、画素Bが部品領域に含まれているかどうか調
べ、含まれていない時は、進行方向は右折とする。次に
、画素Bが部品領域に含まれているかどうか調べ、含ま
れていない時進行方向を前進、含まれている時は左折と
する。画素が部品領域に含まれているか否かの判定は、
様々な方法があり、例えば2値画像ならば輪郭メモリ1
06から読み出した値が1#が“0#かで判定できる。
In FIG. 5, it is assumed that pixel A is included in the component area. First, it is checked whether pixel B is included in the component area, and if it is not included, the traveling direction is set to be a right turn. Next, it is checked whether pixel B is included in the component area, and if it is not included, the moving direction is set to move forward, and if it is included, the moving direction is set to be a left turn. To determine whether a pixel is included in the component area,
There are various methods, for example, for a binary image, the contour memory 1
It can be determined whether the value read from 06 is 1# or "0#."

次に、線分パターンのポインタの指すスロットを参照し
、進行方向に従って、次のポインタを選択する(ステッ
プ505)。例えば、第4図の場合、ポインタ“0”の
エリアを参照し、この場合、進行方向が第4図(b)に
示すように右折であるので、次のポインタ1187”を
選択する。
Next, referring to the slot pointed to by the pointer of the line segment pattern, the next pointer is selected according to the direction of movement (step 505). For example, in the case of FIG. 4, the area of pointer "0" is referred to, and in this case, since the direction of travel is a right turn as shown in FIG. 4(b), the next pointer 1187'' is selected.

そして、もし次のポインタがエンドマークENDならば
(ステップ5o4)、その時点の輪郭点を多角形の頂点
として新たに線分化情報メモリ108に登録し、ポイン
タを°0″にもどす(ステップ505)。
If the next pointer is the end mark END (step 5o4), the contour point at that point is newly registered in the line division information memory 108 as the vertex of the polygon, and the pointer is returned to °0'' (step 505). .

次に、進行方向に従って、次の輪郭点に進み(ステップ
506)、終了条件、例えば輪郭線を1周して追跡開始
点Sにもどったかどうかをチェックしくステップ507
)、終了条件が満たされるまでステップ502からステ
ップ507までをくり返す。
Next, proceed to the next contour point according to the traveling direction (step 506), and check the end condition, for example, whether or not the contour has been circled once and returned to the tracking start point S.Step 507
), steps 502 to 507 are repeated until the termination condition is satisfied.

例えば、第4図(6)の輪郭線を第4図(α)の線分パ
ターンデータに従って追跡する場合、ポインタ”01か
らスタートし、進行方向(右折)に従って、次のボイ/
り’187’に進む。しかる後、次の輪郭追跡に移り、
進行方向(直進)を決定し、ポインタ1315“を選択
する。以後、同様に追跡を行ない、エンドマークEND
を示すポインタを検出すると、そのときのポインタ″3
53#を頂点として登録する。そして、このときの座標
位置を始点の座標をもとに算出してメモリ108に記憶
する。
For example, when tracing the contour line shown in Figure 4 (6) according to the line segment pattern data shown in Figure 4 (α), start from pointer "01" and follow the direction of travel (right turn) to the next voice/pointer.
Proceed to '187'. After that, move on to the next contour tracking,
Determine the direction of travel (straight ahead) and select the pointer 1315". From then on, tracking is performed in the same way until the end mark END is reached.
When a pointer indicating ``3'' is detected, the pointer at that time is
53# is registered as the vertex. Then, the coordinate position at this time is calculated based on the coordinate of the starting point and stored in the memory 108.

但し、第4図(α)に示すように、線分パターンは軸対
称の2本1対のうち、最初の折点が右折(または左折)
に限られた片方しか無いため、このループの中で7ラグ
を保持し、輪郭点列上で最初の折点が出現した以後、そ
の折点が左折(右折)だった時には、線分パターンの左
右を逆転して使用する。第4図(α)に示すような線分
パターンは定数データであるため、オフラインで作成し
ておき、後でプログラムとともにロードすることができ
る。従って、作成の際は高速処理を行なう必要がない。
However, as shown in Figure 4 (α), the first bending point of a pair of axially symmetric line segments is a right turn (or left turn).
Since there is only one side limited to , 7 lags are maintained in this loop, and after the first break point appears on the contour point sequence, when that break point is a left turn (right turn), the line segment pattern is Use left and right reversed. Since the line segment pattern shown in FIG. 4 (α) is constant data, it can be created offline and later loaded with the program. Therefore, there is no need to perform high-speed processing during creation.

また、線分パターンの内容は、多角形近似の処理手順に
関係無いため、様々な直線判定基準により作った線分パ
ターンを入れかえることにより、多角形近似の粗さの調
節などの操作を、プログラムやハードウェアを変更する
こと無く、容易に行なうことができる。
In addition, since the contents of line segment patterns are not related to the processing procedure of polygon approximation, operations such as adjusting the roughness of polygon approximation can be programmed by replacing line segment patterns created using various straight line criteria. This can be easily done without changing the hardware or hardware.

次に、第4図(α)に示すような線分パターンの作成手
順を説明する。線分パターンは5×1の配列で表わされ
る。第2添字を工線分パターン上の各点に対応し、第1
添字tS各点における進行方向に対応する。内容は、各
点において進行方向が決まった時に、次の点を示すポイ
ンターまたはエンドマークENDである。従って線分パ
ターンは、直線であるという条件のもとに各点において
許される進行方向を記入したスロットの集合である。
Next, a procedure for creating a line segment pattern as shown in FIG. 4(α) will be explained. The line segment pattern is represented by a 5×1 array. The second subscript corresponds to each point on the construction line segment pattern, and the first
The subscript tS corresponds to the direction of movement at each point. The content is a pointer or end mark END that indicates the next point when the direction of travel is determined at each point. Therefore, a line segment pattern is a set of slots in which the allowed traveling directions at each point are written on the condition that the line is a straight line.

線分バターyを作成するには、線分パターン土の各点に
おいて、5つの進行方向に従って、新しい点を追加し、
これを加えた点列が直線か否かを判定する。直線でなけ
ればエンドマークを、直線であれば追加した新しい点に
相当する新しいスロットを作り、その番号をポインタと
して書込み、新しい点について同様の処理を繰り返す。
To create line butter y, at each point in the line pattern soil, add new points according to the five directions of movement,
It is determined whether the point sequence obtained by adding this is a straight line. If it is not a straight line, create an end mark, if it is a straight line, create a new slot corresponding to the added new point, write that number as a pointer, and repeat the same process for the new point.

以とを線分の長さが許容値に達するまで続ける。Continue this process until the length of the line segment reaches the allowable value.

この基本的手順は、状態−空間探索法における縦形法と
して知られている方法を用いることができる(この方法
については、例えば、昭和48年4月15日コロナ社発
行の「人工知能」の56〜56頁に記述されている。)
以上が線分パターン作成の基本的な考え方である。以下
第6図を用いて、処理の流れを追って説明する。
For this basic procedure, a method known as the vertical method in the state-space search method can be used. (described on pages ~56)
The above is the basic idea of creating a line segment pattern. The flow of processing will be explained below using FIG. 6.

線分パターンを配列Tで表わす。線分パターンがどこま
で使用されているかを示すカウンタをCとする。また、
軸対称パターンの圧縮のために、点列がすでに右か左に
折れたか、直進のみを続けているかをオン/オフで示す
フラグを設け、最初に折れる方向を片方に制限すること
により、軸対称パターンを片方だけしか作らず、データ
を半分圧圧縮する。
The line segment pattern is represented by an array T. Let C be a counter that indicates how far a line segment pattern is used. Also,
In order to compress axially symmetrical patterns, a flag is set to indicate whether the point sequence has already bent to the right or left, or whether it continues to move straight ahead, and this flag is set to indicate whether the point sequence has already bent to the right or left, or whether it continues to move straight. Create only one pattern and compress the data by half.

まず、第6図(α)に示すように、点列とカウンタの初
期設定をする。点列は、最初の2点を例えば(owO>
と(+、0 )に固定する。これにより、線分パターン
は4つの回転対称パターンのうち1通りに限定され、デ
ータが圧縮される。
First, as shown in FIG. 6 (α), the point sequence and counter are initialized. For example, the first two points of the point sequence are (owO>
and (+, 0). As a result, the line segment pattern is limited to one of the four rotationally symmetric patterns, and the data is compressed.

フラグはオフにしておく。またカウンタは0クリヤして
おく。
Leave the flag turned off. Also, clear the counter to 0.

次に、点(1,0)、線分パターン第Oスロットに対し
、5つの進行方向(左折、直進、右折)に点列を延長し
て直線判定を行なう点列延長処理(ステップ602)を
行なう。点列延長処理の中には更に次の点列延長処理が
含まれており、許容長さに達するまで次々に延長が繰り
返される。点列延長処理の詳細を第6図(b)に従って
説明する。なお、この第6図(h)は第6図(α)のス
テップ602のサブルーチンを示す図である。
Next, for the point (1,0) and the O-th slot of the line segment pattern, a point sequence extension process (step 602) is performed in which the point sequence is extended in five directions of travel (left turn, straight ahead, right turn) to determine a straight line. Let's do it. The point sequence extension process further includes the next point sequence extension process, and the extension is repeated one after another until the permissible length is reached. Details of the point sequence extension process will be explained with reference to FIG. 6(b). Note that FIG. 6(h) is a diagram showing the subroutine of step 602 in FIG. 6(α).

まず、第6図Cb)の如く、処理対称となる点をPで指
定する。このポインタPは点列延長処理内部のローカル
な変数で、点列延長処理先頭でのCの値に固定する(ス
テップ611)。Cの値自身は処理中に変化してしまう
。次に、カウンタと黒列長をインクリメントしくステッ
プ612.615 )進行方向を左折と仮定して新しい
点を追加する。すなわち、ポインタ記入処理(ステップ
614)を行なう。このポインタ記入処理は第6図(C
)に示すように、フラグがオンの場合のみポインタ記入
処理を行ない(ステップ621〜625)、オフならば
エンドマークE NDを記入する(ステップ627)。
First, as shown in FIG. 6Cb), a point to be processed is specified by P. This pointer P is a local variable within the point sequence extension process, and is fixed to the value of C at the beginning of the point sequence extension process (step 611). The value of C itself changes during processing. Next, the counter and the black column length are incremented (steps 612 and 615), and a new point is added assuming that the direction of travel is a left turn. That is, pointer entry processing (step 614) is performed. This pointer entry process is shown in Figure 6 (C
), pointer entry processing is performed only if the flag is on (steps 621 to 625), and if it is off, an end mark END is written (step 627).

これにより、最初の折点方向を右に限定している。次に
進行方向を直進として、今度はフラグに関係無くポイン
タ記入処理を行なう(ステップ615)。次に進行方向
を右折とし、新しい点を加え、フラグをオンにしてポイ
ンタ記入処理を行なう(ステップ616)。即ち、一度
でも右折した後はフラグはオンとなる。
This limits the direction of the first bending point to the right. Next, the traveling direction is set to go straight, and pointer entry processing is performed this time regardless of the flag (step 615). Next, the direction of travel is set to right, a new point is added, the flag is turned on, and pointer entry processing is performed (step 616). That is, after turning right even once, the flag is turned on.

次に第6図(b)の各ポインタ記入処理について第6図
(C)に従って詳細に説明する。この第6図(C)は第
6図(b)のステップ614,615,616夫々のサ
ブルーチンを示す図である。まず、点列延長を行ない(
ステップ622)、その点列の長さが許容値をこえたか
を判定する(ステップ625)。・二の結果、こえてい
ればエンドマークの記入を行ない(ステップ627)、
こえていなければ、新しい点を加えた点列が直線か否か
を判定する(ステップ625)。直線でなければエンド
マークを書込む(ステップ627)。判定基準は必要に
応じて何でも良い。例えば最小2乗法により点列の中心
線を引き、これから各点までの距離に最大許容値を設け
るなどの方法が用いられる。直線であった場合は、カウ
ンタCをインクリメントして新しいスロットを作り、こ
のカフ/り値をポインタとして記入し、(ステップ62
5)この新しい点について、第6図(b)に示した点列
延長処理を行ない、点列の長さをインクリメントする(
ステップ626)。このようにして、第4図(α)K示
されるような線分パターンが作成される。すなわち、ポ
インタ@0′″からカウンタをインクリメントしてポイ
ンタ記入処理を行ない、最初の折点が左の場合にはエン
ドマークを記入し、直進の場合のポインタ記入処理を許
容値まで続ける。
Next, each pointer entry process shown in FIG. 6(b) will be explained in detail with reference to FIG. 6(C). FIG. 6(C) is a diagram showing the subroutines of steps 614, 615, and 616 in FIG. 6(b). First, extend the point sequence (
Step 622), it is determined whether the length of the point sequence exceeds a tolerance value (Step 625). - If the second result is exceeded, an end mark is entered (step 627),
If not, it is determined whether the point sequence to which the new point has been added is a straight line (step 625). If it is not a straight line, an end mark is written (step 627). Any judgment criteria may be used as necessary. For example, a method is used in which the center line of a series of points is drawn using the least squares method and a maximum allowable value is set for the distance from this to each point. If it is a straight line, the counter C is incremented to create a new slot, this cuff/value is written as a pointer, and (step 62
5) For this new point, perform the point sequence extension process shown in Figure 6(b) and increment the length of the point sequence (
step 626). In this way, a line segment pattern as shown in FIG. 4(α)K is created. That is, the pointer entry process is performed by incrementing the counter from the pointer @0''', and if the first turning point is on the left, an end mark is written, and the pointer entry process in the case of straight travel is continued up to the allowable value.

その後、その許容値内で右折、ざらに左折のポインタ記
入処理を行なう。
Thereafter, pointer entry processing for right turns and roughly left turns is performed within the allowable values.

こうしてできた線分パターンは、一定の基準のもとで直
線と見なされる点列なすべて含み、なおかつ同一形状の
点列を2重に含むことは無いが、部分的に見ると第7図
(α)、(b)に示すように同一形状の部分CとDがあ
る。この同一形状の部分が線分の終点を含む時、その部
分に相当する点列データは、等価なデータが2重に存在
する事になり、どれか1つで代表して他を消す事により
データを圧縮できる。
The line segment pattern created in this way includes all point sequences that are considered to be straight lines under certain standards, and does not include double point sequences of the same shape. As shown in α) and (b), there are parts C and D that have the same shape. When a part of the same shape includes the end point of a line segment, the point sequence data corresponding to that part will have double equivalent data, and by representing one of them and erasing the others, Data can be compressed.

第8図を用いてその手順を説明する。消去されるべき部
分は必ず線分終点、即ち、5方向ともエンドマークの入
ったスロットを含むから、ここから遡って不要部分を消
して行(。
The procedure will be explained using FIG. The part to be erased always includes the end point of the line segment, that is, the slot containing the end mark in all five directions, so go back and erase unnecessary parts from this line (.

まず、第8図(cL)に示すようK、線分パターン配列
上をスキャンして、終点を探し、最初の1点■を残して
他のすべてに消去マークを書込む(ステップ801)。
First, as shown in FIG. 8(cL), the line segment pattern array is scanned to find the end point, and erasure marks are written in all but the first point (2) (step 801).

次に、線分パターン配列上をスキャンして、■を含む点
は1個を残してすべて消去する点列統合処理を行なう(
ステップ802)。
Next, perform point sequence integration processing by scanning the line segment pattern array and erasing all but one point containing ■ (
Step 802).

点列統合処理について第8図(b)を用いて詳細に説明
する。まず採漿対象とするポインタJを指定する。そし
て次の採漿対象Iをクリヤする(ステップ811)。次
に、線分パターン上を走査し、Jを含む点を探し、最初
の点Iを除きすべて消去マークを書込む点列消去処理を
行なう(ステップ812)。次に、点Iがもし存在した
ならば(ステップ813)、点■について同様の点列統
合処理を行なう(ステップ814)。
The point sequence integration process will be explained in detail using FIG. 8(b). First, pointer J to be sampled is designated. Then, the next sample I is cleared (step 811). Next, the line segment pattern is scanned to find points including J, and a point sequence erasing process is performed in which erasing marks are written on all points except the first point I (step 812). Next, if point I exists (step 813), a similar point sequence integration process is performed for point ■ (step 814).

最後に、消去マークの記入されたスロットをすべて消し
て、データをパックして、終了する(ステップ803)
Finally, erase all slots marked with erasure marks, pack the data, and exit (step 803).
.

以上の処理を施すことで、線分パターンの最初の折れ点
の方向を右に限定し、実際の点列と照合する際は、その
点列の最初の折点が左の場合は、以後の進行方向を逆転
することにより、線分パターンメモリ115を半分に圧
縮することができる。
By performing the above processing, the direction of the first breaking point of the line segment pattern is limited to the right, and when comparing with the actual point sequence, if the first breaking point of the point sequence is on the left, then By reversing the direction of movement, the line segment pattern memory 115 can be compressed in half.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、画像処理装置にお
ける多角形近似処理の利点をいかしつつ、要求されるメ
モリサイズを大幅に縮小し、小型、経済化をはかること
ができる。
As described above, according to the present invention, while taking advantage of polygon approximation processing in an image processing device, the required memory size can be significantly reduced, and the image processing device can be made smaller and more economical.

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

第1図は本発明で使用する画像処理装置の1実施例を示
すブロック図、第2図は多角形近似処理における輪郭線
の追跡方法を説明するための図、第5図は領域輪郭線の
例を示す図、第4図は線分パターンの表現形式と多角形
近似の例を示す図、第5図は多角形近似の手順を示すフ
ローチャート、第6図は線分パターン作成処理のフロー
チャート、第7図は共通部分を持つ線分パターンの例を
示す図、第8図は線分パターンの共通部分を取り除(デ
ータ圧縮処理のフローチャートである。 +01・・・入力制例部、102・・・画像メモリ、+
05・・−前処理部、[4・・・領域情報メモリ、+O
S・・・輪郭抽出部、106・・・輪郭メモリ、107
・・・線分化処理部、108・・・線分化゛清報メモリ
、109・・・辞書パターンメモリ、11Q・・・領域
特徴抽出部、111・・・領域特徴メモリ、112・・
・共通領域抽出部、115・・・共通領域メモリ、11
4・・・認識処理部、100・・・制御部、115・・
・線分パターンメモリ。 第1図 箋2図 (Aン             (8)      
       (C)         (D)(α)
       (−e−)(d)竿3濶 像)  箋+図 第5夕 第4図 訛2 図 (た) 74図 莫7 図 第8図 (/:1.) ズテッγ♂O3へ
FIG. 1 is a block diagram showing one embodiment of an image processing device used in the present invention, FIG. 2 is a diagram for explaining a contour tracing method in polygon approximation processing, and FIG. Figure 4 is a diagram showing an example of line segment pattern expression format and polygon approximation, Figure 5 is a flowchart showing the procedure of polygon approximation, Figure 6 is a flowchart of line segment pattern creation processing, FIG. 7 is a diagram showing an example of line segment patterns having common parts, and FIG. 8 is a flowchart of data compression processing in which common parts of line segment patterns are removed.・・Image memory, +
05...-Preprocessing unit, [4... Area information memory, +O
S...Contour extraction unit, 106...Contour memory, 107
...Line segmentation processing unit, 108...Line segmentation information memory, 109...Dictionary pattern memory, 11Q...Region feature extraction unit, 111...Region feature memory, 112...
- Common area extraction unit, 115... common area memory, 11
4... Recognition processing unit, 100... Control unit, 115...
・Line segment pattern memory. 1st paper note 2 (A) (8)
(C) (D) (α)
(-e-) (d) Rod 3 picture) Note + figure 5 evening figure 4 accent 2 figure (ta) 74 figure mo 7 figure 8 figure (/:1.) Zutte γ♂ O3 to

Claims (1)

【特許請求の範囲】[Claims] 部品画像の輪郭点列を、線分近似に要する各種の線分パ
ターンを記憶しておく線分パターンメモリに格納された
データと照合することにより部品画像の多角形近似を行
ない多角形の頂点座標列をもとに認識処理を行なう画像
処理装置において、前記各種の線分パターンのうち、軸
対象な線分パターンを、いずれか一方に限定して線分パ
ターンメモリに格納しておき、輪郭点列と照合する際、
その点列の最初の折れ点の方向が逆の場合には、以後の
進行方向を逆転して前記線分パターンメモリに格納され
たデータと照合することを特徴とする線分パターン作成
方式。
Polygon approximation of the part image is performed by comparing the contour point sequence of the part image with data stored in a line segment pattern memory that stores various line segment patterns required for line segment approximation, and the vertex coordinates of the polygon are calculated. In an image processing device that performs recognition processing based on columns, one of the various line segment patterns that is axially symmetric is stored in a line segment pattern memory, and contour points are When matching against columns,
If the direction of the first bending point of the point sequence is reversed, the subsequent direction of movement is reversed and compared with data stored in the line segment pattern memory.
JP59194620A 1984-09-19 1984-09-19 Segment pattern preparing system Granted JPS6174076A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59194620A JPS6174076A (en) 1984-09-19 1984-09-19 Segment pattern preparing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59194620A JPS6174076A (en) 1984-09-19 1984-09-19 Segment pattern preparing system

Publications (2)

Publication Number Publication Date
JPS6174076A true JPS6174076A (en) 1986-04-16
JPH0312347B2 JPH0312347B2 (en) 1991-02-20

Family

ID=16327556

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59194620A Granted JPS6174076A (en) 1984-09-19 1984-09-19 Segment pattern preparing system

Country Status (1)

Country Link
JP (1) JPS6174076A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5491525A (en) * 1992-11-24 1996-02-13 Hitachi, Ltd. Illumination unit for liquid crystal projection display apparatus and liquid crystal display apparatus having it used

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4926637U (en) * 1972-06-11 1974-03-07
JPS59155192U (en) * 1983-04-05 1984-10-18 塚仲織物有限会社 Ruler for character alignment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4926637U (en) * 1972-06-11 1974-03-07
JPS59155192U (en) * 1983-04-05 1984-10-18 塚仲織物有限会社 Ruler for character alignment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5491525A (en) * 1992-11-24 1996-02-13 Hitachi, Ltd. Illumination unit for liquid crystal projection display apparatus and liquid crystal display apparatus having it used

Also Published As

Publication number Publication date
JPH0312347B2 (en) 1991-02-20

Similar Documents

Publication Publication Date Title
US6185341B1 (en) Image processing using vector data to reduce noise
EP0977151B1 (en) Image processing apparatus, image processing method, and storage medium
CN111723585A (en) Style-controllable image text real-time translation and conversion method
CN110180186A (en) A kind of topographic map conversion method and system
JP3054682B2 (en) Image processing method
CN113011327A (en) Three-dimensional graph recognition method, device, equipment and storage medium
JPS6174076A (en) Segment pattern preparing system
CN111798481B (en) Image sequence segmentation method and device
JP3149221B2 (en) Image processing device
JPWO2021033242A1 (en) Image recognition device, image recognition method, and image recognition program
JPS6174077A (en) Segment pattern preparing system
JP2878194B2 (en) Partial erasure and partial detection method of image data
JP5126124B2 (en) Image processing device
JPH0613213B2 (en) Block setting method for character image data compression
JPS6174075A (en) Segment pattern preparing system
JPH10124662A (en) Graphic shaping device and its method
CN115775285B (en) Client self-adaptive map vector line simplifying method and system based on priority queue
JP2512800B2 (en) Linear approximation method of line figure input device
JP2559359B2 (en) Image structure storage method and image registration apparatus
JP2853169B2 (en) Pattern recognition device
CN117745557A (en) Pyramid image layering method for retaining edge information and application thereof
JPH04579A (en) Method for extracting feature point of graphic
JP2935331B2 (en) Figure recognition device
JP2587812B2 (en) Figure extraction method
AU769689B2 (en) Converting a Bitmap Image Comprising at Least One Region to a Segment Representation

Legal Events

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