JPS6269387A - Method for extracting contour line of picture - Google Patents

Method for extracting contour line of picture

Info

Publication number
JPS6269387A
JPS6269387A JP60207773A JP20777385A JPS6269387A JP S6269387 A JPS6269387 A JP S6269387A JP 60207773 A JP60207773 A JP 60207773A JP 20777385 A JP20777385 A JP 20777385A JP S6269387 A JPS6269387 A JP S6269387A
Authority
JP
Japan
Prior art keywords
contour
segment
raster
line element
run
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
Application number
JP60207773A
Other languages
Japanese (ja)
Inventor
Kazuhiko Tanaka
和彦 田中
Naoyuki Uhashi
宇橋 直幸
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP60207773A priority Critical patent/JPS6269387A/en
Publication of JPS6269387A publication Critical patent/JPS6269387A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To extract even the contour lines of a multi-value picture in the areas of the same color at a high speed and with high efficiency, by connecting raster segments to be detected accurately to one of the contour lines formed by the preceding scans and at the same time extracting and coding all contour lines with the screen scan of just a single time. CONSTITUTION:The raster segments 11-14, i.e., the pieces of contours obtained from a single main scan are coded into 0-3 by a 4-coupling direction code 15 with respect to a binary picture. Then raster segment detection is carried out together with the connection of raster segments, branch processing, meeting point processing and tracking end processing. This method can be applied easily even for a multi-value input picture by using the raster segment detecting process exclusive for multi-value pictures. In other words, the runs can be defined for pictures of the same color on a single scan line in the case of the multi-value input pictures.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、画像の輪郭線を抽出する方法に関するもの
である。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Field of Application] The present invention relates to a method for extracting the outline of an image.

〔従来の技術〕[Conventional technology]

従来のテスターデーターベクトルデータへの変換動作に
ついて第9図〜第11図を参照しながら説明する。
The operation of converting conventional tester data into vector data will be explained with reference to FIGS. 9 to 11.

第10図はラスターデーターベクトルデータ変換(R−
V変換)のマトリクスパターンを説明する模式図であり
、41は3X3マトリクスパターンで、各数字flJは
対象画素41aの丘下左右画素を示し、各数字「2」は
対象画素41aの斜め4方向の画素を示す。
Figure 10 shows raster data vector data conversion (R-
41 is a 3X3 matrix pattern, each number flJ indicates the right and left pixels under the hill of the target pixel 41a, and each number "2" indicates the four diagonal directions of the target pixel 41a. Indicates a pixel.

第11図はR−V変換動作を説明する模式図であり、5
1は原データ(ラスターデータ)を示し、52は前記3
×3マトリクスパターン41に抽出される輪郭線データ
(斜線領域)を示している。
FIG. 11 is a schematic diagram explaining the R-V conversion operation, and 5
1 indicates the original data (raster data), 52 indicates the above 3
The outline data (hatched area) extracted into the ×3 matrix pattern 41 is shown.

:fS 12図はR−V変換動作を説明するフローチャ
ートである。なお、(1)〜(4)は各ステップを示す
:fS FIG. 12 is a flowchart explaining the RV conversion operation. Note that (1) to (4) indicate each step.

まず、3X3マトリクスパターン41により、原データ
51を走査して原うスク画像の輪郭線データ52を得る
(1)。次いで、輪郭線データ52の、例えば左上より
3X3マトリクスパターン41により黒画素のスタート
ポイントをピックアップする(2)0次いで、スタート
ポイントから輪郭線データ52を3X3マトリクスパタ
ーン41により、スタートポイントに帰還するまで、輪
郭をトレースし、トレースの終了した輪郭画素を白にす
る(3)0次いで、全画面のラスタ抽出が終了したかど
うかを判定しく4)、YESならば制御を終了し、No
ならばステップ(2)に戻る。
First, the original data 51 is scanned using the 3×3 matrix pattern 41 to obtain the outline data 52 of the original blank image (1). Next, the start point of a black pixel of the contour line data 52 is picked up, for example, from the upper left using the 3X3 matrix pattern 41 (2) 0 Next, the contour line data 52 is picked up from the start point using the 3X3 matrix pattern 41 until it returns to the start point. , trace the outline, and set the traced outline pixels to white (3) 0. Next, determine whether raster extraction of the entire screen has been completed. 4) If YES, end the control;
If so, return to step (2).

このようにして、ラスターデータ51の輪郭線を抽出で
きるように構成されている。
In this way, the configuration is such that the outline of the raster data 51 can be extracted.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

このように、従来は原データ51をランダムに走査して
、スタートポイントに帰還するまで走査を繰り返さなけ
ればならず、輪郭線抽出に非常に時間がかかり、処理効
率を著しく遅延させてしまう問題点があった。
In this way, in the past, the original data 51 had to be scanned at random and the scanning had to be repeated until it returned to the starting point, which resulted in a problem in that it took a very long time to extract the contour line, significantly slowing down the processing efficiency. was there.

この発明は、−ヒ記の問題点を解消するためになされた
もので、1走査でラスタ型画像の輪郭線データを高速、
かつ円滑に抽出できるラスタ型画像の輪郭線抽出方法を
得ることを目的とする。
This invention was made in order to solve the problems described in -A.
It is an object of the present invention to provide a method for extracting contours of raster type images that can be extracted smoothly.

