JPH03177982A - Image processing method - Google Patents

Image processing method

Info

Publication number
JPH03177982A
JPH03177982A JP1317286A JP31728689A JPH03177982A JP H03177982 A JPH03177982 A JP H03177982A JP 1317286 A JP1317286 A JP 1317286A JP 31728689 A JP31728689 A JP 31728689A JP H03177982 A JPH03177982 A JP H03177982A
Authority
JP
Japan
Prior art keywords
pixel
vector
vectors
pixels
boundary
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
JP1317286A
Other languages
Japanese (ja)
Other versions
JP2967107B2 (en
Inventor
Ryohei Kumagai
熊谷 良平
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.)
Ezel Inc
Original Assignee
Ezel Inc
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 Ezel Inc filed Critical Ezel Inc
Priority to JP1317286A priority Critical patent/JP2967107B2/en
Publication of JPH03177982A publication Critical patent/JPH03177982A/en
Application granted granted Critical
Publication of JP2967107B2 publication Critical patent/JP2967107B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To express a recessed right angle part sharply by extracting a specific picture element as a boundary picture element when at least one of eight picture elements that exist in the neighborhood of the specific picture element is shown as a background picture element. CONSTITUTION:When at least one of the eight picture elements (b-i) that exist in the neighborhood of the specific picture element (a) is shown as the background picture element, the specific picture element (a) is set as the boundary picture element. As a result, the picture elements a1, a2, a3, and a4 are also recognized as the boundary picture elements, and it is decided that the picture element shown in hutching in figure is the boundary picture element of a graphic, and also, the picture element a5 at the corner of the recessed right angle part is recognized as the boundary picture element. Therefore, when the arrangement of a vector representing relation between adjacent picture elements is generated from a found boundary picture element and the contour of the graphic is reproduced by using the arrangement of the vector, the recessed right angle part can be expressed sharply.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は画像処理方法に係り、特に図形の特徴を表す境
界画素を抽出して図形のベクトル化を行って画像処理す
る画像処理方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an image processing method, and more particularly to an image processing method in which boundary pixels representing features of a figure are extracted and the figure is vectorized for image processing.

〔従来の技術〕[Conventional technology]

画像処理において図形を記録する場合のデータの形式と
して、図形を構成する画素を全て含んだデータ、すなわ
ちラスタデータと、図形の特徴を表す画素の集合、例え
ば境界画素の集合を予め定められた8つのベクトルを用
いてベクトルの配列で表したベクトルデータと、がある
。一般にベクトルデータ、特に図形の境界画素のベクト
ルデータはラスタデータに比較してデータ量が少なくて
済むため、図形を記憶するメモリの記憶容量を節減する
ことができる。また、データ量が少ないため図形に対す
る様々な処理をより少ない演算回数で実現できる。この
ため、例えば図形の拡大、縮小、変形あるいは凸閉包の
形成等の処理を高速で行うことができ、このベクトルデ
ータは有効なデータである。
When recording figures in image processing, data formats include data that includes all the pixels that make up the figure, that is, raster data, and a predetermined set of pixels that represent the characteristics of the figure, such as a set of boundary pixels. There is vector data that is expressed as a vector array using two vectors. In general, vector data, particularly vector data of boundary pixels of a figure, requires less data than raster data, so the storage capacity of a memory for storing figures can be reduced. Furthermore, since the amount of data is small, various processing on graphics can be accomplished with fewer calculations. Therefore, for example, processing such as enlarging, reducing, or deforming a figure or forming a convex hull can be performed at high speed, and this vector data is effective data.

以下、図形の境界画素のベクトルデータを生成する従来
のベクトル化方法を示す。
A conventional vectorization method for generating vector data of boundary pixels of a figure will be described below.

