Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0312348B2 - - Google Patents
[go: Go Back, main page]

JPH0312348B2 - - Google Patents

Info

Publication number
JPH0312348B2
JPH0312348B2 JP59194621A JP19462184A JPH0312348B2 JP H0312348 B2 JPH0312348 B2 JP H0312348B2 JP 59194621 A JP59194621 A JP 59194621A JP 19462184 A JP19462184 A JP 19462184A JP H0312348 B2 JPH0312348 B2 JP H0312348B2
Authority
JP
Japan
Prior art keywords
line segment
point
line
pattern
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP59194621A
Other languages
Japanese (ja)
Other versions
JPS6174077A (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 JP59194621A priority Critical patent/JPS6174077A/en
Publication of JPS6174077A publication Critical patent/JPS6174077A/en
Publication of JPH0312348B2 publication Critical patent/JPH0312348B2/ja
Granted legal-status Critical Current

Links

Landscapes

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

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年電気学会全国大会講
演論文集〔13〕、論文番号1340に「線分化パター
ンマツチングによる部品認識技術」と題して発表
されている。また、本出願人が先に出願した特願
した特願昭58−27519号(特開昭59−154578号公
報)に詳述されている。
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, the Showa period
It was published on March 10, 1988 in the Proceedings of the National Conference of the Institute of Electrical Engineers of Japan, Volume 13, Paper No. 1340, entitled ``Part recognition technology using line segmentation pattern matching.'' Further, it is detailed in Japanese Patent Application No. 58-27519 (Japanese Unexamined Patent Publication No. 59-154578), which was previously filed by the present applicant.

しかし、このような従来の方法では、線分化処
理で用いる線分パターンデータは、ある長さ以内
の直線パターンをすべて含むため、メモリサイズ
が大きくなり、装置の小型化並びに経済化の点で
問題であつた。
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. It was hot.

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

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

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

本発明では、線分パターンを、各輪郭点におけ
る進行方向の系列として表現することで、パター
ンデータの圧縮をはかるものである。すなわち、
画像は2次元マトリツクスなので、線分パターン
をすべて作成すると、4連結の場合、上下左右の
4本1組で回転対称となつている。多角形近似の
場合、部分の方向は問題でなく、形状のみが問題
となる。従つて、この4本は区別する必要が無
い。そこで、進行方向を各輪郭点における方向に
対して次の点へ向う時の左折、前進、右折の相対
的な方向で表わすと、対称な4つの線分パターン
は同一の系列で表現されるため、データが4分の
1に圧縮される。
In the present invention, pattern data is compressed by expressing a line segment pattern as a series of advancing directions at each contour point. That is,
Since the image is a two-dimensional matrix, when all line segment patterns are created, in the case of 4-connection, each set of 4 lines (top, bottom, left and right) is rotationally symmetrical. In the case of polygonal approximation, the direction of the part does not matter; only the shape matters. Therefore, there is no need to distinguish between these four lines. Therefore, if the direction of travel is expressed as the relative direction of left turn, forward movement, and right turn when heading to the next point with respect to the direction at each contour point, the four symmetrical line segment patterns are expressed in the same series. , the data is compressed by a factor of four.

更に、線分パターンは2本1組で軸対称となつ
ている。これを進行方向系列として見ると、対応
する各点において左右を逆転したものになつてい
る。そこで、本発明では、いずれか片方のみを保
持し、最初の折れ点での進行方向に従つて、必要
な時は以後の進行方向を左右逆転することで、2
つの線分パターンの形状を1つ分のデータで表現
するようにしたものである。
Furthermore, the line segment patterns are 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, and following the direction of travel at the first bending point, the subsequent direction of travel is reversed left and right when necessary.
The shape of one line segment pattern is expressed by one piece of data.

また、複数の線分パターンがある時、その形状
は全体として異なつても、部分的に共通すること
がある。そこで、本発明では、この共通部分のデ
ータを共有することによりデータを消減し、必要
なメモリサイズを縮小するようにしたものであ
る。
Further, when there are a plurality of line segment patterns, even if their shapes are different as a whole, they may be partially common. Therefore, in the present invention, the data in this common portion is shared, thereby reducing the data and reducing the required memory size.

〔発明の実施例〕[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は、以下に述べる各部に対して
所要の処理の流れを制御する制御部である。10
1〜104は、前処理に係るもので、101は、
入力制御部、102は、画像メモリ、103は、
前処理部、104は、領域情報メモリである。1
05と106は、輪郭抽出処理に係るもので、1
05は、輪郭抽出部、106は、輪郭メモリであ
る。107〜109は、線分化処理に係るもの
で、107は、線分化処理部、115は、線分パ
ターンメモリ、108は、線分化情報メモリ、1
09は、辞書パターンメモリである。110と1
11は、領域特徴抽出処理に係るもので、110
は、領域特徴抽出部、111は、領域特徴メモリ
である。112〜114は、パターンマツチング
処理に係るもので、112は共通領域抽出部、1
13は、共通領域メモリ、114は、認識処理部
である。なお、かかる画像処理装置は、プロセツ
サとメモリとインタフエース回路などのハード回
路により構成されるものである。
Here, 100 is a control unit that controls the flow of required processing for each unit described below. 10
1 to 104 are related to preprocessing, and 101 is
An input control unit, 102, an image memory, 103,
The preprocessing unit 104 is an area information memory. 1
05 and 106 are related to contour extraction processing, and 1
05 is a contour extracting 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, 1
09 is a dictionary pattern memory. 110 and 1
11 relates to region feature extraction processing; 110;
is a region feature extraction unit, and 111 is a region feature memory. 112 to 114 are related to pattern matching processing; 112 is a common area extraction unit;
13 is a common area memory, and 114 is a recognition processing unit. It should be noted that such an image processing device is composed of hardware circuits such as a processor, a memory, and an interface circuit.

まず、図示されてないテレビカメラより入力さ
れた画像データは、入力制御部101でデイジタ
ル化および所定の閾値で2値化された後、濃淡画
像データ、2値画像データとして画像メモリ10
2に入力・記憶される。
First, image data input from a television camera (not shown) is digitized by the input control unit 101 and binarized using a predetermined threshold value, and then stored in the image memory 10 as grayscale image data and binary image data.
2 is input and stored.

画像メモリ102に記憶された画像データは、
はじめに前処理部103によつて画像上のどの領
域を対象物体領域とするかが決定された後、その
領域の代表点の位置情報が領域情報メモリ104
に記憶される。
The image data stored in the image memory 102 is
First, the preprocessing unit 103 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.
is memorized.

次に、輪郭抽出部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 the center coordinate value in the contour memory 106, for example. Make me remember.

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

また、領域特徴抽出部110は、指定領域の特
徴(例えば面積、重心、慣性主軸、最大長、周囲
長等)を線分化情報メモリ108の内容から求
め、領域特徴メモリ111に記憶させる。辞書パ
ターン登録時には、その特徴情報は辞書パターン
メモリ109に記憶される。
Further, the region feature extraction unit 110 obtains the features of the specified region (for example, area, center of gravity, principal axis of inertia, maximum length, perimeter, etc.) from the contents of the line segmentation information memory 108 and stores them in the region feature memory 111. 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 so that they match (for example, so that the center of gravity coordinates match (for example, so that the center of gravity coordinates match, or the directions of the principal axes of inertia match, etc.)
After coordinate transformation on the input pattern side, the common area (product figure) of both patterns is similarly determined as a vertex sequence and recorded in the common area memory 113.

最後に、認識処理部114は、共通領域(積図
形)の面積を算出し、これと辞書パターンまたは
入力パターンの面積との比率を求め、その値が所
定値以上になつた場合、両パターンは一致してい
るものと判定して、認識結果を出力する。もし、
両パターンが一致せず、しかも辞書パターンが複
数あるいは、第2,第3の辞書パターンとのマツ
チング処理を同様に繰り返す。なお、認識処理部
114では、一致した両パターンの変換前の相対
位置から入力パターンの位置、姿勢情報も出力す
る。
Finally, the recognition processing unit 114 calculates the area of the common area (product figure), calculates the ratio of this to the area of the dictionary pattern or the 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. if,
If the two patterns do not match and there are a plurality of dictionary patterns, or if there are second and third dictionary patterns, the matching process is repeated in the same way. Note that the recognition processing unit 114 also outputs position and orientation information of the input pattern based on the relative positions of both matching patterns before conversion.

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

線分化処理部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 the contour pixel is the contour line, and the other way is where the boundary line between area pixels and background pixels is the contour line.
There are two ways (C) and (D), and in addition, for the adjacency state of continuous contour points, only the vertical and horizontal adjacency is considered.
(B), (D), and 8-connection (A) that also takes into account diagonal adjacency,
There are two ways (C). Therefore, for contour tracing, (A)
There are a total of four methods: ~(D). However, among these, the boundary 8 connection (C) is meaningless because it does not uniquely correspond to the pixel value.

各々の場合、追跡の方向には、第2図a,a′,
b,dに示すような可能性がある。以後は境界4
連結(D)で輪郭線を追跡する場合について説明す
る。
In each case, the direction of tracking is a, a',
There are possibilities as shown in b and d. From now on, boundary 4
The case of tracing contour lines using connection (D) will be explained.

輪郭点列の例を第3図に示す。各輪郭点は図中
矢印で示すように固有の進行方向を持つており、
輪郭線の形状は、この進行方向の列で表わされ
る。長さに制限を加えると、ある条件のもとで線
分と見なされる点列は、有限個数の進行方向列と
なる。線分と見なす条件は、例えば、中心線から
の距離の許容最大値を定め、すべての点がこれを
満足する点列を線分とする、などが用いられる。
線分パターンの個数、長さが有限なので、すべて
の線分パターンを、人工的に作ることができる。
An example of a contour point sequence is shown in FIG. Each contour point has a unique direction of travel, as shown by the arrow in the figure.
The shape of the contour line is represented by the columns in the traveling direction. 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 advancing direction. 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図aに示すように、3xn
の2次元配列で表わされ、これがパターンデータ
としてメモリ115に記憶される。配列の第2添
字値は、点列で表わされる線分パターン上のn個
の点に対応し、第1添字値は各点における3つの
進行方向、すなわち、左折、直進、右折に対応す
る。配列要素の内容は、ある点において進行方向
が決まつた時、その方向に進んだ時の次の点の番
号、即ちポインタである。例えば始点“0”にお
いて進行方向が右折と決まつたとき、その方向に
進んだときの次の点の番号が“187”として示さ
れる。但し、点列は直線とみなし得るものである
という制約があるために、各点において3つの進
行方向がすべて許されるとは限らない。禁止方向
に対応する要素にはエンドマークENDが記入さ
れており、輪郭線の追跡中にこれを検出した時
は、検出した点を線分の終了点と見なし、これを
多角形の頂点として登録する。第4図bにおいて
は、線分の始点Sにおいて線分パターンの始点
“0”から追跡を始め、点EでエンドマークEND
を検出してこの点“333”を多角形の頂点とし、
線分パターンのポインタを始点“0”にもどして
新しい線分の追跡を始める。図中、各点の番号は
線分パターンの点番号である。
The line segment pattern is 3xn as shown in Figure 4a.
This is stored in the memory 115 as pattern data. The second subscript value of the array corresponds to n points on the line segment pattern represented by a sequence of points, and the first subscript value corresponds to three directions of travel at each point, namely, left turn, straight ahead, and right turn. 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 three traveling directions are not always allowed at each point. An end mark END is written in the element corresponding to the prohibited direction, and when this is detected while tracing the contour line, the detected point is regarded as the end point of the line segment, and this is registered as the vertex of the polygon. do. In Fig. 4b, tracing starts from the starting point "0" of the line segment pattern at the starting point S of the line segment, and the end mark END is reached at point E.
Detect and set this point “333” as the vertex of the polygon,
Return the line segment pattern pointer to the starting point "0" and start 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のS点、を多角形の第1
頂点として登録し、線分パターンのポインタを
“0”にして初期設定する(ステツプ501)。以後、
ステツプ501〜507の処理をくり返す。まず、追跡
開始点Sにおける進行方向を決定する(ステツプ
502)。ここで、進行方向の決定方法について第3
図を用いて説明する。第3図において、画素Aが
部品領域に含まれているとする。まず、画素Bが
部品領域に含まれているかどうか調べ、含まれて
いない時は、進行方向は右折とする。次に、画素
Bが部品領域に含まれているかどうか調べ、含ま
れていない時進行方向を前進、含まれている時は
左折とする。画素が部品領域に含まれているか否
かの判定は、様々な方法があり、例えば2値画像
ならば、輪郭メモリ106から読み出した値が
“1”か“0”かで判定できる。
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 a pointer according to the direction of movement at each point. First, set the tracking starting point, for example, point S in Figure 4b, to the first point of the polygon.
It is registered as a vertex and initialized by setting the line segment pattern pointer to "0" (step 501). From then on,
Repeat steps 501 to 507. First, determine the traveling direction at the tracking starting point S (step
502). Here, we will explain the third method of determining the direction of travel.
This will be explained using figures. In FIG. 3, 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 turn left. There are various methods for determining whether a pixel is included in a component area. For example, in the case of a binary image, determination can be made based on whether the value read from the contour memory 106 is "1" or "0".

次に、線分パターンのポインタの指すスロツト
を参照し、進行方向に従つて、次のポインタを選
択する(ステツプ503)。例えば、第4図の場合、
ポインタ“0”のエリアを参照し、この場合、進
行方向が第4図bに示すように右折であるので、
次のポインタ“187”を選択する。そして、もし
次のポインタがエンドマークENDならば(ステ
ツプ504)、その時点の輪郭点を多角形の頂点とし
て新たに線分化情報メモリ108に登録し、ポイ
ンタを“0”にもどす(ステツプ505)。
Next, referring to the slot pointed by the line segment pattern pointer, the next pointer is selected according to the direction of travel (step 503). For example, in the case of Figure 4,
Referring to the area of pointer "0", in this case, since the direction of travel is a right turn as shown in Figure 4b,
Select the next pointer “187”. If the next pointer is the end mark END (step 504), 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 direction of travel (step 506), check the end condition, for example, whether or not the contour has been completed once and returned to the tracing start point S (step 507), and check the end condition. Steps 502 to 507 are repeated until the condition is satisfied.

例えば、第4図bの輪郭線を第4図aの線分パ
ターンデータに従つて追跡する場合、ポインタ
“0”からスタートし、進行方向(右折)に従つ
て、次のポインタ“187”に進む。しかる後、次
の輪郭追跡に移り、進行方向(直進)を決定し、
ポインタ“315”を選択する。以後、同様に追跡
を行ない、エンドマークENDを示すポインタを
検出すると、そのときのポインタ“333”を頂点
として登録する。そして、このときの座標位置を
始点の座標をもとに算出してメモリ108に記憶
する。
For example, when tracing the contour line in Figure 4b according to the line segment pattern data in Figure 4a, start from pointer "0" and move to the next pointer "187" according to the direction of travel (right turn). move on. After that, move on to the next contour tracking, determine the direction of travel (straight ahead),
Select pointer “315”. Thereafter, tracking is performed in the same way, and when a pointer indicating the end mark END is detected, the pointer "333" at that time 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図aに示すように、線分パターンは
軸対称の2本1対のうち、最初の折点が右折(ま
たは左折)に限られた片方しか無いため、このル
ープの中でフラグを保持し、輪郭点列上で最初の
折点が出現した以後、その折点が左折(右折)だ
つた時には、線分パターンの左右を逆転して使用
する。
However, as shown in Figure 4a, out of a pair of axially symmetric line segment patterns, there is only one whose first turning point is a right turn (or left turn). is maintained, and after the first break point appears on the contour point sequence, when that break point is a left turn (right turn), the left and right of the line segment pattern is reversed and used.

第4図aに示すような線分パターンは定数デー
タであるため、オフラインで作成しておき、後で
プログラムとともにロードすることができる。従
つて、作成の際は高速処理を行なう必要がない。
また、線分パターンの内容は、多角形近似の処理
手順に関係無いため、様々な直線判定基準により
作つた線分パターンを入れかえることにより、多
角形近似の粗さの調節などの操作を、プラグラム
やハードウエアを変更すること無く、容易に行な
うことができる。
Since the line segment pattern shown in FIG. 4a 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図aに示すような線分パターンの作
成手順を説明する。線分パターンは3Xnの配列で
表わされる。第2添字は線分パターン上の各点に
対応し、第1添字は各点における進行方向に対応
する。内容は、各点において進行方向が決まつた
時に、次の点を示すポインタ、またはエンドマー
クENDである。従つて線分パターンは、直線で
あるという条件のもとに各点において許される進
行方向を記入したスロツトの集合である。
Next, a procedure for creating a line segment pattern as shown in FIG. 4a will be explained. The line segment pattern is represented by a 3Xn array. The second subscript corresponds to each point on the line segment pattern, and the first subscript 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 permissible traveling directions at each point are written on the condition that the line is a straight line.

線分パターンを作成するには、線分パターン上
の各点において、3つの進行方向に従つて、新し
い点を追加し、これを加えた点列が直線か否かを
判定する。直線でなければエンドマークを、直線
であれば追加した新しい点に相当する新しいスロ
ツトを作り、その番号をポインタとして書込み、
新しい点について同様の処理を繰り返す。以上を
線分の長さが許容値に達するまで続ける。この基
本的手順は、状態・空間探索法における縦形法と
して知られている方法を用いることができる。
(この方法については、例えば、昭和48年4月15
日コロナ社発行の「人工知能」の53〜56頁に記述
されている。)以上が線分パターン作成の基本的
な考え方である。以下第6図を用いて、処理の流
れを順を追つて説明する。
To create a line segment pattern, new points are added at each point on the line segment pattern according to the three directions of movement, and it is determined whether the added point sequence 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 new point added, write that number as a pointer,
Repeat the same process for the new point. Continue the above steps until the line segment length reaches the allowable value. For this basic procedure, a method known as the vertical method in the state/space search method can be used.
(For details on this method, see, for example, April 15, 1970)
It is described on pages 53-56 of ``Artificial Intelligence'' published by Nihon Coronasha. ) The above is the basic idea of creating line segment patterns. The flow of processing will be explained step by step using FIG. 6 below.

線分パターンを配列Tで表わす。線分パターン
がどこまで使用されているかを示すカウンタをC
とする。また、軸対称パターンの圧縮のために、
点列がすでに右か左に折れたか、直進のみを続け
ているかをオン/オフで示すフラグを設け、最初
に折れる方向を片方に制限するとにより、軸対称
パターンを片方だけしか作らず、データを半分に
圧縮する。
The line segment pattern is represented by an array T. C is the counter that shows how far the line segment pattern is used.
shall be. Also, for compression of axisymmetric patterns,
By setting an on/off flag to indicate whether the point sequence has already bent to the right or left, or whether it continues to move only straight, and by restricting the initial bending direction to one direction, an axisymmetric pattern is created only in one direction, and the data is Compress in half.

まず、第6図aに示すように、点列とカウンタ
の初期設定をする。点列は、最初の2点を例えば
(0,0)と(1,0)に固定する。これにより、
線分パターンは4つの回転対称パターンのうち1
通りに限定され、データが圧縮される。フラグは
オフにしておく。またカウンタは0クリヤしてお
く。
First, as shown in FIG. 6a, the point sequence and counter are initialized. In the point sequence, the first two points are fixed to, for example, (0,0) and (1,0). This results in
The line segment pattern is one of the four rotationally symmetric patterns.
data is compressed. Leave the flag turned off. Also, clear the counter to 0.

次に、点(1,0)、線分パターン第0スロツ
トに対し、3つの進行方向(左折、直進、右折)
に点列を延長して直線判定を行なう点列延長処理
(ステツプ602)を行なう。点列延長処理の中には
更に次の点列延長処理が含まれており、許容長さ
に達するまで次々に延長が繰り返される。点列延
長処理の詳細を第6図bに従つて説明する。な
お、この第6図bは第6図aのステツプ602のサ
ブルーチンを示す図である。
Next, for the point (1,0) and the 0th slot of the line segment pattern, there are three directions of travel (left turn, straight ahead, right turn).
Point sequence extension processing (step 602) is performed to extend the point sequence and perform straight line determination. 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. 6b. Incidentally, FIG. 6b is a diagram showing the subroutine of step 602 in FIG. 6a.

まず、第6図bの如く、処理対称となる点をP
で指定する。このポインタPは点列延長処理内部
のローカルな変数で、点列延長処理先頭でのCの
値に固定する(ステツプ611)。Cの値自身は処理
中に変化してしまう。次に、カウンタと点列長を
インクリメントし(ステツプ612,613)進行方向
を左折と仮定して新しい点を追加する。すなわ
ち、ポインタ記入処理(ステツプ614)を行なう。
このポインタ記入処理は第6図cに示すように、
フラグがオンの場合のみポインタ記入処理を行な
い(ステツプ621〜625)、オフならばエンドマー
クENDを記入する(ステツプ627)。これにより、
最初の折点方向を右に限定している。次に進行方
向を直進として、今度はフラグに関係無くポイン
タ記入処理を行なう(ステツプ615)。次に進行方
向を右折とし、新しい点を加え、フラグをオンに
してポインタ記入処理を行なう(ステツプ616)。
即ち、一度でも右折した後はフラグはオンとな
る。
First, as shown in Figure 6b, the point to be processed is set to P
Specify with. 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 point sequence length are incremented (steps 612 and 613), 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 as shown in Figure 6c.
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 entered (step 627). This results in
The first bending point direction is limited to the right. Next, the direction of travel is set to be straight ahead, 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)、その点列の長さが許容値をこ
えたかを判定する(ステツプ623)。この結果、こ
えていればエンドマークの記入を行ない(ステツ
プ627)、こえていなければ、新しい点を加えた点
列が直線か否かを判定する(ステツプ623)、直線
でなければエンドマークを書込む(ステツプ
627)。判定基準は必要に応じて何でも良い。例え
ば最小2乗法により点列の中心線を引き、これか
ら各点までの距離に最大許容値を設けるなどの方
法が用いられる。直線であつた場合は、カウンタ
Cをインクリメントして新しいスロツトを作り、
このカウンタ値をポインタとして記入し、(ステ
ツプ625)、この新しい点について、第6図bに示
した点列延長処理を行ない、点列の長さをインク
リメントする(ステツプ626)。このようにして、
第4図aに示されるような線分パターンが作成さ
れる。すなわち、ポインタ“0”からカウンタを
インクリメントしてポインタ記入処理を行ない、
最初の折点が左の場合にはエンドマークを記入
し、直進の場合のポインタ記入処理を許容値まで
続ける。その後、その許容値内で右折、さらに左
折のポインタ記入処理を行なう。
Next, each pointer entry process shown in FIG. 6b will be explained in detail with reference to FIG. 6c. This figure 6c
6 is a diagram showing the subroutines of steps 614, 615, and 616 in FIG. 6b. First, a point sequence is extended (step 622), and it is determined whether the length of the point sequence exceeds an allowable value (step 623). As a result, if the line is exceeded, an end mark is written (step 627), and if it is not exceeded, it is determined whether the point sequence to which the new point has been added is a straight line (step 623), and if it is not a line, an end mark is written. Write (step
627). Any judgment criteria may be used as necessary. For example, a method is used in which a 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, increment counter C and create a new slot.
This counter value is entered as a pointer (step 625), and the point sequence extension process shown in FIG. 6b is performed on this new point to increment the length of the point sequence (step 626). In this way,
A line segment pattern as shown in FIG. 4a is created. That is, the counter is incremented from pointer "0" and pointer entry processing is performed,
If the first turning point is on the left, an end mark is written, and the pointer writing process for straight travel is continued until the allowable value. Thereafter, pointer entry processing for turning right and then turning left is performed within the allowable value.

こうしてできた線分パターンは、一定の基準の
もとで直線と見なされる点列をすべて含み、なお
かつ同一形状の点列を2重に含むことは無いが、
部分的に見ると第7図a,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.
When viewed partially, there are portions C and D of the same shape as shown in FIGS. 7a and 7b. When this same-shaped part includes the end point of the line segment, the point sequence data corresponding to that part will have double equivalent data,
Data can be compressed by using one as a representative and erasing the others.

第8図を用いてその手順を説明する。消去され
るべき部分は必ず線分終点、即ち、3方向ともエ
ンドマークの入つたスロツトを含むから、ここか
ら遡つて不要部分を消して行く。
The procedure will be explained using FIG. Since the portion to be erased always includes the end point of the line segment, that is, the slot containing the end mark in all three directions, the unnecessary portions are erased going backwards from this point.

まず、第8図aに示すように、線分パターン配
列上をスキヤンして、終点を探し、最初の1点I
を残して他のすべてに消去マークを書込む(ステ
ツプ801)。次に、線分パターン配列上をスキヤン
して、Iを含む点は1個を残してすべて消去する
点列統合処理を行なう(ステツプ802)。
First, as shown in Figure 8a, scan the line segment pattern array to find the end point, and select the first point I
, and write erasure marks on all others (step 801). Next, the line segment pattern array is scanned and a point sequence integration process is performed in which all but one point containing I is deleted (step 802).

点列統合処理について第8図bを用いて詳細に
説明する。まず探策対象とするポインタJを指定
する。そして次の探策対象Iをクリヤする(ステ
ツプ811)。次に、線分パターン上を走査し、Jを
含む点を探し、最初の点Iを除きすべて消去マー
クを書込む点列消去処理を行なう(ステツプ
812)。次に、点Iがもし存在したならば(ステツ
プ813)、点Iについて同様の点列統合処理を行な
う(ステツプ814)。
The point sequence integration process will be explained in detail using FIG. 8b. First, pointer J to be explored is specified. Then, the next exploration target I is cleared (step 811). Next, the line segment pattern is scanned, a point including J is searched for, and an erase mark is 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 I (step 814).

最後に、消去マークの記入されたスロツトをす
べて消して、データをパツクして、終了する(ス
テツプ803)。
Finally, all slots marked with erasure marks are erased, the data is packed, and the process ends (step 803).

以上の処理を施すことで、4連結の場合、線分
パターンの表現形式を上下左右の4つの各点にお
ける絶体的な進行方向の系列を、相対的な進行方
向の系列に置き換えることができるので、上下左
右の4つの回転対称な線分パターンを1つの線分
パターンで代表して表わすことができ、線分パタ
ーンメモリ115のサイズを4分の1に圧縮する
ことが可能となる。
By performing the above processing, in the case of 4-connection, the expression format of the line segment pattern can replace the series of absolute traveling directions at each of the four points (up, down, left, and right) with a series of relative traveling directions. Therefore, four rotationally symmetrical line segment patterns (up, down, left and right) can be representatively represented by one line segment pattern, and the size of the line segment pattern memory 115 can be compressed to one-fourth.

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

さらに、全体として異なる線分パターンの間で
共通する部分のデータ、即ち進行方向の部分列を
共有することによつて必要なデータ量を減らし、
線分パターンメモリ115を圧縮することができ
る。
Furthermore, the amount of data required is reduced by sharing the data of the common part between different line segment patterns as a whole, that is, the partial sequence in the traveling direction.
Line segment pattern memory 115 can be compressed.

〔発明の効果〕〔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図は多角形近似処理
における輪郭線の追跡方法を説明するための図、
第3図は領域輪郭線の例を示す図、第4図は線分
パターンの表現形式と多角形近似の例を示す図、
第5図は多角形近似の手順を示すフローチヤー
ト、第6図は線分パターン作成処理のフローチヤ
ート、第7図は共通部分を持つ線分パターンの例
を示す図、第8図は線分パターンの共通部分を取
り除くデータ圧縮処理のフローチヤートである。 101……入力制御部、102……画像メモ
リ、103……前処理部、104……領域情報メ
モリ、105……輪郭抽出部、106……輪郭メ
モリ、107……線分化処理部、108……線分
化情報メモリ、109……辞書パターンメモリ、
110……領域特徴抽出部、111……領域特徴
メモリ、112……共通領域抽出部、113……
共通領域メモリ、114……認識処理部、100
……制御部、115……線分パターンメモリ。
FIG. 1 is a block diagram showing one embodiment of an image processing device used in the present invention, and FIG. 2 is a diagram for explaining a contour tracing method in polygon approximation processing.
FIG. 3 is a diagram showing an example of a region outline, FIG. 4 is a diagram showing an example of the representation format of a line segment pattern 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, Figure 7 is a diagram showing an example of a line segment pattern having a common part, and Figure 8 is a line segment It is a flowchart of data compression processing for removing common parts of patterns. 101...Input control unit, 102...Image memory, 103...Preprocessing unit, 104...Region information memory, 105...Contour extraction unit, 106...Contour memory, 107...Line differentiation processing unit, 108... ...Line differentiation information memory, 109...Dictionary pattern memory,
110...Region feature extraction unit, 111...Region feature memory, 112...Common area extraction unit, 113...
Common area memory, 114... Recognition processing unit, 100
...Control unit, 115...Line segment pattern memory.

Claims (1)

【特許請求の範囲】 1 予め作成しておいた線分パターンを利用して
入力画像の多角形近似を行なう線分化処理に用い
られる各種の線分パターンを記憶しておく線分化
パターン辞書において、前記記憶しておく線分パ
ターンのうち互いに回転対称な複数の線分パター
ンを、相対的な方向表現による1つの線分パター
ンで代表して格納してあることを特徴とする線分
化パターン辞書。 2 前記線分パターンの表現形式を、前進、右
折、左折の3つの相対的な進行方向の系列で表し
て格納しておくことを特徴とする特許請求の範囲
第1項記載の線分化パターン辞書。 3 前記線分パターンのうち軸対象な線分パター
ンを、最初の折れ点の方向をいずれか一方に限定
して格納しておき、画像の輪郭点列と照合する
際、その点列の最初の折れ点の方向が逆の場合に
は、以後の進行方向を逆転して前記格納された線
分パターンと照合できることを特徴とする特許請
求の範囲第1項または第2項いずれかに記載の線
分化パターン辞書。 4 前記線分パターンのうち共通する進行方向の
部分列を共有して格納しておくことを特徴とする
特許請求の範囲第1項ないし第3項いずれかに記
載の線分化パターン辞書。
[Scope of Claims] 1. A line segmentation pattern dictionary that stores various line segment patterns used in line segmentation processing that performs polygonal approximation of an input image using line segment patterns created in advance, A line segmentation pattern dictionary characterized in that a plurality of line segment patterns that are rotationally symmetrical to each other among the line segment patterns to be stored are represented and stored as one line segment pattern based on relative direction expression. 2. The line segment pattern dictionary according to claim 1, wherein the expression format of the line segment pattern is expressed and stored as a series of three relative traveling directions: forward, right turn, and left turn. . 3 Among the line segment patterns, the axis-symmetric line segment pattern is stored with the direction of the first bending point limited to one of the directions, and when comparing it with the contour point sequence of the image, the first bending point of the point sequence is When the direction of the bending point is reversed, the line according to claim 1 or 2, wherein the subsequent direction of movement can be reversed and compared with the stored line segment pattern. Differentiation pattern dictionary. 4. The line segmentation pattern dictionary according to any one of claims 1 to 3, wherein a partial sequence in a common direction of movement among the line segment patterns is shared and stored.
JP59194621A 1984-09-19 1984-09-19 Line differentiation pattern dictionary Granted JPS6174077A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59194621A JPS6174077A (en) 1984-09-19 1984-09-19 Line differentiation pattern dictionary

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59194621A JPS6174077A (en) 1984-09-19 1984-09-19 Line differentiation pattern dictionary

Publications (2)

Publication Number Publication Date
JPS6174077A JPS6174077A (en) 1986-04-16
JPH0312348B2 true JPH0312348B2 (en) 1991-02-20

Family

ID=16327570

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59194621A Granted JPS6174077A (en) 1984-09-19 1984-09-19 Line differentiation pattern dictionary

Country Status (1)

Country Link
JP (1) JPS6174077A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4830485B2 (en) * 2005-12-27 2011-12-07 パナソニック株式会社 Motor unit and electric bicycle using the same
JP5895624B2 (en) * 2012-03-14 2016-03-30 オムロン株式会社 Image processing apparatus, image processing method, control program, and recording medium

Also Published As

Publication number Publication date
JPS6174077A (en) 1986-04-16

Similar Documents

Publication Publication Date Title
KR900008555B1 (en) Method and apparatus for for on-line recognizing handwritten patterns
US5515455A (en) System for recognizing handwritten words of cursive script
JPH0676062A (en) Image processing device
US6947596B2 (en) Character recognition method, program and recording medium
US20020006224A1 (en) Computer automated process for vectorization of raster images
JPH0312348B2 (en)
EP0559353B1 (en) Computer input apparatus and method for drawing free curves
JP3149221B2 (en) Image processing device
JPH0312347B2 (en)
JPH0410668B2 (en)
JP5126124B2 (en) Image processing device
JP2878194B2 (en) Partial erasure and partial detection method of image data
JPH0713835B2 (en) Similar data detection method and apparatus
JPH05314244A (en) Three-dimensional information extracting method
JP2512800B2 (en) Linear approximation method of line figure input device
JPH04255080A (en) image input device
CN117291944B (en) Image processing method and related equipment
JP2937098B2 (en) Area detection method and device
JP2000082148A (en) Shape feature extraction method of object image, image object recognition method and device
JP2559359B2 (en) Image structure storage method and image registration apparatus
JPH08171635A (en) Line segment extraction image processing device
JPH11120366A (en) Segment contiguity relation determining method
JPH06131459A (en) Contour detection method
JPS6321949B2 (en)
JP3037504B2 (en) Image processing method and apparatus