〔問題点を解決するだめのL段〕[L step to solve the problem]

この発明に係る画像の輪郭線抽出方法は、画像を水平走
査する毎に走査線幅内における画像の輪郭断片に対応す
る走査線素を検出する走査線素検出処理と、この走査線
素検出処理で検出された走査線素をそれ以前の走査で形
成された走査線素の最後尾に接続する輪郭線素接続処理
と、新生輪郭線素を定義設定する定義設定処理と、2つ
の輪郭線素を合併させて輪郭線素群として表現する輪郭
線素群表現処理と、2つの輪郭線素群間の関係に応じて
閉じた輪郭線素の形成有無を判定し、輪郭線を抽出する
抽出処理と、からなるものである。
The image contour extraction method according to the present invention includes a scanning line element detection process that detects a scanning line element corresponding to an image contour fragment within a scanning line width each time an image is horizontally scanned; A contour line element connection process that connects the scanning line element detected in the previous scan to the end of the scanning line element formed in the previous scan, a definition setting process that defines and sets a new contour line element, and two contour line elements. a contour line element group expression process that merges the two contour line elements and expresses it as a contour line element group, and an extraction process that determines whether or not a closed contour line element is formed according to the relationship between two contour line element groups and extracts a contour line. It consists of.

〔作用〕[Effect]

この発明においては1画像を水平走査する毎に走査線幅
内における画像の輪郭断片に対応する走査線素を検出し
、検出された走査線素をそれ以前の走査で形成された走
査線素の最後尾に接続させて行き、2つの輪郭線素を合
併して輪郭線素群を形成し、2つの輪郭線素群間の関係
に応じて閉じた輪郭線素が形成されたかを判定すること
より・画像の輪郭線を抽出させる。また、検出される輪
郭線素が新生なものであれば、その都度定義設定して行
く。
In this invention, each time an image is horizontally scanned, a scanning line element corresponding to a contour fragment of the image within the scanning line width is detected, and the detected scanning line element is used as the scanning line element formed in the previous scanning. Connecting the two contour elements to the end, merging the two contour elements to form a group of contour elements, and determining whether a closed contour element has been formed according to the relationship between the two groups of contour elements. - Extract the outline of the image. Furthermore, if the detected contour line element is a new one, the definition is set each time.

〔実施例〕〔Example〕

第1図はこの発明の一実施例を示す2値画像の輪郭線抽
出方法を説明する模式図である。
FIG. 1 is a schematic diagram illustrating a method for extracting contours from a binary image, which is an embodiment of the present invention.

この図において、1aはブランチポイント(分岐点)で
、コンタセグメントcs、、cs2に分岐する。1bは
ブランチポイントで、コンタセグメントC53、C5a
に分岐する。1cはブランチポイントで、コンタセグメ
ントC55、C56に分岐する。1dはブランチポイン
トで、コンタセグメントC57、CSsに分岐する。2
aはミートポイント(合流点)で、コンタセグメントC
32,C33が1つに接続される。2bはミートポイン
トで、コンタセグメントC34,C56が1つに接続さ
れる。2cはミートポイントで、コンタセグメン)C5
I  、C3sが1つに接続される。2dはミートポイ
ントで、コンタセグメントC51、C5sが1つに接続
される。なお、L1〜L8は各走査ラインを示し、A、
Bは2値画像を示している。
In this figure, 1a is a branch point, which branches into contour segments cs, , cs2. 1b is the branch point, contour segments C53, C5a
Branch into. 1c is a branch point, which branches into contour segments C55 and C56. 1d is a branch point, which branches to contour segment C57 and CSs. 2
a is the meet point (merging point) and contour segment C
32 and C33 are connected together. 2b is a meet point where contour segments C34 and C56 are connected together. 2c is the meet point, contour segment) C5
I, C3s are connected together. 2d is a meet point where the contour segments C51 and C5s are connected together. Note that L1 to L8 indicate each scanning line, and A,
B shows a binary image.

第2図(a)〜(d)は第1図に示す各コンタセグメン
トの構成を説明する模式図であり、これらの図において
、11〜14は4連結コード15により2値画像(斜線
で示す)を走査して抽出されるコンタセグメントを構成
するラスタセグメント(輪郭線素)で、各ラスタセグメ
ント11〜14の方向コード(ラスタセグメントタイプ
)は「O〜3Jとなる。ラスタセグメント11.14は
次の走査で得られるラスタセグメントに接続される状態
であることを示し、ラスタセグメント12はラスタセグ
メント同士が接続される状態であることを示し、ラスタ
セグメント13は新規のコンタセグメントが発生した状
態であることを示している。すなわち、第1図において
、走査ラインL1を走査すると、2値画像Aのブランチ
ポイン)laが抽出され、コンタセグメントCS、。
FIGS. 2(a) to 2(d) are schematic diagrams explaining the configuration of each contour segment shown in FIG. ), and the direction code (raster segment type) of each raster segment 11 to 14 is ``O to 3J''.Raster segment 11.14 is Raster segment 12 indicates that raster segments are connected to each other, and raster segment 13 indicates that a new contour segment has been generated. That is, in FIG. 1, when scan line L1 is scanned, branch point )la of binary image A is extracted, and contour segment CS, is extracted.

C52が発生する。すなわち、ブランチポイント1aに
おけるラスタセグメント]3が定義され、各コンタセグ
メントCS+  、C52を構成するラスタセグメント
11,74が次走査毎に得られる。順次走査されて行き
、走査ラインL2を走査すると、2値画像Aのブランチ
ポイント1bが抽出され、コンタセグメン)C53、C
54が発生する。すなわち、ブランチポイント1bにお
けるラスタセグメント13が定義され、各コンタセグメ
ントC33、CS4を構成するラスタセグメント11.
14が次走査毎に得られる。そして、走査ラインL3が
走査されると、コンタセグメントC52、CS3 が接
続されるミートポイント2aが定義され、ラスタセグメ
ント12が得られる。
C52 occurs. That is, the raster segment [3] at the branch point 1a is defined, and the raster segments 11 and 74 forming each contour segment CS+ and C52 are obtained every next scan. When the scanning line L2 is scanned sequentially, the branch point 1b of the binary image A is extracted, and the contour segment) C53, C
54 occurs. That is, the raster segment 13 at the branch point 1b is defined, and the raster segments 11 .
14 are obtained every next scan. Then, when the scanning line L3 is scanned, a meet point 2a where the contour segments C52 and CS3 are connected is defined, and a raster segment 12 is obtained.

この処理を走査ラインL8まで行うと、1つの閉じられ
た輪郭線素群が形成される。
When this process is performed up to the scanning line L8, one closed outline element group is formed.

このようにして得られるコンタセグメントCSI 〜C
36の接続関係は、後述するアクティブチェインACに
より定義され、図示しない記憶手段に作成されるACT
ABLEに格納される。
The contour segment CSI ~C obtained in this way
The connection relationship of 36 is defined by the active chain AC, which will be described later, and is created in a storage means (not shown).
Stored in ABLE.

第1図に示す2値画像AのアクティブチェインACは、
AC+ = (C3+)、 AC2=(C32,C33
争。
The active chain AC of the binary image A shown in FIG.
AC+ = (C3+), AC2=(C32,C33
dispute.

GSa 、 (S6 ’ 、 C35)より定義され、
アクティブチェインA C= (AG+ 、AC:2”
)となる。なお、木はコンタセグメントC5I を逆順
に接続することを意味する。
GSa, defined from (S6', C35),
Active chain A C= (AG+, AC:2”
). Note that the tree means that the contour segments C5I are connected in reverse order.

次に第1図〜第3図を参照しながら2値画像の輪郭線方
向コード化処理動作について説明する。
Next, the outline direction encoding processing operation of a binary image will be explained with reference to FIGS. 1 to 3.

2値画像に対して1回の主走査で得られる輪郭の断片と
なるラスタセグメント11〜14は4連結方向コード1
5によりrO〜3Jにコード化され、ラスクセグメント
検出処理、ラスクセグメント接続処理、ブランチ処理、
ミートポイント処理、追跡終了処理が実行される。以下
、順に上記各処理ト順について説明する。
Raster segments 11 to 14, which are contour fragments obtained by one main scan of a binary image, have a 4-connected direction code of 1.
5 is encoded into rO~3J, and includes rask segment detection processing, rask segment connection processing, branch processing,
Meet point processing and tracking end processing are executed. The order of each of the above processes will be explained below.

第3図はコンタセグメント情報を格納するポインタスタ
ックを説明する模式図であり、PSはポインタスタック
で、ファースト譬イン令ファーストアウトのメモリより
構成され、各コンタセグメントC3iの情報(ID番号
、コンタセグメントC3の最後尾のデータのアドレス情
報等)が記録されている。C5BUFはコンタセグメン
トバッファで、コンタセグメントC5i を4連結チ工
インコート列で記憶している。コンタセグメントバッフ
ァC3BUFは1例えばRAM上に設定される。
FIG. 3 is a schematic diagram illustrating a pointer stack that stores contour segment information. PS is a pointer stack, which is composed of a first-in command first-out memory, and information on each contour segment C3i (ID number, contour segment (address information, etc. of the last data of C3) are recorded. C5BUF is a contour segment buffer that stores contour segments C5i as a four-connected chain incoat row. The contour segment buffer C3BUF is set to 1, for example, on RAM.

ラスタセグメント検出処理(走査線素検出処理)は、2
値画像Aの現在走査中の走査ラインと前走査ラインとを
比較し、そのラインに存在するラスタセグメント11〜
14を抽出する。このとき、ラスクセグメントタイプ、
ラスクセグメント長、例えばラスタセグメント11の場
合、ラスタセグメントタイプが(ア)で、4連結方向コ
ード15がfoj  、fOJ  、r3J 、  ラ
スタセグメント長がr2jとなる。
Raster segment detection processing (scanning line element detection processing) is performed by 2
The current scanning line of the value image A is compared with the previous scanning line, and the raster segments 11 to 11 existing in that line are compared.
Extract 14. At this time, Rusk segment type,
In the case of the raster segment length, for example raster segment 11, the raster segment type is (a), the four-connected direction codes 15 are foj, fOJ, r3J, and the raster segment length is r2j.

ラスタセグメント接続処理(輪郭線素接続処理)は、ラ
スタセグメント検出処理よりラスタセグメン)11.1
4が検出された場合に行われる処理で、検出したラスタ
セグメント11.14をコンタセグメントcs、(i=
1〜8)に接続1するかをポインタスタックPSの内容
に応じて求める。
Raster segment connection processing (contour line element connection processing) is performed using raster segment detection processing (raster segment) 11.1
4 is detected, the detected raster segment 11.14 is converted into a contour segment cs, (i=
1 to 8) is determined according to the contents of the pointer stack PS.

検出したラスタセグメントタイプが(ア)。The detected raster segment type is (a).

(1)の場合は、ポインタスタックPSの先頭データを
取り出し、ラスタセグメントを該当するコンタセグメン
トの最後尾へ接続する。この後、ポインタスタックPS
から取り出したデータの最後尾アドレスを更新してポイ
ンタスタックPSのラストにデータをブツシュする。
In case (1), the first data of the pointer stack PS is taken out and the raster segment is connected to the end of the corresponding contour segment. After this, pointer stack PS
The end address of the data taken out from is updated and the data is bushed at the end of the pointer stack PS.

ブランチポイント処理は、ラスタセグメント検出処理に
おいて、ラスタセグメント13を検出した場合、すなわ
ち、新規のコンタセグメントC5Iが2つ発生した場合
に行う処理で、2つの新規のコンタセグメント、アクテ
ィブチェイン、ブランチポイントのID番号を定義する
。次いで、2つの新規のコンタセグメン)CSi の最
初の4連M方向コード15をコンタセグメントバッファ
C3BUFへ書き込む。続いて、新規のコンタセグメン
) CS i の情報をポインタスタックPSのラスト
に書き込む。これにより定義設定処理が終了する。
Branch point processing is a process that is performed when raster segment 13 is detected in raster segment detection processing, that is, when two new contour segments C5I are generated. Define ID number. Next, the first quadruple M direction code 15 of the two new contour segments) CSi is written into the contour segment buffer C3BUF. Subsequently, the information of the new contour segment) CS i is written to the last of the pointer stack PS. This ends the definition setting process.

ミートポイント処理(輪郭線素群表現処理)は、ラスク
セグメント12を検出した場合、すなわち、2つのCS
 iが1つの点(ミートポイント)で出会った場合の処
理で、ポインタスタックPSのトップからC3情報を取
り出し、ラスクセグメントを該当するコンタセグメント
C51へ接続した後、ポインタスタックPSのトップ2
個の情報を捨てるとともに、アクティブチェインの組合
せも更新する。
The meet point processing (contour line element group representation processing) is performed when the rask segment 12 is detected, that is, when the two CS
In the process when i meets at one point (meet point), C3 information is extracted from the top of the pointer stack PS, the rask segment is connected to the corresponding contour segment C51, and then the top 2 of the pointer stack PS is
At the same time, the combination of active chains is updated.

追跡終了処理(抽出処理)は、ミートポイント処理終了
後、2つのアクティブチェインの発生源であるブランチ
ポイントが同一である場合に行う処理で、ACTABL
Eを参照してその輪郭線を構成するコンタセグメントと
その接続順序を調べ、必要なコンタセグメントを正しく
接続して1つの4連結チ工インコード列を作成する。こ
れにより1つの輪郭線の検出が終了したことになる。
The trace end process (extraction process) is a process that is performed when the branch points that are the origin of two active chains are the same after the meet point process is completed, and ACTABL
Check the contour segments that make up the contour line and their connection order with reference to E, and connect the necessary contour segments correctly to create one 4-connected in-code string. This means that the detection of one contour line has been completed.

次に第4図を参照しながらこの発明によるz値画像の輪
郭線抽出方法について説明する。
Next, a method for extracting contours from a z-value image according to the present invention will be explained with reference to FIG.

第4図はこの発明による2個画像の輪郭線抽出方法を説
明するフローチャートである。なお、(1)〜(9)は
各ステップを示す。
FIG. 4 is a flowchart illustrating a method for extracting contours from two images according to the present invention. Note that (1) to (9) indicate each step.

2個画像を走査して、ラスクセグメント検出処理を実行
しく1)、検出したラスクセグメントタイプを判定しく
2)、ラスクセグメントタイプが(ア)、(1)の場合
は、ラスクセグメント検出処理で得られたラスクセグメ
ント11.14について、そのラスクセグメントの方向
コードに該当するコンタセグメントC51に接続する処
理を行う(3)。次いで、1217分の接続処理が終了
したかどうかを判断しく4)、NOならばステップ(1
)に戻り、YESならば走査ラインの更新を行いステッ
プ(1)に戻る(5)。
Scan two images and execute the rask segment detection process 1) and determine the detected rask segment type 2) If the rask segment type is (a) or (1), the rask segment detection process Processing is performed to connect the rask segment 11.14 to the contour segment C51 corresponding to the direction code of the rask segment (3). Next, it is determined whether the connection process for 1217 minutes has been completed (4), and if NO, step (1) is determined.
), and if YES, the scan line is updated and the process returns to step (1) (5).

〜方、ステップ(2)の判断で、ラスクセグメントタイ
プが(つ)の場合は、すなわち、ラスクセグメント検出
処理において、ラスクセグメント13を検出した場合は
、新規のコンタセグメントCS i が2つ発生したこ
とになり、新規のコンタセグメント、アクティブチェイ
ン、ブランチポイントのID番号を定義する。次いで、
新規のコンタセグメン)C3; の最初の4連結方向ニ
ード15をコンタセグメントバッファC3BUFへ書き
込む。続いて、新規のコンタセグメン)CSiの情報を
ポインタスタックPSに書き込むブランチポイント処理
を実行しく6)、ステップ(4)に戻る。一方、ステッ
プ(2)の判断で、ラスクセグメントタイプが(イ)の
場合は、ポインタスタックPSのトップからC8情報を
取り出し、ラスクセグメントを該当するコンタセグメン
トCSIへ接続した後、ポインタスタックPSのトップ
2個の情報を捨てるとともに、アクティブチェインの組
合せも更新するミートポイント処理を実行しく7) 、
  2つのアクティブチェインの発生源であるブランチ
ポイントが同一であるかどうかを判定しく8)、Noの
場合はステップ(4)に戻り、YESの場合は、1つの
輪郭線の検出が終了したことになるので、ACTABL
Eを参照してその輪郭線を構成するコンタセグメントと
その接続順序を調べ、必要なコンタセグメントを正しく
接続して1つの4連結チ工インコード列を作成する追跡
終了処理を実行しく9)、ステップ(4)に戻る。
On the other hand, if the rask segment type is (one) in step (2), that is, if rask segment 13 is detected in the rask segment detection process, two new contour segments CS i have occurred. Therefore, ID numbers for new contour segments, active chains, and branch points are defined. Then,
Write the first four connected direction needs 15 of the new contour segment) C3; to the contour segment buffer C3BUF. Next, branch point processing is executed to write information on the new contour segment CSi to the pointer stack PS6), and the process returns to step (4). On the other hand, if the rask segment type is (A) as determined in step (2), the C8 information is extracted from the top of the pointer stack PS, the rask segment is connected to the corresponding contour segment CSI, and then the top of the pointer stack PS is Execute meet point processing that discards the two pieces of information and also updates the combination of active chains 7).
Determine whether the branch points that are the sources of the two active chains are the same (8). If NO, return to step (4); if YES, it is determined that one contour has been detected. Therefore, ACTABL
Check the contour segments that make up the contour line and their connection order by referring to E, and execute the trace termination process to correctly connect the necessary contour segments and create one 4-connected chain input code string9). Return to step (4).

次に第5図を参照しながらラスクセグメント検出処理に
ついてさらに説明する。
Next, the rask segment detection process will be further explained with reference to FIG.

第5図はこの発明によるラスクセグメント検出処理を説
明するフローチャートである。なお、(1)〜(13)
は各ステップを示す。
FIG. 5 is a flowchart illustrating the rask segment detection process according to the present invention. In addition, (1) to (13)
indicates each step.

現走査ラインの白/黒変化ポジションを走査より得て(
1)、前走査ラインのデータと合せ変化ポジションの小
さい順にソーティングする(2)。そして、ソーティン
グされたデータの先頭より2つの白/黒変化ポジション
データを取り出しく3)、2つのデータが現走査ライン
および前走査ラインよりそれぞれ取り出されたものかど
うかを判定しく4)、YESならば前走査ラインの変化
ポジションの値が現走査ラインのものより小さいかどう
かを判定しく5)、YESならばラスクセグメントタイ
プを(ア)と判定しステップ(11)以降に進み(8)
、Noならばラスクセグメントタイプを(工)と判定し
ステップ(11)以降に進む(7)。
Obtain the white/black change position of the current scan line from scanning (
1), sorting is performed in descending order of position change based on the data of the previous scanning line (2). Then, extract two pieces of white/black change position data from the beginning of the sorted data 3), determine whether the two data are extracted from the current scanning line and the previous scanning line, respectively 4), if YES For example, it is determined whether the change position value of the previous scanning line is smaller than that of the current scanning line (5), and if YES, the rask segment type is determined as (a) and the process proceeds to step (11) and subsequent steps (8).
, if No, the rask segment type is determined to be (work) and the process proceeds to step (11) and subsequent steps (7).

一方、ステップ(4)の判断で、Noの場合は、両方の
データが前走査ラインのものかどうかを判定しく8)、
YESならばラスクセグメントタイプを(イ)と判定し
ステップ(11)以降に進み(9)、Noならばラスク
セグメントタイプは(つ)と判定する(10)。
On the other hand, if the determination in step (4) is No, it is determined whether both data are from the previous scanning line8).
If YES, the rusk segment type is determined to be (a) and the process proceeds to step (11) and subsequent steps (9); if no, the rusk segment type is determined to be (one) (10).

次いで、ステップ(f3)  、 (7)  、 (9
)  、 (10)で判定されたラスクセグメントタイ
プに応じて輪郭線抽出のための処理、すなわち、ブラン
チポイント処理、ミートポイント処理、コンタセグメン
ト処理を行う(第4図参照) (11)。次いで、1ラ
イン分の全てのデータ処理を終了したかどうかを判定し
く12)、Noならばステップ(3)に戻り、残りのデ
ータについて同様の処理を行い、YESならば走査ライ
ンの更新を行いステップ(1)に戻る(13)。この操
作を走査ラインが終了するまで繰り返す。
Then, steps (f3), (7), (9
), Processing for contour extraction, that is, branch point processing, meet point processing, contour segment processing, is performed according to the rask segment type determined in (10) (see FIG. 4) (11). Next, it is determined whether all data processing for one line has been completed (12). If No, return to step (3) and perform the same processing on the remaining data; if YES, update the scanning line. Return to step (1) (13). This operation is repeated until the scanning line is completed.

なお、上記実施例では、画像情報が2値画像の場合につ
いて説明したが、入力画像が多値画像の場合にもラスク
セグメント検出処理を多値画像用のものに置き換えるこ
とにより容易に適用できる。すなわち、入力画像が多値
画像の場合は、1走査ライン上に同色画像の連(テン)
として扱えばよい。以ド、多値画像のラスクセグメント
抽出処理方法について説明する。
In the above embodiment, the case where the image information is a binary image has been described, but the present invention can be easily applied even when the input image is a multi-value image by replacing the rask segment detection process with one for a multi-value image. In other words, if the input image is a multivalued image, a series of images of the same color is created on one scanning line.
You can treat it as Hereinafter, a method for extracting a rask segment from a multivalued image will be explained.

第6図は後続ラン集合を説明する模式図であり、21は
現在ランで、処理対象となっているランである。22は
次ランで、現在ランの右隣のランである。23a〜23
eはランである。なお、21a、21bは後続ランで、
後続ランポインタPに示されるランおよび以右のランの
うちで現在ランと連結、かつ、次ランと連結でないもの
、および現在ラン、次ランの両者に連結で現在ランと同
色となる。
FIG. 6 is a schematic diagram illustrating a subsequent run set, and 21 is the current run, which is the run to be processed. 22 is the next run, which is the run to the right of the current run. 23a-23
e is a run. Note that 21a and 21b are subsequent runs,
Among the runs indicated by the subsequent run pointer P and the runs to the right, those connected to the current run but not connected to the next run, and those connected to both the current run and the next run have the same color as the current run.

ただし、ラン23cが現在ラン21と同色であれば後続
ラン集合のメンバーとなる。なお、後続テン集合は空集
合の場合もある。
However, if the run 23c has the same color as the current run 21, it becomes a member of the subsequent run set. Note that the subsequent ten set may be an empty set.

第7図は連続ラン集合を説明する模式図であり、第6図
と同一のものには同じ符号を付している。
FIG. 7 is a schematic diagram illustrating a continuous run set, and the same parts as in FIG. 6 are given the same reference numerals.

この図において、25a〜25hはランで、各ラン25
a  、25c 、25e  、25gは現在ラン21
と異なる色を持つ新生ランであることを示している。各
ラン25b 、25d  、25f  、25hは現在
ラン21と同色である。後続ラン集合の定義によりラン
25a〜25gは現在ラン21の後続ランであるが、こ
のうち現在ラン21と同色なラン集合を連続ラン集合と
する。すなわち、ラン25a  、25c  、25e
  、25gは連続ランである。ただし、i!!続ラソ
ラン集合集合の場合、現在ラン21の色はその場で停止
する停止ランとなる。また、空集合の後続ラン集合を持
つ現在テンの真下に現在ラン21の左右のランと同色な
色を持つ合併ランが発生する場合もある。
In this figure, 25a to 25h are runs, and each run 25
a, 25c, 25e, 25g are currently run 21
It shows that it is a new orchid with a different color. Each run 25b, 25d, 25f, 25h has the same color as the current run 21. According to the definition of a subsequent run set, runs 25a to 25g are subsequent runs to the current run 21, and among these, a run set that has the same color as the current run 21 is defined as a continuous run set. That is, runs 25a, 25c, 25e
, 25g is a continuous run. However, i! ! In the case of a continuation lasolan set, the color of the current run 21 is a stop run that stops at that spot. Furthermore, a merged run having the same color as the runs on the left and right of the current run 21 may occur directly below the current ten that has a subsequent run set of the empty set.

次に第8図、第9図を参照しながら多値画像の輪郭線抽
出方法について説明する。
Next, a method for extracting contour lines from a multivalued image will be described with reference to FIGS. 8 and 9.

第8図はランとランとの関係を示す模式図であり、3]
は連続ランの左右R3を示し、32は新生テンRSペア
を示し、33は中間連続ランの左右RSペアを示してい
る。
Figure 8 is a schematic diagram showing the relationship between runs, and 3]
indicates the left and right R3 of the continuous run, 32 indicates the new ten RS pair, and 33 indicates the left and right RS pair of the intermediate continuous run.

第9図はこの発明の他の実施例を示す多値画像の輪郭線
抽出方法を説明するフローチャー1・である。なお、(
1)〜(14)は各ステップを示す。このうち、ステッ
プ(1)〜(9)は第4図のラスクセグメント検出処理
に相当する。
FIG. 9 is a flowchart 1 for explaining a method for extracting contours from a multivalued image, showing another embodiment of the present invention. In addition,(
1) to (14) indicate each step. Among these steps, steps (1) to (9) correspond to the rask segment detection process shown in FIG.

まず、現在ラン21を設定する(1)。次いで、この現
在ラン21に対して後続ラン集合、連続ラン集合を求め
る(2)。次いで、後続ラン集合が空集合であるかどう
かを判断しく3)、YESならば現在ランは停止ランで
あるので現在ランを停止ランとしてファースト−イン管
ファーストーアウトのメモリであるRSバッファにその
旨を記録する(5)。次いで、合併ランが存在するかど
うかを判断しく8)、NOならばステップ(10)以降
に進み、YESならば該当するラスクセグメントデータ
を修正する合併ラン処理を行いステップ(10)以降に
進む(7)。
First, the current run 21 is set (1). Next, a subsequent run set and a continuous run set are determined for this current run 21 (2). Next, it is determined whether the subsequent run set is an empty set (3), and if YES, the current run is a stop run, so the current run is set as a stop run and that information is stored in the RS buffer, which is a first-in first-out memory. Record (5). Next, it is determined whether or not a merged run exists (8), and if NO, proceed to step (10) and subsequent steps; if YES, merge run processing is performed to correct the corresponding rask segment data, and proceed to step (10) and subsequent steps ( 7).

一方、ステップ(3)の判断で、Noの場合、すなわち
、後続ラン集合が空集合でない場合は、連続ラン集合が
空かどうかを判定しく4)、Noならば現在ランの左右
のテンをはじめとする現在ランと後続ラン集合との間で
存在するR3を左から順にRSバッファに記録しく8)
、YESならば現在ランは停止ランとして後続テンは新
生テン集合に対してラスタセグメント検出を行い、その
結果を−EIRSバー7フアにストアしておく。
On the other hand, if the judgment in step (3) is No, that is, if the subsequent run set is not an empty set, it is determined whether the continuous run set is empty or not. Record the R3s existing between the current run and the subsequent run set in the RS buffer in order from the left.8)
, if YES, the current run is stopped, and the subsequent ten performs raster segment detection on the new ten set, and the result is stored in the -EIRS bar.

次いで、RSバッファの先頭から1つのRSデータを取
り出しく10)、そのラスタセグメントタイプに応じて
ブランチポイント処理、ミートポイント処理、コンタセ
グメント接続処理等を行う(11)。次いで、RSバッ
ファが空であるかどうかを判定しく12)、Noならば
ステップ(10)に戻り、YESならば続いて、現在ラ
ンポインタ、後続テンポインタを更新する(13)、次
いで、前画面の走査が終了したかどうかを判断しく14
)、YESならば制御を終了し、NOならばステップ(
1)に戻る。
Next, one piece of RS data is taken out from the beginning of the RS buffer (10), and branch point processing, meet point processing, contour segment connection processing, etc. are performed depending on the raster segment type (11). Next, it is determined whether the RS buffer is empty (12), and if No, the process returns to step (10), and if YES, the current run pointer and subsequent tempo pointer are updated (13), and then the previous screen is updated. 14.
), if YES, end the control; if NO, step (
Return to 1).

このように、多値画像においても、1回の画像走査によ
り、多値画像の輪郭線情報を高速に抽出できる。
In this way, even in a multi-valued image, contour line information of the multi-valued image can be extracted at high speed by one image scan.

なお、上記実施例では2値画像データをダイレクトに処
理する場合について説明したが、2値画像データを木モ
走査方向に圧縮した圧縮データに同様の処理を施せば、
より高速に輪郭線を抽出できることはごうまでもない。
In the above embodiment, the case where binary image data is directly processed has been explained, but if similar processing is performed on compressed data obtained by compressing binary image data in the scanning direction,
It goes without saying that contour lines can be extracted faster.

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

以E説明したように、この発明は画像を水平走査する毎
に走査線幅内における画像の輪郭新月に対応する走査線
素を検出する走査線素検出処理と、この走査線素検出処
理で検出された走査線素の最後尾に接続する輪郭線素接
続処理と、新生輪郭線素を定義設定する定義設定処理と
、2つの輪郭線素を合併させて輪郭線鵞群として表現す
る輪郭線素群表現処理と、2つの輪郭線素部間の関係に
応じて閉じた輪郭線素の形成有無を判定し、輪郭線を抽
出する抽出処理と、からなるので、検出されるラスタセ
グメントをそれ以前の走査で形成された輪郭線素の1つ
に正確に接続しながら1回の画面走査で輪郭線を全て抽
出、符号化でき、2値画像のみならず多値画像の同色領
域の輪郭線をも高速に効率よく抽出できる優れた効果を
有する。
As explained hereafter, the present invention includes a scanning line element detection process that detects a scanning line element corresponding to a contour new moon of an image within a scanning line width every time an image is horizontally scanned, and A contour line element connection process that connects to the end of the detected scanning line element, a definition setting process that defines and sets a new contour line element, and a contour line that merges two contour line elements and expresses them as a group of contour lines. It consists of prime group expression processing and extraction processing that determines whether a closed contour element is formed according to the relationship between two contour line elements and extracts the contour. All contour lines can be extracted and encoded in one screen scan while accurately connecting to one of the contour elements formed in the previous scan, and the contour lines of the same color area of not only binary images but also multi-value images can be extracted and encoded. It has an excellent effect of being able to extract quickly and efficiently.

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

第1図はこの発明の一実施例を示す2値画像の輪郭線抽
出方法を説明する模式図、ff12図は第1図ニ示す各
コンタセグメントの構成を説明する模式図、第3図はコ
ンタセグメント情報を格納するポインタスタックを説明
する模式図、第4図はこの発明によるz値画像の輪郭線
抽出方法を説明するフローチャート、第5図はこの発明
によるラスタセグメント検出方法を説明するフローチャ
ート、第6図は後続ラン集合を説明する模式図、第7図
は連続ラン集合を説明する模式図、第8図はランとラン
との関係を示す模式図、第9図はこの発明の他の実施例
を示す多値画像の輪郭線抽出方法を説明するフローチャ
ート、第10図はラスターデーターベクトルデータ変換
(R−V変換)のマトリクスパターンを説明する模式図
、第11図はR−V変換動作を説明する模式図、第12
図はR−V変換動作を説明するフローチャートである。 図中、1a〜1dはブランチポイント、2d〜2dはミ
ートポ・インド、11〜14はラスタセグメント、15
は4連結方向コード、25a〜25hはテンである。 第1図 第4図 第5図 第6図 第10図 第11図 第12図
FIG. 1 is a schematic diagram illustrating a method for extracting contour lines from a binary image showing an embodiment of the present invention, FIG. ff12 is a schematic diagram illustrating the configuration of each contour segment shown in FIG. FIG. 4 is a schematic diagram illustrating a pointer stack for storing segment information; FIG. 4 is a flowchart illustrating a method for extracting contours of a z-value image according to the present invention; FIG. 5 is a flowchart illustrating a raster segment detection method according to the present invention; FIG. 6 is a schematic diagram illustrating a subsequent run set, FIG. 7 is a schematic diagram illustrating a continuous run set, FIG. 8 is a schematic diagram showing the relationship between runs, and FIG. 9 is a schematic diagram illustrating the relationship between runs. A flowchart illustrating a method for extracting contour lines from a multi-valued image showing an example, FIG. 10 is a schematic diagram illustrating a matrix pattern of raster data vector data conversion (R-V conversion), and FIG. 11 is a schematic diagram illustrating the R-V conversion operation. Schematic diagram to explain, 12th
The figure is a flowchart explaining the RV conversion operation. In the figure, 1a to 1d are branch points, 2d to 2d are meetpo India, 11 to 14 are raster segments, and 15
is a 4-connected direction code, and 25a to 25h are tens. Figure 1 Figure 4 Figure 5 Figure 6 Figure 10 Figure 11 Figure 12

Claims (1)

【特許請求の範囲】[Claims]  画像を水平走査する毎に走査線幅内における画像の輪
郭断片に対応する走査線素を検出する走査線素検出処理
と、この走査線素検出処理で検出された走査線素をそれ
以前の走査で形成された走査線素の最後尾に接続する輪
郭線素接続処理と、新生輪郭線素を定義設定する定義設
定処理と、2つの輪郭線素を合併させて輪郭線素群とし
て表現する輪郭線素群表現処理と、2つの輪郭線素群間
の関係に応じて閉じた輪郭線素の形成有無を判定し、輪
郭線を抽出する抽出処理と、からなることを特徴とする
画像の輪郭線抽出方法。
Each time an image is horizontally scanned, a scanning line element detection process that detects a scanning line element corresponding to a contour fragment of the image within the scanning line width, and a scanning line element detected by this scanning line element detection process is detected in the previous scan. A contour line element connection process that connects to the end of the scanning line element formed by , a definition setting process that defines and sets a new contour line element, and a contour that merges two contour line elements and expresses it as a group of contour line elements. An image contour characterized by comprising a line element group expression process, and an extraction process of determining whether a closed contour line element is formed according to the relationship between two contour line element groups and extracting a contour line. Line extraction method.
JP60207773A 1985-09-21 1985-09-21 Method for extracting contour line of picture Pending JPS6269387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60207773A JPS6269387A (en) 1985-09-21 1985-09-21 Method for extracting contour line of picture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60207773A JPS6269387A (en) 1985-09-21 1985-09-21 Method for extracting contour line of picture

Publications (1)

Publication Number Publication Date
JPS6269387A true JPS6269387A (en) 1987-03-30

Family

ID=16545284

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60207773A Pending JPS6269387A (en) 1985-09-21 1985-09-21 Method for extracting contour line of picture

Country Status (1)

Country Link
JP (1) JPS6269387A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5941230A (en) * 1982-08-31 1984-03-07 Tokyo Seat Kk Method for forming buttonlike pattern on skin material

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5941230A (en) * 1982-08-31 1984-03-07 Tokyo Seat Kk Method for forming buttonlike pattern on skin material

Similar Documents

Publication Publication Date Title
JPH0196771A (en) Recognizing system for circular arc part
JPS5851388A (en) Direction code layout method
KR920005196B1 (en) Picture processing device
US5228097A (en) Method for registering image data
JPS6269387A (en) Method for extracting contour line of picture
JP3150856B2 (en) Image processing method
JPH04287179A (en) Method and device for processing image information and image information transmitter
Strathy et al. A sequential method of extracting contour chains from an image
JP2789622B2 (en) Character / graphic area determination device
JPS6074092A (en) Extracting circuit of contour shape information
JPS6116380A (en) Area dividing system
JPH0421911B2 (en)
KR100332753B1 (en) Image processing method of image processing system
JPH022189B2 (en)
JPS61147379A (en) Optical character reader
JPS6279580A (en) Picture processor
JP2507949B2 (en) Character / graphic area determination device
JPS61115176A (en) Binary image processing device
JPH0896140A (en) Method for compressing image data
JPH0247786B2 (en)
JPS6074093A (en) Extracting circuit of contour shape information
JPS63208177A (en) Pattern feature extracting method
JPH0696274A (en) Recognizing method for character or the like
JPH05233798A (en) Image processing method
JPH11345333A (en) Labeling processing system and method therefor