図形の境界画素のベクトルデータを生成するためには、
前処理として図形の境界画素を抽出する処理が必要であ
る。従来の境界画素抽出方法は、第30図に示すように
、判定対象である画素50の近傍に注目し、上下方向に
隣接する画素54.58及び左右方向に隣接する画素5
2.56の4画素(所謂4近傍の画素〉のいずれかが背
景画素である場合に画素50を図形の境界画素として抽
出している。このような抽出処理を画像中の全ての画素
、または図形を構成する全ての画素に対して行う。第3
2図に示す図形60に対し前記抽出処理を行った場合、
第33図においてハツチングで示される画素が図形60
の境界画素として抽出される。
To generate vector data of boundary pixels of a figure,
As preprocessing, processing to extract boundary pixels of the figure is required. As shown in FIG. 30, the conventional boundary pixel extraction method focuses on the vicinity of a pixel 50 to be determined, and extracts vertically adjacent pixels 54 and 58 and horizontally adjacent pixels 5.
When any of the 4 pixels of 2.56 (so-called 4 neighboring pixels) is a background pixel, pixel 50 is extracted as a boundary pixel of the figure.This extraction process is applied to all pixels in the image or This is done for all pixels that make up the figure.Third
When the extraction process is performed on the figure 60 shown in FIG. 2,
In FIG. 33, the pixels indicated by hatching are the figure 60.
are extracted as boundary pixels.

次に、抽出された境界画素からベクトルデータを生成す
る。第33図に示す境界画素列を反時計回りまたは時計
回りに辿り、第31図に示すような上下方向、左右方向
、斜め方向の8方向を区別して表すベクトルを用いて、
隣接する画素間の関係を表す。このベクトルには、各々
コードが付されている。第34図は、例として第33図
に示す境界画素列を反時計回りに辿った場合に付される
コードを示している。このコードを並べたコード列(r
660007660022222444444」〉がベ
クトルデータである。ここで、第31図に示すコードを
用いて生成されたベクトルデータは、特にチェーンコー
ドと呼ばれている。
Next, vector data is generated from the extracted boundary pixels. Tracing the boundary pixel array shown in FIG. 33 in a counterclockwise or clockwise direction, and using vectors that separately represent the eight directions of vertical, horizontal, and diagonal directions as shown in FIG. 31,
Represents the relationship between adjacent pixels. Each of these vectors is assigned a code. FIG. 34 shows, as an example, a code that is attached when the boundary pixel array shown in FIG. 33 is traced counterclockwise. A code string (r
660007660022222444444'' is vector data. Here, vector data generated using the code shown in FIG. 31 is particularly called a chain code.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、従来のベクトル化方法においては、第2
図(A)乃至(D)に示すように判定対象画素の斜め方
向に背景画素が存在した場合、該判定対象画素は境界画
素とされない。このため、第33図に示すように図形の
凹の直角部の隅の画素62は境界画素として抽出されな
い。従って、従来のベクトル化方法によって生成された
ベクトルデータから図形の輪郭を再現した場合、輪郭に
おける凹の直角部の隅が斜めに再現されるため、凹の直
角部が鮮明に表現されない、という問題があった。
However, in conventional vectorization methods, the second
As shown in FIGS. (A) to (D), if a background pixel exists diagonally to a pixel to be determined, the pixel to be determined is not determined as a boundary pixel. Therefore, as shown in FIG. 33, the pixel 62 at the corner of the concave right angle part of the figure is not extracted as a boundary pixel. Therefore, when the contour of a figure is reproduced from vector data generated by the conventional vectorization method, the corners of the concave right angles in the contour are reproduced obliquely, so the problem is that the concave right angles are not clearly expressed. was there.

再現される図形の品質はベクトルデータの評価の対象と
して重要であり、特に漢字などの文字から従来のベクト
ル化方法により生成したベクトルデータを記録し、再現
する場合、再現された図形〈文字)の品質は商品価値に
大きな影響を与える。
The quality of the reproduced figures is important as an evaluation target for vector data, and especially when recording and reproducing vector data generated from characters such as kanji using conventional vectorization methods, the quality of the reproduced figures (characters) is important. Quality has a major impact on product value.

本発明は上記事実を考慮して威されたもので、凹の直角
部を鮮明に表現し得る画像処理方法を提供することを目
的とする。
The present invention was developed in consideration of the above-mentioned facts, and an object of the present invention is to provide an image processing method that can clearly express the right angle portion of a concave portion.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的を遠戚するために請求項(1)記載の発明は、
第1図に示すように、特定画素を図形の画素とし、該特
定画素aの近傍に存在する8画素bSc、d、eS f
、gShS iの少なくとも1個の画素が背景の画素で
ある場合に前記特定画素aを前記図形の境界画素とする
処理を、前記特定の画素と前記特定の画素の近傍に存在
する8画素とからなる9画素ずつ一定の順序で行って外
側境界画素列と内側境界画素列とを求め、外側境界画素
列と内側境界画素列とで区別できるように図形の外側境
界画素列と内側境界画素列とを辿り、特定画素aの近傍
に存在する8画素bSc、dSe、f、gSh、iの特
定画素aを基準とする方向を特定画素aを始点として表
す上下方向ベクトルV2、V6左右方向ベクトルV1、
Vo、及び斜め方向ベクトルV1、■4、■3、■、の
8つのベクトルの配列によって、隣接する画素間の関係
を表し、画像処理する。
In order to achieve the above object distantly, the invention as claimed in claim (1),
As shown in FIG. 1, a specific pixel is a pixel of a figure, and 8 pixels bSc, d, eS f existing in the vicinity of the specific pixel a are
, when at least one pixel of gShS i is a background pixel, the process of making the specific pixel a a boundary pixel of the figure is performed from the specific pixel and 8 pixels existing in the vicinity of the specific pixel. The outer boundary pixel column and the inner boundary pixel column are determined by 9 pixels each in a fixed order. , vertical direction vectors V2, V6, horizontal direction vectors V1, which express the direction of eight pixels bSc, dSe, f, gSh, i existing in the vicinity of the specific pixel a, with the specific pixel a as a reference point, starting from the specific pixel a.
The relationship between adjacent pixels is represented by an array of eight vectors, Vo, and diagonal direction vectors V1, 4, 3, and 2, and image processing is performed.

また、請求項(2〉記載の発明は、外側境界画素列と内
側境界画素列とで区別できるように図形の外側境界画素
列と内側境界画素列とを辿り、第1図に示すように、特
定画素aの近傍に存在する8画素す、c、dSeS f
、g、h、iの特定画素aを基準とする方向を特定画素
aを始点とじて表す上下方向ベクトルv2、v6、左右
方向ベクトルV4 、Vo及び斜め方向ベクトルVl、
V3、v5、V7の8つのベクトルの配列によって、隣
接する画素間の関係を表し、画像処理する画像処理方法
において、外側境界画素列に対しては、斜め方向ベクト
ルの前後に左右方向ベクトルの一方及び上下方向ベクト
ルの一方が存在しかつこれらの3つのベクトルの始点を
共通にしたときの方向が所定の鋭角ずつ外側境界画素を
辿る方向と逆方向に変化している部分の斜め方向ベクト
ルを、斜め方向ベクトルの前後に存在するベクトルに分
解して表し、内側境界画素列に対しては、斜め方向ベク
トルの前後に左右方向ベクトルの一方及び上下方向ベク
トルの一方が存在しかつこれらの3つのベクトルの始点
を共通にしたときの方向が所定の鋭角ずつ外側境界画素
を辿る方向と同方向に変化している部分の斜め方向ベク
トルを、斜め方向ベクトルの前後に存在するベクトルに
分解して表すようにしたことを特徴としている。
Further, the invention described in claim (2) traces the outer boundary pixel column and the inner boundary pixel column of the figure so that the outer boundary pixel column and the inner boundary pixel column can be distinguished, and as shown in FIG. 8 pixels near the specific pixel a, c, dSeS f
, g, h, i, with the specific pixel a as the reference point, vertical vectors v2, v6, horizontal vectors V4, Vo, and diagonal vectors Vl,
In an image processing method that expresses the relationship between adjacent pixels by arraying eight vectors V3, v5, and V7, and performs image processing, for the outer boundary pixel column, one of the left and right vectors is placed before and after the diagonal vector. and the diagonal direction vector of the part where one of the up and down direction vectors exists and the direction changes by a predetermined acute angle in the opposite direction to the direction tracing the outer boundary pixel when the starting point of these three vectors is common, It is expressed by decomposing it into vectors that exist before and after the diagonal direction vector, and for the inner boundary pixel column, one of the left and right vectors and one of the up and down direction vectors exist before and after the diagonal direction vector, and these three vectors The diagonal vector in the part where the direction changes by a predetermined acute angle in the same direction as the direction tracing the outer boundary pixel when the starting point of It is characterized by the fact that

また、請求項(1)及び請求項(2)の発明においては
、8つのベクトルをコードで表し、隣接する画素間の関
係をコード列から成るチェーンコードで表すことができ
る。
Furthermore, in the inventions of claims (1) and (2), eight vectors can be represented by codes, and the relationship between adjacent pixels can be represented by a chain code made up of code strings.

〔作用〕[Effect]

請求項(1)記載の発明では、図形の特定画素とし、第
1図に示すように、該特定画素aの近傍に存在する8画
素bz CSL ez fs gShslの少なくとも
1個の画素が背景の画素である場合に前記特定画素aを
前記図形の境界画素とする。
In the invention described in claim (1), a specific pixel of a figure is defined as a background pixel, and as shown in FIG. In this case, the specific pixel a is set as a boundary pixel of the figure.

この結果、例えば、第2図(A)乃至(D)に示す画素
at 、a2 、a3 、a4 も境界画素になり、本
請求項(1)の発明に基づいて第32図に示す図形60
の境界画素を求めた場合、第3図においてハツチングで
示す画素が図形の境界画素であると判断される。すなわ
ち、凹の直角部の隅の画素a、も境界画素とされること
になる。
As a result, for example, the pixels at, a2, a3, and a4 shown in FIGS. 2(A) to 2(D) also become boundary pixels, and the figure 60 shown in FIG.
When the boundary pixels of the figure are determined, the pixels indicated by hatching in FIG. 3 are determined to be the boundary pixels of the figure. In other words, the pixel a at the corner of the right angle portion of the concave portion is also set as a boundary pixel.

このため、本請求項(1)の発明に基づいて求められた
境界画素から、隣接する画素間の関係を示すベクトルの
配列を生威し、該ベクトルの配列を用いて図形の輪郭を
再現した場合、凹の直角部を鮮明に表現することができ
る。
For this reason, an array of vectors indicating the relationship between adjacent pixels is generated from the boundary pixels determined based on the invention of claim (1), and the outline of the figure is reproduced using the array of vectors. In this case, the right angle part of the concave can be clearly expressed.

請求項(2)記載の発明では、外側境界画素列と内側境
界画素列とで区別できるように、例えば第4図に示す図
形において外側境界画素列を反時計回り(第4図矢印C
方向)に辿り、内側境界画素列を時計回り(第4図矢印
り方向〉に辿って、隣接する画素間の関係を8つのベク
トルの配列によって表す。
In the invention described in claim (2), in order to distinguish between the outer boundary pixel column and the inner boundary pixel column, for example, in the figure shown in FIG. 4, the outer boundary pixel column is rotated counterclockwise (arrow C in FIG.
The inner boundary pixel row is traced clockwise (in the direction of the arrow in FIG. 4), and the relationship between adjacent pixels is represented by an array of eight vectors.

外側境界画素列に対しては、斜め方向ベクトルの前後に
左右方向ベクトルの一方及び上下方向ベクトルの一方が
存在しかつこれらの3つのベクトルの始点を共通にした
ときの方向が所定の鋭角ずつ外側境界画素を辿る方向と
逆方向に変化している部分の斜め方向ベクトルを、斜め
方向ベクトルの前後に存在するベクトルに分解して表す
For the outer boundary pixel column, one of the horizontal direction vector and one of the vertical direction vector exists before and after the diagonal direction vector, and the direction when the starting point of these three vectors is common is a predetermined acute angle outward. A diagonal vector of a portion changing in the opposite direction to the direction of tracing the boundary pixel is decomposed into vectors existing before and after the diagonal vector and represented.

外側境界画素を反時計回りに辿る場合に前記条件に該当
する斜め方向ベクトルは、前に下方向ベクトルが存在し
後に左方向ベクトルが存在する左斜め下方向ベクトルと
、前に左方向ベクトルが存在し後に上方向ベクトルが存
在する左斜め上方向ベクトルと、前に右方向ベクトルが
存在し後に下方向ベクトルが存在する右斜め下方向ベク
トルと、前に上方向ベクトルが存在し後に右方向ベクト
ルが存在する右斜め上方向ベクトルと、の4種類がある
。また、外側境界画素を時計回りに辿る場合に前記条件
に該当する斜め方向ベクトルは、前に右方向ベクトルが
存在し後に上方向ベクトルが存在する右斜め上方向ベク
トルと、前に下方向ベクトルが存在し後に右方向ベクト
ルが存在する右斜め下方向ベクトルと、前に上方向ベク
トルが存在し後に左方向ベクトルが存在する左斜め上方
向ベクトルと、前に左方向ベクトルが存在し後に下方向
ベクトルが存在する左斜め下方向ベクトルと、の4種類
がある。この各々4種類の斜め方向ベクトルを前後に存
在するベクトルに分解して表す。
When tracing an outer boundary pixel counterclockwise, the diagonal vectors that meet the above conditions are a left diagonal downward vector where a downward vector exists before and a leftward vector after, and a leftward diagonal vector where a leftward vector exists before. diagonally upward left vector with an upward vector after, diagonal downward right vector with a right vector before and a downward vector after, and diagonal downward right vector with an upward vector before and a right vector after. There are four types of vectors: a diagonally upward right direction vector; Furthermore, when tracing an outer boundary pixel clockwise, the diagonal vectors that meet the above conditions are diagonally upward right vectors where there is a right vector before and an upward vector after, and diagonal upward right vectors where there is a downward vector before. A diagonally downward right direction vector that exists and a rightward vector exists after, a diagonally upward left direction vector that exists before an upward vector and a leftward vector, and a downward direction vector that exists before a leftward vector. There are four types: a diagonally downward left direction vector in which Each of these four types of diagonal direction vectors is decomposed into vectors that exist before and after them and is expressed.

例として第4図矢印Aが指し示す部分に注目すると、第
5図(A>に示す斜め方向ベクトルV+の前に上方向ベ
クトルv2が存在し、斜め方向ベクトルV1の後に右方
向ベクトルV。が存在している。第5図(C)に示すよ
うに、これらの3つのベクトルV2 、V+ 、Voの
始点を共通にしたときの方向は、所定の鋭角θ(ここで
は45°)ずつ外側境界画素を辿る方向と逆方向(ここ
では時計回り)に変化している。この部分の斜め方向ベ
クトルV1を、第5図(B)に示すように、斜め方向ベ
クトルV、の前後に存在する上方向ベクトルV2と右方
向ベクトルv0とに分解して表す。
As an example, if we pay attention to the part pointed by arrow A in Figure 4, there is an upward vector v2 before the diagonal vector V+ shown in Figure 5 (A>), and a rightward vector V exists after the diagonal vector V1. As shown in Fig. 5(C), when these three vectors V2, V+, and Vo have a common starting point, their directions move toward the outer boundary pixel by a predetermined acute angle θ (here, 45°). The diagonal direction vector V1 of this part is changed in the opposite direction (clockwise in this case) to the direction of tracing the diagonal direction vector V, as shown in FIG. 5(B). It is divided into a vector V2 and a rightward vector v0.

また、内側境界画素列に対しては、斜め方向ベクトルの
前後に左右方向ベクトルの一方及び上下方向ベクトルの
一方が存在しかつこれらの3つのベクトルの始点を共通
にしたときの方向が所定の鋭角ずつ外側境界画素を辿る
方向と同方向に変化している部分の斜め方向ベクトルを
、斜め方向ベクトルの前後に存在するベクトルに分解し
て表す。
In addition, for the inner boundary pixel row, one of the horizontal direction vector and one of the vertical direction vector exists before and after the diagonal direction vector, and when the starting point of these three vectors is made common, the direction is a predetermined acute angle. The diagonal vector of the portion changing in the same direction as the direction of tracing the outer boundary pixel is divided into vectors existing before and after the diagonal vector and represented.

内側境界画素を時計回りに辿る場合に前記条件に該当す
る斜め方向ベクトルは、外側境界画素を反時計回りに辿
る場合の前記4種類の斜め方向ベクトルと同様である。
The diagonal vectors that meet the above conditions when the inner boundary pixels are traced clockwise are the same as the four types of diagonal vectors when the outer boundary pixels are traced counterclockwise.

また、内側境界画素を反時計回りに辿る場合に前記条件
に該当する斜め方向ベクトルは、外側境界画素を時計回
りに辿る場合の前記4種類の斜め方向ベクトルと同様で
ある。
Furthermore, the diagonal vectors that meet the above conditions when tracing the inner boundary pixel counterclockwise are the same as the four types of diagonal vectors described above when tracing the outer boundary pixel clockwise.

この各々4種類の斜め方向ベクトルを前後に存在するベ
クトルに分解して表す。
Each of these four types of diagonal direction vectors is decomposed into vectors that exist before and after them and is expressed.

例として、第4図矢印Bが指し示す部分に注目すると、
第6図(A)に示す斜め方向ベクトルV5の前に下方向
ベクトルV6が存在し、斜め方向ベクトルv5の後に左
方向ベクトルV4が存在する。第6図(C)に示すよう
に、これらの3つのベクトルV6 、Vs 、Vsの始
点を共通にしたときの方向は所定の鋭角θ(ここでは4
5°)ずつ内側境界画素を辿る方向と同方向くここでは
時計回り)に変化している。この部分の斜め方向ベクト
ルv5を、第6図(B)に示すように斜め方向ベクトル
V5の前後に存在する下方向ベクトルV6と左方向ベク
トルV4とに分解して表す。
For example, if we pay attention to the part indicated by arrow B in Figure 4,
A downward vector V6 exists before the diagonal vector V5 shown in FIG. 6(A), and a leftward vector V4 exists after the diagonal vector v5. As shown in FIG. 6(C), when these three vectors V6, Vs, and Vs have a common starting point, their directions are at a predetermined acute angle θ (here, 4
5°) in the same direction as the direction of tracing the inner boundary pixel (clockwise here). The diagonal vector v5 in this portion is divided into a downward vector V6 and a leftward vector V4, which exist before and after the diagonal vector V5, as shown in FIG. 6(B).

この拮果、図形の凹の直角部の隅の画素もベクトルの配
列に組み込まれ、該ベクトルの配列を用いて図形の輪郭
を再現した場合、凹の直角部を鮮明に表現することがで
きる。
This antagonist, the corner pixel of the concave right angle part of the figure, is also incorporated into the vector array, and when the contour of the figure is reproduced using the vector array, the concave right angle part can be clearly expressed.

請求項(3)記載の発明では、8つのベクトルをコード
で表し、隣接する画素間の関係をコード列から成るチェ
ーンコードで表している。チェーンコードにおいて8つ
のベクトルを表すコードは数字であり、チェーンコード
は数字列となる。このため、コンピュータ等のデジタル
データの処理を行う装置における取扱いが容易である。
In the invention described in claim (3), the eight vectors are represented by codes, and the relationship between adjacent pixels is represented by a chain code made up of code strings. The codes representing the eight vectors in the chain code are numbers, and the chain code is a string of numbers. Therefore, it is easy to handle in a device that processes digital data, such as a computer.

〔実施例〕〔Example〕

第1実施例 以下、本発明の請求項(1)の画像処理方法を利用して
、第7図に示す図形10にチェーンコードを付す処理を
第10図のフロー゛チャートを参照して説明する。なお
、第7図はハツチング部分(図形画素)の画素値=1、
白い部分(背景画素)の画素値−〇の2値画像とする。
First Embodiment Hereinafter, the process of attaching a chain code to the figure 10 shown in FIG. 7 using the image processing method of claim (1) of the present invention will be explained with reference to the flowchart of FIG. 10. . In addition, in Fig. 7, the pixel value of the hatched part (figure pixel) = 1,
It is assumed that the pixel value of the white part (background pixel) is −0, which is a binary image.

ステップ102では、境界画素の判定対象となる画素及
び判定対象画素の周囲に位置する8画素(以下、8近傍
の画素とする)を参照し、判定対象画素が境界画素か否
か判定する。境界画素か否かの判定は、判定対象画素の
画素値がlであり、かつ8近傍の画素のうち少なくとも
1個の画素の画素値が0である場合に判定対象画素を図
形10の境界画素であると判定する。すなわち、判定対
象画素をa、3近傍の画素をす、c、dSe、f。
In step 102, it is determined whether the pixel to be determined is a boundary pixel by referring to the pixel to be determined as a boundary pixel and eight pixels located around the pixel to be determined (hereinafter referred to as eight neighboring pixels). The determination as to whether or not the pixel is a boundary pixel is made when the pixel value of the pixel to be determined is l and the pixel value of at least one pixel among the eight neighboring pixels is 0. It is determined that That is, the pixel to be determined is a, and the three neighboring pixels are c, dSe, and f.

gShS lとし、論理演算jこおけるANDをXで表
すと、 aX   XCX  XeX  XgX  XI  =
1の論理式で表すことができる。
If gShS is l and AND in logical operation j is represented by X, then aX XCX XeX XgX XI =
It can be expressed by one logical formula.

ステップ102で判定対象画素が境界画素であると判定
された場合には、ステップ104でフレームメモリ等の
記憶手段に判定対象画素を境界画素として登録する。判
定対象画素が境界画素でないと判定された場合にはステ
ップ104を実行しない。ステップ106では境界画素
の抽出が終了したか否かを判定する。境界画素の抽出が
終了していない場合にはステップ100に戻り、ステッ
プ100乃至ステップ106を繰返す。ステップ106
で境界画素の抽出が終了したと判定された場合、ステッ
プ108へ移行する。
If the determination target pixel is determined to be a boundary pixel in step 102, the determination target pixel is registered as a boundary pixel in a storage means such as a frame memory in step 104. If it is determined that the determination target pixel is not a boundary pixel, step 104 is not executed. In step 106, it is determined whether the extraction of boundary pixels has been completed. If the extraction of boundary pixels has not been completed, the process returns to step 100 and steps 100 to 106 are repeated. Step 106
If it is determined that the extraction of boundary pixels has been completed, the process moves to step 108.

このときに、第8図においてハツチングで示されている
画素が境界画素として登録された画素である。また、濃
いハンチングで示されている画素12は、従来の境界画
素抽出方法では抽出されない画素である。このように、
図形10の外側の境界及び内側の境界において、従来、
抽出されなかった凹の直角部の隅の画素12が新たに抽
出されている。このため、登録された境界画素から従来
と同様のベクトル化方法によりベクトルデータを生成し
、生成したベクトルデータにより図形10を再現した場
合、再現された図形10は凹の直角部が鮮明に表現され
る。
At this time, pixels indicated by hatching in FIG. 8 are pixels registered as boundary pixels. Furthermore, the pixel 12 indicated by dark hunting is a pixel that cannot be extracted using the conventional boundary pixel extraction method. in this way,
Conventionally, at the outer boundary and inner boundary of the figure 10,
The pixel 12 at the corner of the right angle part of the concave that was not extracted is newly extracted. Therefore, when vector data is generated from the registered boundary pixels using a vectorization method similar to the conventional method, and the generated vector data is used to reproduce the figure 10, the right angle part of the concave in the reproduced figure 10 will not be clearly expressed. Ru.

以下、登録された境界画素からベクトルデータを生成す
る処理を簡単に説明する。
The process of generating vector data from registered boundary pixels will be briefly described below.

ステップ108では登録された境界画素に対して、境界
画素列毎に異なるラベリング番号を付す処理を行う。こ
れにより、図形10においては外側境界画素と内側境界
画素とで異なるラベリング番号が付され、区別される。
In step 108, the registered boundary pixels are assigned different labeling numbers for each boundary pixel column. As a result, in the figure 10, different labeling numbers are assigned to outer boundary pixels and inner boundary pixels to distinguish them.

ステップ110では、ラベリング番号が付された各境界
画素列毎の始点を定めて登録する。図形10においては
、外側境界画素の始点と内側境界画素の始点とが登録さ
れる。なお、ステップ110で各境界画素列の終点を登
録するようにしてもよい。
In step 110, a starting point for each boundary pixel column to which a labeling number has been assigned is determined and registered. In the graphic 10, the starting point of the outer boundary pixel and the starting point of the inner boundary pixel are registered. Note that the end point of each boundary pixel column may be registered in step 110.

ステップ112ではベクトルデータ(ここではチェーン
コード)を生成する。すなわち、同一のラベリング番号
が付された境界画素について、登録された始点から反時
計回りまたは時計回りに辿り、次に存在する境界画素が
どの方向に存在するかを示すベクトルを、第31図に示
す8つのベクトルに対応されたコードに変換し、前記コ
ードを境界画素に付していく。このコードを並べたベク
トルの配列がチェーンコードとされる。コードの生成に
ついては、処理対象画素、処理対象画素の8近傍の画素
、及び直前に付されたコードにより決定することができ
る。図形10にチェーンコードを付した結果、第9図に
示すように凹の直角部の隅の画素12にもチェーンコー
ドが付される。
In step 112, vector data (here, chain code) is generated. In other words, the boundary pixels with the same labeling number are traced counterclockwise or clockwise from the registered starting point, and a vector indicating the direction in which the next boundary pixel exists is shown in FIG. The code is converted into a code corresponding to the eight vectors shown, and the code is attached to the boundary pixel. A vector array of these codes is called a chain code. The generation of the code can be determined based on the pixel to be processed, eight pixels in the vicinity of the pixel to be processed, and the code attached immediately before. As a result of attaching the chain code to the figure 10, the chain code is also attached to the pixel 12 at the corner of the right angle part of the concave as shown in FIG.

以上説明したように、本第1実施例では判定対象画素の
画素値が図形10の画素値であり、かつ判定対象画素の
8近傍の画素のうち少なくとも1個の画素の画素値が背
景の画素値である場合に、判定対象画素を図形の境界画
素として登録するようにしたので、凹の直角部の隅の画
素12が境界画素として登録され、登録された境界画素
から従来のベクトル化方法によってベクトルデータを生
成し、生成したベクトルデータを用いて図形の輪郭を再
現した場合、図形の凹の直角部を鮮明に表現することが
できる。
As explained above, in the first embodiment, the pixel value of the determination target pixel is the pixel value of the figure 10, and the pixel value of at least one pixel among the eight neighboring pixels of the determination target pixel is the background pixel. Since the pixel to be determined is registered as a boundary pixel of the figure when the value is a value of When vector data is generated and the contour of a figure is reproduced using the generated vector data, the concave right angle part of the figure can be clearly expressed.

なお、本第1実施例の画像処理方法を用いて、第11図
に示すような1画素単位の階段状の境界の境界画素を抽
出した場合、濃いハツチングで示す画素が境界画素とし
て抽出される。ここで、画素14は従来の境界画素抽出
方法では抽出されず本第1実施例の画像処理方法で新た
に抽出される境界画素である。1画素単位の階段状の境
界は斜め方向の直線lであり、階段部分の直角部を鮮明
に表現する必要はなく、画素14を境界画素とする必要
はない。しかしながら、1画素単位の階段状の境界にお
いて抽出される境界画素数は画素14が境界画素として
抽出されることにより、従来と比較して約2倍になる。
Note that when the image processing method of the first embodiment is used to extract boundary pixels of a step-like boundary in units of one pixel as shown in FIG. 11, pixels indicated by dark hatching are extracted as boundary pixels. . Here, the pixel 14 is a boundary pixel that is not extracted by the conventional boundary pixel extraction method but is newly extracted by the image processing method of the first embodiment. The step-like boundary of each pixel is a straight line l in an oblique direction, and there is no need to clearly express the right angle part of the step portion, and there is no need to use the pixel 14 as a boundary pixel. However, since the pixel 14 is extracted as a boundary pixel, the number of boundary pixels extracted in a step-like boundary of one pixel is approximately twice that of the conventional method.

これは、チェーンコード生戊等の処理時に処理時間の増
加等の悪影響を及ぼす。このため、1画素単位の階段状
の境界が所定長さ以上連続した場合、画素14を境界画
素としないような例外処理、または後処理を行ってもよ
い。
This has an adverse effect such as an increase in processing time during processing such as chain code generation. For this reason, when the step-like boundary of one pixel unit continues for a predetermined length or more, an exception process or post-processing may be performed in which the pixel 14 is not set as a boundary pixel.

また、本第1実施例では抽出された図形の境界画素に対
して上下方向、左右方向及び斜め方向の8つのベクトル
を用いて隣接する画素間の関係を表していたが、線図形
以外の図形に対して本実施例の境界画素抽出方法を用い
て境界画素を抽出した場合、境界画素の隣接する画素間
の関係は上下方向及び左右方向の4方向に限定されるの
で、4つのベクトルのみを用いて隣接する画素間の関係
を表すことができる。このためベクトルに付すコードは
4種類用意すればよく、前記コードをチェーンコードと
した場合、1個のコードにおけるデータ量が2ビツトで
済み、従来のチェーンコードと比較してデータ量を半分
に圧縮することができる。
In addition, in the first embodiment, eight vectors in the vertical, horizontal, and diagonal directions are used to express the relationship between adjacent pixels for the boundary pixels of extracted figures. However, when boundary pixels are extracted using the boundary pixel extraction method of this embodiment, the relationship between adjacent pixels of a boundary pixel is limited to four directions, vertical and horizontal directions, so only four vectors are extracted. can be used to express the relationship between adjacent pixels. For this reason, it is only necessary to prepare four types of codes to be attached to vectors, and when the above code is used as a chain code, the amount of data in one code is only 2 bits, which reduces the amount of data to half compared to the conventional chain code. can do.

第2実施例 次に本発明の請求項(2)の画像処理方法の実施例につ
いて説明する。
Second Embodiment Next, an embodiment of the image processing method according to claim (2) of the present invention will be described.

第12図に示す図形20において従来の方法により境界
画素を抽出し、反時計回りに境界画素を辿ってチェーン
コードを付した結果を第13図に示す。図形20の外側
境界のチェーンコードはr6666666002210
0076600222222244665444322
44Jとなる。第13図から明らかなように、凹の直角
部の隅の画素16は従来の境界画素抽出方法では境界画
素として抽出されないため、チェーンコードは付されな
い。
FIG. 13 shows the result of extracting boundary pixels from the figure 20 shown in FIG. 12 by a conventional method, tracing the boundary pixels counterclockwise and attaching a chain code. The chain code for the outer boundary of shape 20 is r6666666002210
0076600222222244665444322
It becomes 44J. As is clear from FIG. 13, the pixel 16 at the corner of the right angle part of the concave is not extracted as a boundary pixel by the conventional boundary pixel extraction method, and therefore no chain code is attached to it.

以下、前記チェーンコードに基づいて凹の直角部の検出
、すなわち画素16の検出と、画素■6をベクトルデー
タに含める処理を行う。
Thereafter, based on the chain code, the detection of the right angle part of the concave, that is, the detection of pixel 16, and the process of including pixel 6 in the vector data are performed.

ここで走査線方向を左右方向、走査線方向と直交する方
向を上下方向、走査線方向に対して45°の角度で交わ
る方向を斜め方向とすると、問題となる凹の直角部を示
すパターンは、上下方向及び左右方向の直線よりなる第
14図(A〉、第15図(A)、第16図(A)、第1
7図(A)の4種類しか存在しない。なお斜め方向の直
線よりなる凹の直角部においては、第18図に示すよう
にその隅の画素18の4近傍の画素のいずれかが周囲の
画素であるため、境界画素として抽出される。
Here, if we assume that the scanning line direction is the horizontal direction, the direction perpendicular to the scanning line direction is the vertical direction, and the direction intersecting the scanning line direction at an angle of 45° is the diagonal direction, the pattern showing the right angle part of the concave in question is , Fig. 14 (A), Fig. 15 (A), Fig. 16 (A), Fig. 1
There are only four types shown in Figure 7 (A). Note that in a concave right-angled part formed by a straight line in an oblique direction, any of the four neighboring pixels of the corner pixel 18 is a surrounding pixel, as shown in FIG. 18, and therefore is extracted as a boundary pixel.

第14図(A)は左下に開く凹の直角部を示すものであ
り、チェーンコードは境界画素列のうち左右方向に配列
された部分において「・・・007」と進んで隅の画素
20に到り、その後上下方向に配列された部分に移って
「66・・・」と進んでいる。この図の直角を規定する
ベクトルは画素22に付される右方向ベクトルと、画素
24に付される右斜め下方向ベクトルと、画素26に付
される下方向ベクトルであり、これらのチェーンコード
はr076」となる。また、これら3つのベクトルの始
点を共通にしたときの方向は時計回りに変化している(
第31図参照)。チェーンコード列中にこのro 76
Jの組合せが生じたときは直ちに左下に開く凹の直角部
であることが判明する。ここでチェーンコードに変更を
加え、隅の画素20が含まれるようにする。第14図(
B)はチェーンコードに変更を加えた結果を示すもので
あり、画、124に付すチェーンコードを「7」から「
0」に変更し、さらに隅の画素20にチェーンコード「
6」を与えている。これはチェーンコードの組r076
Jをr0066」に変更する操作に対応する。
Figure 14 (A) shows a right-angled part of a concave that opens to the lower left, and the chain code progresses to "...007" in the horizontally arranged part of the boundary pixel row and reaches the corner pixel 20. After that, it moves to the vertically arranged part and progresses as "66...". The vectors that define right angles in this figure are the rightward vector attached to pixel 22, the diagonally downward rightward vector attached to pixel 24, and the downward direction vector attached to pixel 26, and these chain codes are r076". Also, when these three vectors have a common starting point, their directions change clockwise (
(See Figure 31). This ro 76 in chain code row
When the combination J occurs, it is immediately clear that it is a concave right-angled part that opens to the lower left. Now modify the chaincode to include the corner pixel 20. Figure 14 (
B) shows the result of changing the chain code, changing the chain code attached to 124 from "7" to "
0” and then add a chain code to pixel 20 in the corner.
6" is given. This is chain code set r076
This corresponds to the operation to change J to r0066.

このチェーンコードの変更により、境界画素のうち左右
方向に配列された部分の最後の画素24に付されたベク
トルが隅の画素20を指すベクトルに変更されたことに
なり、隅の画素20が上下方向に配列された部分の最初
の画素26を指すベクトルが付されたことになる。
By changing this chain code, the vector attached to the last pixel 24 in the horizontally arranged portion of the boundary pixels has been changed to a vector pointing to the corner pixel 20, and the corner pixel 20 is A vector pointing to the first pixel 26 of the portion arranged in the direction is attached.

第15図(A)は右下に開く凹の直角部を示すものであ
り、チェーンコードは境界画素列のうち上下方向に配列
された部分において「・・・221−」と進んで隅の画
素20に到り、その後左右方向に配列された部分に移っ
て「00・・・」と進んでいる。この図の直角を規定す
るベクトルは画素22に付される上方向ベクトルと、画
素24に付される右斜め上方向ベクトルと、画素26に
付される右方向ベクトルであり、これらのチェーンコー
ドは「210」となる。また、これら3つのベクトルの
始点を共通にしたときの方向は時計回りに変化している
(第31図参照)。チェーンコード列中にこのr210
」の組合せが生じたときは直ちに右下に開く凹の直角部
であることが判明する。ここでチェーンコードに変更を
加え、隅の画素20が含まれるようにする。第15図(
B)はチェーンコードに変更を加えた結果を示すもので
あり、画素24に付すチェーンコードを「l」から「2
」に変更し、さらに隅の画素20にチェーンコード「0
」を与えている。これはチェーンコードの組r210」
を’2200Jに変更する操作に対応する。
Figure 15 (A) shows a right-angled part of a concave that opens to the lower right, and the chain code progresses as "...221-" in the vertically arranged part of the boundary pixel row, and moves to the corner pixel. 20, and then moves to the portions arranged in the left and right direction and progresses as "00...". The vectors that define the right angles in this figure are the upward direction vector attached to pixel 22, the diagonally upward right direction vector attached to pixel 24, and the right direction vector attached to pixel 26, and these chain codes are It becomes "210". Furthermore, when these three vectors have a common starting point, their directions change clockwise (see FIG. 31). This r210 in the chain code row
'', it is immediately clear that it is a concave right-angled part that opens to the lower right. Now modify the chaincode to include the corner pixel 20. Figure 15 (
B) shows the result of changing the chain code, changing the chain code attached to pixel 24 from "l" to "2".
” and then add the chain code “0” to the corner pixel 20.
” is given. This is a set of chain cords R210.”
Corresponds to the operation of changing '2200J'.

このチェーンコードの変更により、境界画素のうち上下
方向に配列された部分の最後の画素24に付されたベク
トルが隅の画素20を指すベクトルに変更されたことに
なり、隅の画素20が左右方向に配列された部分の最初
の画素26を指すベクトルが付されたことになる。
By changing this chain code, the vector attached to the last pixel 24 of the vertically arranged part of the boundary pixels is changed to a vector pointing to the corner pixel 20, and the corner pixel 20 is A vector pointing to the first pixel 26 of the portion arranged in the direction is attached.

第16図(A)は左上に開く凹の直角部を示すものであ
り、チェーンコードは境界画素列のうち上下方向に配列
された部分において「・・・665」と進んで隅の画素
20に到り、その後左右方向に配列された部分に移って
「44・・・」と進んでいる。この図の直角を規定する
ベクトルは画素22に付される下方向ベクトルと、画素
24に付される左斜め下方向ベクトルと、画素26に付
される左方向ベクトルであり、これらのチェーンコード
はr654」となる。また、これら3つのベクトルの始
点を共通にしたときの方向は時計回りに変化している(
第31図参照〉。チェーンコード列中にこのr654」
の組合せが生じたときは直ちに左上に開く凹の直角部で
あることが判明する。ここでチェーンコードに変更を加
え、隅の画素20が含まれるようにする。第16図(B
)はチェーンコードに変更を加えた結果を示すものであ
り、画素24に付すチェーンコードを「5」から「6」
に変更し、さらに隅の画素20にチェーンコード「4」
を与えている。これはチェーンコードの組r654Jを
r6644Jに変更する操作に対応する。
Figure 16 (A) shows the right angle part of the concave that opens to the upper left, and the chain code progresses as "...665" in the vertically arranged part of the boundary pixel row and reaches the corner pixel 20. After that, it moves to the part arranged in the left and right direction and progresses as "44...". The vectors that define the right angles in this figure are the downward direction vector attached to pixel 22, the diagonally downward left direction vector attached to pixel 24, and the left direction vector attached to pixel 26, and these chain codes are r654". Also, when these three vectors have a common starting point, their directions change clockwise (
See Figure 31>. This r654 in the chain code string
When the combination occurs, it is immediately clear that it is a right-angled part of a concave that opens to the upper left. Now modify the chaincode to include the corner pixel 20. Figure 16 (B
) indicates the result of changing the chain code, changing the chain code attached to pixel 24 from "5" to "6".
and add chain code "4" to pixel 20 in the corner.
is giving. This corresponds to the operation of changing chain code set r654J to r6644J.

このチェーンコードの変更により、境界画素のうち上下
方向に配列された部分の最後の画素24に付されたベク
トルが隅の画素20を指すベクトルに変更されたことに
なり、隅の画素20が左右方向に配列された部分の最初
の画素26を指すベクトルが付されたことになる。
By changing this chain code, the vector attached to the last pixel 24 of the vertically arranged part of the boundary pixels is changed to a vector pointing to the corner pixel 20, and the corner pixel 20 is A vector pointing to the first pixel 26 of the portion arranged in the direction is attached.

第17図(A)は右上に開く凹の直角部を示すものであ
り、チェーンコードは境界画素列のうち左右方向に配列
された部分において「・・・443」と進んで隅の画s
20に到り、その後上下方向に配列された部分に移って
「22・・・」と進んでいる。この図の直角を規定する
ベクトルは画素22に付される左方向ベクトルと、画素
24に付される左斜め上方向ベクトルと、画素26に付
される上方向ベクトルであり、これらのチェーンコード
はr432Jとなる。また、これら3つのベクトルの始
点を共通にしたときの方向は時計回りに変化している(
第31図参照)。チェーンコード列中にこのr432J
の組合せが生じたときは直ちに右上に開く凹の直角部で
あることが判明する。ここでチェーンコードに変更を加
え、隅の画素20が含まれるようにする。第17図(B
)はチェーンコードに変更を加えた結果を示すものであ
り、画素24に付すチェーンコードを「3」から「4」
に変更し、さらに隅の画素20にチェーンコード「2」
を与えている。これはチェーンコードの組r432Jを
「4422Jに変更する操作に対応する。
FIG. 17(A) shows a right-angled part of a concave opening to the upper right, and the chain code progresses to "...443" in the part arranged in the left-right direction among the boundary pixel rows, and then returns to the corner pixel s.
20, and then moves to the vertically arranged portions and progresses as "22...". The vectors that define the right angles in this figure are the left direction vector attached to pixel 22, the diagonally upward left direction vector attached to pixel 24, and the upward direction vector attached to pixel 26, and these chain codes are It becomes r432J. Also, when these three vectors have a common starting point, their directions change clockwise (
(See Figure 31). This r432J in the chain code row
When the combination occurs, it is immediately clear that it is a right-angled part of the concave that opens to the upper right. Now modify the chaincode to include the corner pixel 20. Figure 17 (B
) indicates the result of changing the chain code, changing the chain code attached to pixel 24 from "3" to "4".
and add chain code "2" to corner pixel 20.
is giving. This corresponds to the operation of changing chain code set r432J to "4422J."

このチェーンコードの変更により、境界画素のうち左右
方向に配列された部分の最後の画素24に付されたベク
トルが隅の画素20を指すベクトルに変更されたことに
なり、隅の画素20に上下方向に配列された部分の最初
の画素26を指すべクトルが付されたことになる。
By changing this chain code, the vector attached to the last pixel 24 of the portion arranged in the horizontal direction among the boundary pixels has been changed to a vector pointing to the corner pixel 20. A vector pointing to the first pixel 26 of the portion arranged in the direction is attached.

第13図に示す図形20に対して、以上のような処理を
施した結果を第19図に示す。図形20の外側境界のチ
ェーンコードはr66666660022200000
6660022222224466644444222
44Jとなる。第19図から明らかなように、図形20
の凹の直角部の隅の画素16がチェーンコードに含まれ
ており、凹の直角部が鮮明に表現される。
FIG. 19 shows the result of performing the above processing on the graphic 20 shown in FIG. 13. The chain code for the outer boundary of shape 20 is r66666660022200000
6660022222224466644444222
It becomes 44J. As is clear from Figure 19, figure 20
Pixels 16 at the corners of the right-angled portion of the concave are included in the chain code, and the right-angled portion of the concave is clearly expressed.

以上は図形の外側の境界画素を反時計回りに辿って付さ
れたチェーンコードに対しての処理であったが、内側の
境界画素すなわち穴に対しての処理においても時計回り
に辿ってチェーンコードを付せば同様に処理できる。
The above process was for the chain code attached by tracing the outer boundary pixels of the figure counterclockwise, but when processing the inner boundary pixels, that is, the hole, the chain code is also attached by tracing the outer boundary pixels of the figure in a clockwise direction. You can process it in the same way by adding .

第20図(A)は内側の境界画素にチェーンコードを付
した状態を示し、そのチェーンコードはr000766
6544432221」となっている。ここで、チェー
ンコード列の最後がチェーンコード列の先頭に続いてい
ると考えると、凹の直角部のチェーンコード列は、外側
境界画素の場合と同様に、ro 76J、r654J、
「321」、r210」となる。これに外側境界画素と
同様に処理を施せば、チェーンコードは各々「0066
」、r6644J、r4422J、「2200」となる
(第20図(B)参照)。すなわち斜め方向ベクトルを
表す「7」、「5」、「3」、「1」が前後に存在する
上下方向ベクトル及び左右方向ベクトルに分解され、直
角部の隅の画素28に画素28の前に存在する画素のコ
ード「0」、「6」、「4」、「2」が付されると共に
、画素28に後ろの画素30に画素30の後ろに存在す
る画素のコード「6」、「4」、「2」、「0」が付さ
れる。これにより、内側境界画素すなわち穴に対しても
凹の直角部を鮮明に表現することができる。
Figure 20 (A) shows a state in which a chain code is attached to the inner boundary pixel, and the chain code is r000766.
6544432221”. Here, if we consider that the end of the chain code string follows the beginning of the chain code string, the chain code string at the right angle of the concave will be ro 76J, r654J,
"321", r210". If these are processed in the same way as the outer boundary pixels, the chain code will be "0066".
”, r6644J, r4422J, and “2200” (see FIG. 20(B)). That is, the diagonal direction vectors "7", "5", "3", and "1" are decomposed into vertical and horizontal vectors that exist before and after, and the pixel 28 at the corner of the right angle section is Codes "0", "6", "4", and "2" are assigned to the existing pixels, and codes "6" and "4" are assigned to the pixels 30 that are behind the pixel 28. ”, “2”, and “0” are added. Thereby, it is possible to clearly express the right angle part of the concave even with respect to the inner boundary pixel, that is, the hole.

以上に外側境界画素列を反時計回りに辿り、内側境界画
素列を時計回りに辿ってチェーンコードを付した例を示
したが、逆に、外側境界画素列を時計回りに辿ってチェ
ーンコードを付すことも可能である。この場合、内側境
界画素列を反時計回りに辿ってチェーンコードを付せば
、外側境界画素列と内側境界画素列との凹の直角部に付
されるチェーンコードが同一になり、同様に処理できる
Above, we have shown an example in which the outer boundary pixel row is traced counterclockwise and the inner boundary pixel row is traced clockwise to attach a chain code. Conversely, the outer boundary pixel row is traced clockwise and a chain code is attached. It is also possible to attach In this case, if a chain code is attached by tracing the inner boundary pixel column counterclockwise, the chain code attached to the concave right angle part of the outer boundary pixel column and the inner boundary pixel column will be the same, and the same process will be performed. can.

第22図(A)は前記第14図と同様の図形に時計回り
のチェーンコードを付したものであり、直角を規定する
チェーンコードの組はr234Jである。これを第22
図(B)のように、「2244」と変化させることによ
り、鮮明な直角部を得ることができる。
FIG. 22(A) is a diagram similar to that shown in FIG. 14 with clockwise chain cords attached, and the set of chain cords defining the right angle is r234J. This is the 22nd
As shown in Figure (B), by changing it to "2244", a sharp right-angled portion can be obtained.

第23図(A)は前記第15図と同様の図形に時計回り
のチェーンコードを付したものであり、直角を規定する
チェーンコードの組はr456Jである。これを第23
図(B)のように、「4466」と変化させることによ
り、鮮明な直角部を得ることができる。
FIG. 23(A) is a diagram similar to that of FIG. 15 with clockwise chain cords attached, and the set of chain cords defining the right angle is r456J. This is the 23rd
As shown in Figure (B), by changing it to "4466", a clear right angle part can be obtained.

第24図(A)は前記第16図と同様の図形に時計回り
のチェーンコードを付したものであり、直角を規定する
チェーンコードの組は「012」である。これを第24
図(B)のように、「0022」と変化させることによ
り、鮮明な直角部を得ることができる。
FIG. 24(A) is a diagram similar to that shown in FIG. 16 with a clockwise chain code added thereto, and the chain code set defining the right angle is "012". This is the 24th
As shown in Figure (B), by changing it to "0022", a clear right angle part can be obtained.

第25図(A)は前記第17図と同様の図形に時計回り
のチェーンコードを付したものであり、直角を規定する
チェーンコードの組はr670Jである。これを第24
図(B)のように、「6600」と変化させることによ
り、鮮明な直角部を得ることができる。
FIG. 25(A) is a diagram similar to that of FIG. 17 with clockwise chain cords attached, and the set of chain cords defining the right angle is r670J. This is the 24th
As shown in Figure (B), by changing the value to "6600", a clear right-angled portion can be obtained.

第26図は内側境界画素すなわち穴に対して反時計回り
にチェーンコードを付した場合の処理を示すものである
。第26図(A)に示すように、このチェーンコードは
r5666700012223444Jとなる。チェー
ンコード列の最後がチェーンコード列の先頭に続いてい
ると考えると、第22図乃至第25図に示したものと同
様に、凹の直角部のチェーンコードはr234J、「4
56」、「012」、「670」となり、これを第26
図(B)に示すようにr2244J、「4466」、r
o 022J、r6600Jと変更することにより凹の
直角部が鮮明に表現される。
FIG. 26 shows processing when a chain code is attached counterclockwise to an inner boundary pixel, that is, a hole. As shown in FIG. 26(A), this chain code is r5666700012223444J. Considering that the end of the chain cord string follows the beginning of the chain cord string, the chain cord at the concave right corner is r234J, "4", similar to that shown in FIGS.
56'', ``012'', and ``670'', and this becomes the 26th
As shown in figure (B), r2244J, "4466", r
o By changing to 022J and r6600J, the right angle part of the concave can be clearly expressed.

このように、本第2実施例では、チェーンコードからな
るベクトルの配列において連続する3つのコード列が凹
の直角部を示すコード列であった場合に、斜め方向ベク
トルを示すコードを前後に存在するコードに分解して表
現するようにしたので、本第2実施例に示す画像処理方
法により処理されたチェーンコードからなるベクトルの
配列によって図形の輪郭を再現した場合、凹の直角部を
鮮明に表現することができる。
In this way, in the second embodiment, when three consecutive code strings in the vector array consisting of chain codes are code strings indicating a concave right angle part, codes indicating diagonal vectors are present before and after the chain code. Since the image processing method shown in the second embodiment is used to decompose the contour of a figure into a vector array consisting of chain codes processed by the image processing method shown in the second embodiment, the right angle part of the concave part can be clearly seen. can be expressed.

なお、本第2実施例においては処理対象となるベクトル
の配列としてチェーンコードを用いて説明してきたが、
チェーンコード以外のベクトルの配列に対しても適用可
能である。例として8方向のベクトルに第27図に示す
ようなコードを付し、これを基準として第12図に示す
図形20にコードを付した場合、第28図に示すように
ベクトルの配列を表すコード列rCCCCCCCDDA
AHDDDGCCDDAAAAAAABBCCFBBB
EAABBJが生成される。このコード列のうち斜め方
向ベクトルを示すコードH,G、F、Eの前後には上下
方向ベクトルを示すコードA1C及び左右方向を示すコ
ードB、Dの一方が存在している。また、これら斜め方
向ベクトルを示すコードを挟んで連続する3つのコード
が示す3つのベクトルは、3つのベクトルの始点を共通
にしたときの方向が時計回りに変化している(第27図
参照)。これにより凹の直角部であることが判明し、コ
ードH,G、PSEを前後に存在するコードに分解して
表現する。この結果、第29図に示すように図形20の
凹の直角部が鮮明に表現される。
Although the second embodiment has been described using a chain code as an array of vectors to be processed,
It can also be applied to arrays of vectors other than chaincodes. As an example, if a code as shown in FIG. 27 is attached to a vector in eight directions, and a code is attached to the figure 20 shown in FIG. 12 using this as a reference, a code representing the vector arrangement as shown in FIG. Column rCCCCCCCDDA
AHDDDGCCDDAAAAAAAAAABBCCFBBB
EAABBJ is generated. In this code string, before and after the codes H, G, F, and E indicating the diagonal direction vector, there is one of the code A1C indicating the vertical direction vector and the codes B and D indicating the left and right direction. In addition, the three vectors indicated by the three consecutive codes sandwiching the code indicating the diagonal direction vector change their directions clockwise when the starting point of the three vectors is common (see Figure 27). . This reveals that it is a right-angled part of a concave, and the codes H, G, and PSE are broken down and expressed into codes that exist before and after them. As a result, the concave right angle portion of the figure 20 is clearly expressed as shown in FIG.

また、本第2実施例においては連続する「3@素」に付
されたベクトルのコードを用いて凹の直角部を判断して
いたが、比較的細かい直角部の連続、例として第21図
に示すような2画素単位の階段状の境界を直角の連続と
して表現せず、むしろ直線lとして表現した方が好まし
いときもある。
In addition, in the second embodiment, the right angle part of the concave was determined using the vector code attached to consecutive "3@element", but the right angle part of the concave is determined by using the vector code attached to the consecutive "3@element". In some cases, it is preferable to express the stepped boundary of two pixels as shown in the figure not as a series of right angles, but rather as a straight line l.

この場合には前述の判断対象となる3画素に対し、その
前または後の少なくとも一方に一定以上の長さの直線が
連続していたときにのみ前述の判断を行うこととしても
よい。−例を挙げると、「076」の判断にかえて、r
o07666」のように直角部の一辺が3画素以上の長
さのときにのみ直角部と判断し、I”0006666J
に変換するようにしてもよい。
In this case, the above-mentioned judgment may be made only when a straight line of a certain length or more is continuous in at least one of the front and back of the three pixels to be judged. -For example, instead of determining "076", r
o07666", when one side of the right-angled part is 3 pixels or more long, it is determined to be a right-angled part.
You may also convert it to .

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

請求項(1)記載の画像処理方法では、特定画素の近傍
に存在する8画素の少なくとも1個の画素が背景の画素
である場合に特定画素を境界画素として抽出するように
したので、凹の直角部を鮮明に表現することができる、
という優れた効果を有する 請求項(2)記載の画像処理方法では、 ベクトルの配
列において凹の直角を規定するベクトルの組合せが存在
したときに、このベクトルの組合せにおける斜め方向ベ
クトルを、斜め方向ベクトルの前後に存在するベクトル
に分解して表すようにしたので、凹の直角部を鮮明に表
現することができる、という優れた効果を有する。
In the image processing method according to claim (1), the specific pixel is extracted as a boundary pixel when at least one of the eight pixels existing in the vicinity of the specific pixel is a background pixel. Right angles can be clearly expressed,
In the image processing method according to claim (2), which has the excellent effect of Since it is decomposed into vectors existing before and after , it has the excellent effect of being able to clearly express the right angle part of the concave.

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

第1図は本発明の画像処理方法に係る8近傍及び8つの
ベクトルの概念を示す概念図、第2図及び第3図は請求
項(1)の発明により新たに抽出される境界画素を示す
概念図、第4図乃至第6図は請求項(2)の発明の詳細
な説明するための概念図、第7図乃至第9図は本発明の
第1実施例を説明する図形を示す概念図、第10図は第
1実施例の作用を説明するフローチャート、第11図は
第1実施例の例外処理を説明する概念図、第12図及び
第13図は第2実施例を説明する図形を示す概念図、第
14図乃至第18図は外側境界画素列を反時計回りに辿
った場合の凹の直角部を示す概念図、第19図は第2実
施例の処理結果を示す概念図、第20図は内側境界画素
列を時計回りに辿った場合の凹の直角部を示す概念図、
第21図は第2実施例における例外処理を説明する概念
図、第22図乃至第25図は外側境界画素列を時計回り
に辿った場合の凹の直角部を示す概念図、第26図は内
側境界画素列を反時計回りに辿った場合の凹の直角部を
示す概念図、第27図は8つのベクトルに付す他のコー
ドの例を示す概念図、第28図及び第29図は第27図
に示すコードを使用した処理を説明する概念図、第30
図は所謂4近傍の概念を説明する概念図、第31図はチ
ェーンコードを生成する場合に8つのベクトルに付すコ
ードを示す概念図、第32図乃至第34図は従来の境界
画素抽出方法及びベクトル化方法を説明するための図形
を示す概念図である。 10・・・図形、 12・・・凹の直角の隅の画素、 16・・・凹の直角の隅の画素、 20・・・図形。
FIG. 1 is a conceptual diagram showing the concept of eight neighborhoods and eight vectors according to the image processing method of the present invention, and FIGS. 2 and 3 show boundary pixels newly extracted according to the invention of claim (1). Conceptual diagrams, FIGS. 4 to 6 are conceptual diagrams for explaining the invention of claim (2) in detail, and FIGS. 7 to 9 are conceptual diagrams showing figures for explaining the first embodiment of the present invention. 10 is a flowchart explaining the operation of the first embodiment, FIG. 11 is a conceptual diagram explaining exception handling in the first embodiment, and FIGS. 12 and 13 are diagrams explaining the second embodiment. 14 to 18 are conceptual diagrams showing the concave right angle part when tracing the outer boundary pixel row counterclockwise. FIG. 19 is a conceptual diagram showing the processing results of the second embodiment. , FIG. 20 is a conceptual diagram showing the right angle part of the concave when the inner boundary pixel row is traced clockwise,
FIG. 21 is a conceptual diagram explaining exception handling in the second embodiment, FIGS. 22 to 25 are conceptual diagrams showing the concave right angle part when the outer boundary pixel row is traced clockwise, and FIG. A conceptual diagram showing the right angle part of the concave when tracing the inner boundary pixel column counterclockwise, FIG. 27 is a conceptual diagram showing examples of other codes attached to eight vectors, and FIGS. 28 and 29 are Conceptual diagram explaining the processing using the code shown in Figure 27, No. 30
The figure is a conceptual diagram explaining the so-called 4-neighborhood concept, Figure 31 is a conceptual diagram showing the codes assigned to eight vectors when generating a chain code, and Figures 32 to 34 are the conventional boundary pixel extraction method and FIG. 2 is a conceptual diagram showing figures for explaining a vectorization method. 10... Figure, 12... Pixel at the right angle corner of the concave, 16... Pixel at the right angle corner of the concave, 20... Figure.

Claims (3)

【特許請求の範囲】[Claims] (1)特定画素を図形の画素とし、該特定画素の近傍に
存在する8画素の少なくとも1個の画素が背景の画素で
ある場合に前記特定画素を前記図形の境界画素とする処
理を、前記特定の画素と前記特定の画素の近傍に存在す
る8画素とからなる9画素づつ一定の順序で行って外側
境界画素列と内側境界画素列とを求め、外側境界画素列
と内側境界画素列とで区別できるように図形の外側境界
画素列と内側境界画素列とを辿り、特定画素の近傍に存
在する8画素の特定画素を基準とする方向を特定画素を
始点として表す上下方向ベクトル、左右方向ベクトル及
び斜め方向ベクトルの8つのベクトルの配列によって、
隣接する画素間の関係を表し、画像処理する画像処理方
(1) A specific pixel is defined as a pixel of a figure, and when at least one of the eight pixels existing in the vicinity of the specific pixel is a background pixel, the process of making the specific pixel a boundary pixel of the figure is performed as described above. An outer boundary pixel column and an inner boundary pixel column are obtained by performing nine pixels each consisting of a specific pixel and eight pixels existing in the vicinity of the specific pixel in a fixed order, and determining the outer boundary pixel column and the inner boundary pixel column. The outer boundary pixel row and the inner boundary pixel row of the figure are traced so that they can be distinguished from each other, and the vertical and horizontal vectors, which represent the direction based on the 8 specific pixels existing in the vicinity of the specific pixel, with the specific pixel as the starting point, and the horizontal direction By arraying eight vectors, vectors and diagonal vectors,
An image processing method that represents the relationship between adjacent pixels and processes the image.
(2)外側境界画素列と内側境界画素列とで区別できる
ように図形の外側境界画素列と内側境界画素列とを辿り
、特定画素の近傍に存在する8画素の特定画素を基準と
する方向を特定画素を始点として表す上下方向ベクトル
、左右方向ベクトル及び斜め方向ベクトルの8つのベク
トルの配列によって、隣接する画素間の関係を表し、画
像処理する画像処理方法において、 外側境界画素列に対しては、斜め方向ベクトルの前後に
左右方向ベクトルの一方及び上下方向ベクトルの一方が
存在しかつこれらの3つのベクトルの始点を共通にした
ときの方向が所定の鋭角ずつ外側境界画素を辿る方向と
逆方向に変化している部分の斜め方向ベクトルを、斜め
方向ベクトルの前後に存在するベクトルに分解して表し
、内側境界画素列に対しては、斜め方向ベクトルの前後
に左右方向ベクトルの一方及び上下方向ベクトルの一方
が存在しかつこれらの3つのベクトルの始点を共通にし
たときの方向が所定の鋭角ずつ外側境界画素を辿る方向
と同方向に変化している部分の斜め方向ベクトルを、斜
め方向ベクトルの前後に存在するベクトルに分解して表
すようにしたことを特徴とする画像処理方法。
(2) Tracing the outer boundary pixel row and inner boundary pixel row of the figure so that they can be distinguished from each other, and in a direction based on eight specific pixels existing in the vicinity of the specific pixel. In an image processing method in which the relationship between adjacent pixels is expressed and image processed by an array of eight vectors: a vertical vector, a horizontal vector, and a diagonal vector, which represent a specific pixel as a starting point, is the direction in which one of the horizontal direction vector and one of the vertical direction vector exists before and after the diagonal direction vector, and when these three vectors have a common starting point, the direction is opposite to the direction of tracing the outer boundary pixels by a predetermined acute angle. The diagonal vector of the part where the direction changes is broken down into vectors that exist before and after the diagonal vector. The diagonal direction vector of the part where one of the direction vectors exists and the direction changes in the same direction as the direction tracing the outer boundary pixel by a predetermined acute angle when the starting point of these three vectors is made common is defined as the diagonal direction. An image processing method characterized by decomposing and representing a vector into vectors that exist before and after a vector.
(3)前記8つのベクトルをコードで表し、前記隣接す
る画素間の関係をコード列から成るチェーンコードで表
したことを特徴とする請求項(1)または請求項(2)
記載の画像処理方法。
(3) Claim (1) or (2) characterized in that the eight vectors are represented by codes, and the relationship between the adjacent pixels is represented by a chain code consisting of a code string.
Image processing method described.
JP1317286A 1989-12-06 1989-12-06 Image processing method Expired - Fee Related JP2967107B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1317286A JP2967107B2 (en) 1989-12-06 1989-12-06 Image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1317286A JP2967107B2 (en) 1989-12-06 1989-12-06 Image processing method

Publications (2)

Publication Number Publication Date
JPH03177982A true JPH03177982A (en) 1991-08-01
JP2967107B2 JP2967107B2 (en) 1999-10-25

Family

ID=18086539

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1317286A Expired - Fee Related JP2967107B2 (en) 1989-12-06 1989-12-06 Image processing method

Country Status (1)

Country Link
JP (1) JP2967107B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6002873A (en) * 1997-07-23 1999-12-14 International Business Machines Corporation Compiler-assisted or interpreter-assisted windowing solution to the year 2000 problem for computer programs
US6064817A (en) * 1997-07-23 2000-05-16 International Business Machines Corporation Compiler-assisted or interpreter-assisted solution to the year 2000 problem for computer programs
US6185571B1 (en) 1997-07-23 2001-02-06 International Business Machines Corporation Compiler-assisted or interpreter-assisted solution to the year 2000 problem with flagging option for computer programs
US6226791B1 (en) 1997-07-23 2001-05-01 International Business Machines Corporation Compiler-assisted or interpreter-assisted compression solution to the year 2000 problem for computer programs
US6233728B1 (en) 1997-07-23 2001-05-15 International Business Machines Corporation Compiler-assisted or interpreter-assisted solution to the year 2000 problem with debugging option for computer programs
JP2019053669A (en) * 2017-09-19 2019-04-04 株式会社パスコ Graphic compression encoding method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6002873A (en) * 1997-07-23 1999-12-14 International Business Machines Corporation Compiler-assisted or interpreter-assisted windowing solution to the year 2000 problem for computer programs
US6064817A (en) * 1997-07-23 2000-05-16 International Business Machines Corporation Compiler-assisted or interpreter-assisted solution to the year 2000 problem for computer programs
US6078734A (en) * 1997-07-23 2000-06-20 International Business Machines Corporation Compiler-assisted solution to the year 2000 problem for computer programs
US6185571B1 (en) 1997-07-23 2001-02-06 International Business Machines Corporation Compiler-assisted or interpreter-assisted solution to the year 2000 problem with flagging option for computer programs
US6226791B1 (en) 1997-07-23 2001-05-01 International Business Machines Corporation Compiler-assisted or interpreter-assisted compression solution to the year 2000 problem for computer programs
US6233728B1 (en) 1997-07-23 2001-05-15 International Business Machines Corporation Compiler-assisted or interpreter-assisted solution to the year 2000 problem with debugging option for computer programs
JP2019053669A (en) * 2017-09-19 2019-04-04 株式会社パスコ Graphic compression encoding method

Also Published As

Publication number Publication date
JP2967107B2 (en) 1999-10-25

Similar Documents

Publication Publication Date Title
US5619592A (en) Detection of highlighted regions
US5048109A (en) Detection of highlighted regions
US4566128A (en) Method for data compression for two-value picture image
JP2974061B2 (en) Pattern extraction device
US5878161A (en) Image processing using vector data to reduce noise
US5222158A (en) Pattern recognition apparatus
JPH0315793B2 (en)
JPH03177982A (en) Image processing method
JPH0130180B2 (en)
JP3149221B2 (en) Image processing device
JP3172498B2 (en) Image recognition feature value extraction method and apparatus, storage medium for storing image analysis program
CN112419208A (en) Construction drawing review-based vector drawing compiling method and system
Miyatake et al. Contour representation of binary images using run-type direction codes
JP2930599B2 (en) Graphic vectorization processing method and apparatus
JPH04255080A (en) Image input device
JPH0535872A (en) Contour tracing system for binary image
JP2688671B2 (en) Image processing method
JP2522511B2 (en) Image contour tracking unit
JP2688666B2 (en) How to vectorize shapes
JPH0658689B2 (en) Line figure separation device
JP2987877B2 (en) Character recognition method
CN116579957A (en) Image processing method, terminal device and computer storage medium
JPH09147125A (en) Method and device for outline extraction
JPH0554139A (en) Contour tracking system for binary image
JPS6346473B2 (en)

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070820

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090820

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees