JPH0148587B2 - - Google Patents
Info
- Publication number
- JPH0148587B2 JPH0148587B2 JP58182589A JP18258983A JPH0148587B2 JP H0148587 B2 JPH0148587 B2 JP H0148587B2 JP 58182589 A JP58182589 A JP 58182589A JP 18258983 A JP18258983 A JP 18258983A JP H0148587 B2 JPH0148587 B2 JP H0148587B2
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- code
- containment
- contour
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired
Links
Landscapes
- Image Analysis (AREA)
Description
〔発明の属する技術分野〕
画像情報処理回路に関する。特に、パターン認
識のための手段の一つの手段として適する二値画
像の対象物の輪郭形状情報を一次元情報に圧縮す
る回路に関する。
〔従来技術の説明〕
画像計測において重要な対象物の輪郭形状の計
測には第1図に示す輪郭追跡法が多用される。こ
の方法は2値画像の対象物12の輪郭を時計回り
13、または反時計回りに追跡して対象物の輪郭
を一周し、第2図に示すような8方向のチエイ
ン・コードまたは上下左右の4方向のコードを用
いて、追跡方向を逐次同定し、対象物の輪郭に関
する二次元情報を一次元情報に圧縮している。こ
の輪郭追跡を高速に行うためにはハードウエアに
依存する方法もあるが、回路が複雑になりそのよ
うな従来回路例は少い。また、CPUなどを用い
て輪郭追跡法に伴う方向判断を行うと、リアルタ
イム処理が難しく高速処理に適しない欠点があつ
た。
〔発明の目的〕
本発明は、従来の輪郭追跡法に代る方法を用い
て輪郭形状の計測を行い、前述の画像高速処理に
伴う輪郭追跡法の欠点を除去する回路を提供する
ことを目的とする。
〔発明の要点〕
本発明は、輪郭追跡法によるチエイン・コード
の直接生成に代り、まずラスター・スキヤンによ
りコンテイメント・コードを発生し、このコード
を加工して2値画像の輪郭形状に対応するチエイ
ン・コードを生成するもので、
水平同期および垂直同期にしたがつて平面走査
された2値画像が入力する入力端子と、この端子
の信号が表わす各画素に画像領域毎番号付けを行
う回路と、上記入力端子に入力する信号が表わす
画面の隣接する4個の画素についてコンテイメン
ト・コードを発生する回路と、各画素毎に上記画
像領域の番号およびその画素の上記コンテイメン
ト・コードを一組として記憶する記憶回路と、こ
の記憶回路に接続されこの記憶回路の記憶内容の
アドレス並べ換えを行うプロセツサを備え、
このプロセツサは、上記記憶回路の記憶内容の
読出し順序が上記画像領域の輪郭を一周するチエ
イン・コードと同等になるようにアドレス並べ換
えを行う手段を含むことを特徴とする。
〔実施例による説明〕
本発明を図面に基づいて説明する。
第3図は実施例回路の構成を示すブロツク構成
図である。
まず、第3図に基づき本実施例回路の構成を説
明する。この回路は、計測対象である二値画像を
ラスター・スキヤンを行つて得られる「1」およ
び「0」の二値信号を入力する画像信号入力端子
30と、コンテイメント・コード発生回路31
と、コントロール・ロジツク回路32と、領域番
号付け回路33と、チエイン・コード発生回路3
4と、タイミング発生回路35とを備え、さら
に、コンテイメント・コード発生回路31は1水
平走査周期の遅延を与えるワンライン・メモリ3
11および2×2マスク回路312とを備え、ま
た、チエイン・コード発生回路34は番号バツフ
ア回路341、番号セレクタ回路342、デー
タ・メモリ343、並べ換えプロセツサ344
と、コンテイメント・コード・カウンタ345と
を備えている。
次に、第3図に基づき本実施例回路の接続を説
明する。端子30は図示されていない画像信号源
に接続されていて、この画像信号をコンテイメン
ト・コード発生回路31に入力するように接続さ
れる。コンテイメント・コード発生回路31の出
力はコントロール・ロジツク回路32の入力に接
続される。コントロール・ロジツク回路32のコ
ンテイメント・コード出力は領域番号付け回路3
3に入力に接続され、また、コントロール・ロジ
ツク回路32のコントロール信号出力はチエイ
ン・コード発生回路34の番号セレクタ回路34
2の入力にも接続されている。さらに、コントロ
ール・ロジツク回路32のコンテイメント・コー
ド出力はチエイン・コード発生回路34のデー
タ・メモリ343の入力に接続され、また、コン
トロール・ロジツク回路32のタイミング信号出
力はチエイン・コード発生回路34のコンテイメ
ント・コード・カウンタ345の入力に接続され
ている。また、領域番号付け回路33の出力はチ
エイン・コード発生回路34の番号バツフア回路
341の入力に接続されている。
番号バツフア回路341の出力は番号セレクタ
回路342の入力に接続される。番号セレクタ回
路342からの領域番号信号出力はデータ・メモ
リ343の入力に接続され、また、コンテイメン
ト・コード・カウンタの出力はアドレスとしてデ
ータ・メモリ343に与えられるように接続され
る。データ・メモリ343の出力は並べ換えプロ
セツサ344の入力に接続される。
タイミング発生回路35の出力はチエイン・コ
ード回路のデータ・メモリ343および番号バツ
フア回路341の入力に接続される。
次に、本発明回路の動作の説明に先立つて、こ
の説明に用いられる第3図から第13図までの図
面および第1表から第4表までの表の要点を説明
する。
第3図は、前述のように本実施例回路の構成を
示すブロツク構成図である。
第4図は、第3図の2×2マスク回路に入力す
る隣接する4個の画素により構成されるマスク・
パターンの4つの枠の名称を示すもので、図の枠
aと枠bとの1組をマスク・パターンの上ライン
と言い、枠cと枠dとの1組をマスク・パターン
の下ラインと言う。
第5図は、画面50上の対象物の輪郭52と、
対象物を2個の領域に切断する線53とにより、
画面50の領域を3部分に分割した状態を示すも
ので、対象物領域の2部分のそれぞれに「1」お
よび「2」の領域号を付し、背景領域の部分に
「0」の領域番号を付してある。
第6図は、第5図に示す対象物の輪郭に沿うマ
スク・パターンを示す図で、マスク・パターンの
4個の画素の内、斜線の施されている画素はラス
ター・スキヤンにて得られた「1」値の信号を示
し、この信号は第5図における対象物領域にその
画素が属することを示し、また、空白の画素は
「0」値の信号に対応し、背景領域にその画素が
属することを示す。なお、本図における対象物輪
郭線上の黒点はマスク・パターンの4つの画素の
共通点を示す。
第7図は、第6図に記入した矢印付き線cにて
定まる線上に発生するマスク・パターンを示す図
である。ただし、対象物の左側および右側にある
背景のマスク・パターンは省略してある。
第8図は、第5図に示す対象物の輪郭上のコン
テイメント・コードを左下側コードおよび右上側
コードに分類して示したものである。
ここで、左下側コードとは、第12図に示すコ
ンテイメント・コードCcのうち、左側コードで
ある番号1、8、9、11および13のコンテイメン
ト・コード番号3のコンテイメント・コードの総
称であり、右上側コードとは、右側コードである
番号2、4、6、7および14の番号12のコンテイ
メント・コードの総称である。ただし、番号5お
よび10のコンテイメント・コードはそれぞれ番号
1と4とのコンテイメント・コードおよび番号2
と8のコンテイメント・コードとが結合したもの
として取扱うこととする。図の対象物の輪郭上に
短い縦線で示した部分80上のコンテイメント・
コードは第3表の領域番号「1」の左下側コード
に所属し、輪郭線に沿つて破線の付されている部
分81上のコンテイメント・コードは領域番号
「1」の右上側コードに所属し、輪郭上に付した
丸印で示した部分83および84上のコンテイメ
ント・コードは領域番号「2」の右上側コードに
所属し、輪郭上の×印で示した部分82上のコン
テイメント・コードは領域番号「2」の左下側コ
ードに所属し、輪郭上の黒丸印で示した部分85
上のコンテイメント・コードは領域番号「2′」の
左下側コードに所属し、そして輪郭線に沿つて実
線の付されている部分86上のコンテイメント・
コードは領域番号「2′」の右上側コードに所属す
る。なお、図において符号800および符号85
0で示される部分面はそれぞれ領域「1」および
「2」を示し、符号825および875の付され
た円に囲まれた部分はそれぞれUシエープの彎曲
箇所および∩シエープの彎曲箇所をそれぞれ示
す。
第9図から第12図は第2表から第4表にコー
ドが順次変換する過程を示す論理流れ図であつ
て、並べ換えプロセツサ344の動作を示す。す
なわち、データ・メモリ343の記憶内容が画像
対象の輪郭を一周するチエイン・コードに変換さ
れる過程を示す。
第9図は第10および第11図の過程の大要と
その順序を示すものであり、第10図の過程にお
いて第2表から第3表に示す変換が行われ、第1
1図の過程において第3表から第4表の変換が行
われる。
第12図は、マスク・パターンと、コンテイメ
ント・コードCcと、時計まわりのチエイン・コ
ードCdとの対応を示すもで、チエイン・コード
には方向符号も添記されている。
このコンテイメント・コードCcは、4個の画
素の組合せをコード化したもので、第4図に示す
マスク・パターンの枠a〜dの画素に対してaは
「1」、bは「2」、cは「4」、dは「8」の重み
づけを行つて、4個の画素の組合せについて
「0」〜「15」の番号を与えたものである。この
コンテイメント・コードCcは、4個の画素の組
合せを示しており、マスク・パターンが決まれば
自動的に付すことができ、第12図に示すような
チエイン・コードとの対応関係をもつ。
第13図は、彎曲点の左端のマスク・パターン
との組合せを示すもので、彎曲点ペアと言う。彎
曲点には上に凸の場合と、下に凸の場合と、上に
凹(以下、Uシエープと言う。)の場合と、下に
凹(以下、∩シエープと言う。)の場合とがある。
彎曲点ペアの間に介在するコンテイメント・コー
ド番号3および12に対応するマスク・パターンの
数によつて、彎曲点の名称は影響されない。
第1表は、チエイン・コード発生回路34の番
号セレクタ回路の判断基準を示すもので、コント
ロール・ロジツク回路からのコンテイメント・コ
ードに対応して番号バツフア回路341に一時記
憶されている枠を選択する基準であつて、選択さ
れた枠内の領域番号がデータ・メモリ343に与
えられる。
第2表は、第6図の対象物の輪郭に沿うて生成
されたマスク・パターンに基づき、データ・メモ
リ343に記憶される領域番号およびコンテイメ
ント・コードを示す。ただし、領域番号の行に示
した×印は領域番号が番号セレクタ回路342に
選択されない場合を示す。
第3表は、第8図に示す領域番号および左下側
コードと右上側コードとを組合せることにより作
成されるテーブルに、それぞれの組合わせに所属
するコンテイメント・コードを第10図の論理流
れ図に示す方法に従つて処理された状態を示す。
第4表は、第3表に示すように分類されたデー
タを第11図の論理流れ図に示す処理を経て画像
領域の輪郭を一周するチエイン・コードに変換さ
れた状態を示す。コンテイメント・コードを併記
し、本表と第3表との関連を明確にするととも
に、データが圧縮された状態も示すものである。
[Technical field to which the invention pertains] It relates to an image information processing circuit. In particular, the present invention relates to a circuit that compresses contour shape information of an object in a binary image into one-dimensional information, which is suitable as one of the means for pattern recognition. [Description of Prior Art] The contour tracking method shown in FIG. 1 is often used to measure the contour shape of an object, which is important in image measurement. This method traces the contour of the object 12 in the binary image clockwise 13 or counterclockwise, and traces the contour of the object once, and creates chain codes in eight directions as shown in FIG. Using four-directional codes, tracking directions are sequentially identified, and two-dimensional information about the outline of the object is compressed into one-dimensional information. In order to perform this contour tracing at high speed, there is a method that relies on hardware, but the circuit becomes complicated and there are few examples of such conventional circuits. Furthermore, when using a CPU or the like to make direction judgments associated with contour tracking, real-time processing is difficult, making it unsuitable for high-speed processing. [Object of the Invention] An object of the present invention is to provide a circuit that measures the contour shape using a method that replaces the conventional contour tracking method, and eliminates the disadvantages of the contour tracking method associated with the aforementioned high-speed image processing. shall be. [Summary of the Invention] Instead of directly generating a chain code using the contour tracking method, the present invention first generates a containment code by raster scanning, and processes this code to correspond to the contour shape of a binary image. It generates a chain code, and includes an input terminal into which a binary image scanned in a plane according to horizontal and vertical synchronization is input, and a circuit that numbers each pixel represented by the signal of this terminal for each image area. , a circuit that generates a containment code for four adjacent pixels of the screen represented by the signal input to the input terminal, and a set of the image area number and the containment code for that pixel for each pixel. a processor connected to the memory circuit for rearranging the addresses of the memory contents of the memory circuit; and a processor connected to the memory circuit for rearranging the addresses of the memory contents of the memory circuit; It is characterized by including means for rearranging addresses so that they are equivalent to chain codes. [Explanation based on Examples] The present invention will be described based on the drawings. FIG. 3 is a block configuration diagram showing the configuration of the embodiment circuit. First, the configuration of the circuit of this embodiment will be explained based on FIG. This circuit includes an image signal input terminal 30 that inputs binary signals of "1" and "0" obtained by raster scanning a binary image to be measured, and a containment code generation circuit 31.
, a control logic circuit 32 , an area numbering circuit 33 , and a chain code generation circuit 3
4 and a timing generation circuit 35, furthermore, the containment code generation circuit 31 includes a one-line memory 3 that provides a delay of one horizontal scanning period.
In addition, the chain code generation circuit 34 includes a number buffer circuit 341, a number selector circuit 342, a data memory 343, and a rearrangement processor 344.
and a containment code counter 345. Next, the connections of the circuit of this embodiment will be explained based on FIG. The terminal 30 is connected to an image signal source (not shown), and is connected so as to input this image signal to a containment code generation circuit 31. The output of the containment code generation circuit 31 is connected to the input of the control logic circuit 32. The containment code output of the control logic circuit 32 is the area numbering circuit 3.
3, and the control signal output of the control logic circuit 32 is connected to the number selector circuit 34 of the chain code generation circuit 34.
It is also connected to the second input. Furthermore, the containment code output of the control logic circuit 32 is connected to the input of the data memory 343 of the chain code generation circuit 34, and the timing signal output of the control logic circuit 32 is connected to the input of the data memory 343 of the chain code generation circuit 34. Connected to the input of containment code counter 345. Further, the output of the area numbering circuit 33 is connected to the input of the number buffer circuit 341 of the chain code generation circuit 34. The output of number buffer circuit 341 is connected to the input of number selector circuit 342. The area number signal output from number selector circuit 342 is connected to an input of data memory 343, and the output of the containment code counter is connected to be provided as an address to data memory 343. The output of data memory 343 is connected to the input of reorder processor 344. The output of timing generation circuit 35 is connected to the data memory 343 of the chain code circuit and the input of number buffer circuit 341. Next, prior to explaining the operation of the circuit of the present invention, the main points of the drawings from FIG. 3 to FIG. 13 and the tables from Tables 1 to 4 used for this explanation will be explained. FIG. 3 is a block configuration diagram showing the configuration of the circuit of this embodiment as described above. Figure 4 shows a mask composed of four adjacent pixels input to the 2x2 mask circuit in Figure 3.
This shows the names of the four frames of the pattern. One set of frames a and b in the figure is called the upper line of the mask pattern, and one set of frames c and d is called the lower line of the mask pattern. To tell. FIG. 5 shows an outline 52 of an object on a screen 50, and
By a line 53 that cuts the object into two regions,
This shows a state in which the area of the screen 50 is divided into three parts, with area numbers "1" and "2" assigned to each of the two parts of the object area, and area number "0" assigned to the background area. is attached. FIG. 6 is a diagram showing a mask pattern that follows the outline of the object shown in FIG. 5. Among the four pixels of the mask pattern, the shaded pixels are obtained by raster scanning. A blank pixel corresponds to a "1" value signal, which indicates that the pixel belongs to the object region in FIG. 5, and a blank pixel corresponds to a "0" value signal, indicating that the pixel belongs to the background region. indicates that it belongs to Note that the black dots on the object outline in this figure indicate the common points of the four pixels of the mask pattern. FIG. 7 is a diagram showing a mask pattern generated on a line defined by the arrowed line c drawn in FIG. However, the background mask patterns on the left and right sides of the object are omitted. FIG. 8 shows the containment codes on the contour of the object shown in FIG. 5, classified into lower left codes and upper right codes. Here, the lower left chord is a general term for the left-hand chords numbers 1, 8, 9, 11, and 13 of the containment codes Cc shown in FIG. 12, and the containment code number 3. The upper right chord is a general term for the right-side chords numbers 2, 4, 6, 7, and 14, and the containment chord number 12. However, the containment codes numbered 5 and 10 are the same as the containment codes numbered 1 and 4 and number 2, respectively.
and the containment code of 8 will be treated as a combination. Containment on the area 80 indicated by short vertical lines on the outline of the object in the figure.
The code belongs to the lower left code of area number "1" in Table 3, and the containment code on the dashed part 81 along the outline belongs to the upper right code of area number "1". However, the containment codes on the parts 83 and 84 marked with circles on the outline belong to the upper right code of area number "2", and the containment codes on the part 82 marked with an x on the outline belong to the upper right code of area number "2".・The code belongs to the lower left code of area number "2", and is part 85 indicated by the black circle on the outline.
The upper containment code belongs to the lower left code of area number "2'", and the containment code on the part 86 marked with a solid line along the contour line
The code belongs to the upper right code of area number "2'". In addition, in the figure, reference numeral 800 and reference numeral 85
Partial surfaces indicated by 0 indicate areas "1" and "2", respectively, and the parts surrounded by circles marked with numerals 825 and 875 respectively indicate the curved part of the U shape and the curved part of the ∩ shape. 9 to 12 are logical flowcharts showing the process of sequentially converting codes from Table 2 to Table 4, and illustrate the operation of rearrangement processor 344. That is, the process in which the stored contents of the data memory 343 are converted into a chain code that goes around the outline of the image object is shown. Figure 9 shows the outline and order of the processes in Figures 10 and 11. In the process of Figure 10, the conversions shown in Tables 2 to 3 are performed, and
In the process shown in FIG. 1, conversion from Table 3 to Table 4 is performed. FIG. 12 shows the correspondence between the mask pattern, the containment code Cc, and the clockwise chain code Cd, and a direction code is also added to the chain code. This containment code Cc is a code of a combination of four pixels, and for the pixels in frames a to d of the mask pattern shown in FIG. 4, a is "1" and b is "2". , c is weighted with "4" and d is weighted with "8", and numbers from "0" to "15" are given to combinations of four pixels. This containment code Cc indicates a combination of four pixels, can be automatically attached once a mask pattern is determined, and has a correspondence relationship with a chain code as shown in FIG. FIG. 13 shows a combination of a curved point and a mask pattern at the left end, which is called a curved point pair. There are three types of curved points: upwardly convex, downwardly convex, upwardly concave (hereinafter referred to as U shape), and downwardly concave (hereinafter referred to as ∩shape). be.
The names of the bend points are not affected by the number of mask patterns corresponding to containment code numbers 3 and 12 that are interposed between the bend point pairs. Table 1 shows the judgment criteria of the number selector circuit of the chain code generation circuit 34, and selects the frame temporarily stored in the number buffer circuit 341 corresponding to the containment code from the control logic circuit. The area number within the selected frame is given to the data memory 343. Table 2 shows area numbers and containment codes stored in data memory 343 based on the mask pattern generated along the contour of the object in FIG. However, the x mark shown in the area number row indicates the case where the area number is not selected by the number selector circuit 342. Table 3 is a table created by combining the area numbers shown in FIG. 8, the lower left code, and the upper right code, and the containment codes belonging to each combination are added to the logical flowchart shown in FIG. 10. This shows the state processed according to the method shown in . Table 4 shows the state in which the data classified as shown in Table 3 is converted into a chain code that goes around the outline of the image area through the processing shown in the logical flowchart of FIG. A containment code is also included to clarify the relationship between this table and Table 3, and also to indicate the compressed state of the data.
【表】【table】
【表】【table】
【表】【table】
(1) 二値画像の再生および輪郭点座標の計算
第14図に示すXY座標データ・メモリ32
を第3図に示す回路に付加することにより、画
像再生および座標計算を行うことができる。す
なわち、このXY座標データ・メモリは、コン
トロール・ロジツク回路より上の凸の彎曲点ペ
アが現われた時に、番号8のコンテイメント・
コードを示す輪郭上の点の座標を記憶する回路
である。この座標の示す点は対象物の輪郭を一
周するチエイン・コードを作成する際の始点を
示すもので、この点の座標とチエイン・コード
とを用いて、もとの二値画像が再生できる。ま
た、各輪郭点の座標の計算も行うことができ
る。
(2) 極座標方式による輪郭形状の表現
第15図および第16図に基づき説明する。
第15図は対象物の輪郭130と対象物上の
定点131例えば重心の座標(Xc、Yc)およ
び始点132の座標(X0、Y0)および定点1
31を原点とし、定点131と始点132とを
結ぶ線を極座標の基準線とし、対象物の輪郭上
を極座標を示すベクトル135が移動してゆく
状態を示すものである。
第16図の横軸は輪郭点の順序番号または基
準線となすベクトル135の偏移角134を示
し、縦軸はベクトル135の長さすなわち重心
135から輪郭130上の点までの距離を示
す。図は始点132を原点として画かれてい
る。
この方法によつて輪郭形状情報を表現するこ
とができるが、このときにチエイン・コードを
利用すると、定点からの輪郭上の点との距離
Riの計算を容易に行うことができる。
すなわち、任意の輪郭上の点の座標を(Xi、
Yi)とし、始点と定点間の距離をR0とすれば
R0 2=(X0−Xc)2+(Y0+Yc)2
で求まり、以下、隣接する輪郭上の点の座標の
変化は、それぞれ下記のようにチエイン・コー
ドに対応する。すなわち、
X座標の「+1」の変化は番号1、2、8の
チエイン・コードの出現に対応し、したがつて
Ri2=(Ri-1)2+2(Xi−Xc)+1
X座標の「−1」の変化は、番号5、4、6
のチエイン・コードの出現に対応し、したがつ
て
Ri2=(Ri-1)2+2(−Xi−Xc)+1
Y座標の「+1」の変化は、番号3、4、12
のチエイン・コードの出現に対応し、したがつ
て
Ri2=(Ri-1)2+2(Yi−Yc)+1
また、Y座標の「−1」の変化は、番号7、
8、6のチエイン・コード出現に対応し、した
がつて
Ri2=(Ri-1)2+2(−Yi−Yc)+1
により、輪郭上の点と定点との距離を求めるこ
とができる。
(3) 面積および周長の計算
対象物の面積積の算出は、上記(1)の方法によ
り求まる輪郭点の座標に基づき、その輪郭点が
右側コードに属するか左側コードに属するかを
判別し、右側コードに属するときは加算し、左
側コードに属するときは減算を行つて減算を行
つて輪郭を一周することにより行うことができ
る。この場合、座標は始点を原点とする座標で
あつてもよい。
また、周長の算出は、一行のラスター・スキ
ヤンにて得られる一連のマスク・パターンに
て、コンテイメント・コードが番号1、2、
4、7、8、11、13、14の場合「√2/2」と
して計測し、コンテイメント・コードが番号
3、6、9、12の場合「1」として計測するこ
とによつて行うことができる。
〔発明の効果〕
本発明は、ラスター・スキヤンにより二値画像
に輪郭形状に対応するチエイン・コード生成でき
るので、従来の輪郭追跡法による輪郭形状計測に
比べて簡単なハードウエアにてリアルタイム処理
を行うことができる。
また、二値画像を一次元データに変換している
のでデータ圧縮が行われ、したがつて信号の伝送
および記憶に便利である。
さらに、対象物の形状情報として面積、周長の
ほかに、外周の凹凸情報も得られ、パターン認識
のときの外形形状の識別に便利である。
(1) Reproduction of binary image and calculation of contour point coordinates XY coordinate data memory 32 shown in Fig. 14
By adding this to the circuit shown in FIG. 3, image reproduction and coordinate calculation can be performed. That is, this XY coordinate data memory stores the containment number 8 when a pair of convex curved points above the control logic circuit appears.
This is a circuit that stores the coordinates of points on the contour indicating the code. The point indicated by these coordinates indicates the starting point for creating a chain code that goes around the outline of the object, and the original binary image can be reproduced using the coordinates of this point and the chain code. It is also possible to calculate the coordinates of each contour point. (2) Expression of contour shape using polar coordinate system This will be explained based on FIGS. 15 and 16. FIG. 15 shows the outline 130 of the object, the fixed point 131 on the object, for example, the coordinates of the center of gravity (Xc, Yc), the coordinates of the starting point 132 (X 0 , Y 0 ), and the fixed point 1
31 as the origin, a line connecting the fixed point 131 and the starting point 132 as the reference line of the polar coordinates, and shows a state in which a vector 135 indicating the polar coordinates moves on the contour of the object. The horizontal axis in FIG. 16 indicates the order number of the contour points or the deviation angle 134 of the vector 135 which is the reference line, and the vertical axis indicates the length of the vector 135, that is, the distance from the center of gravity 135 to a point on the contour 130. The figure is drawn with the starting point 132 as the origin. Contour shape information can be expressed using this method, but if a chain code is used at this time, the distance of a point on the contour from a fixed point
Calculation of Ri can be easily performed. In other words, let the coordinates of a point on any contour be (Xi,
Yi), and the distance between the starting point and the fixed point is R 0 , then R 0 2 = ( X 0 − , each corresponds to the chain code as shown below. That is, a change of "+1" in the X coordinate corresponds to the appearance of chain codes numbered 1, 2, and 8, and therefore Ri 2 = (R i-1 ) 2 + 2 (Xi - Xc) + 1 "-1" change is number 5, 4, 6
Therefore, Ri 2 = (R i-1 ) 2 + 2 (-Xi-Xc) + 1 A change of "+1" in the Y coordinate corresponds to the occurrence of the chain code of numbers 3, 4, 12
Therefore, Ri 2 = (R i-1 ) 2 + 2 (Yi - Yc) + 1 Also, the change of "-1" in the Y coordinate corresponds to the appearance of the chain code of number 7,
The distance between a point on the contour and a fixed point can be determined by Ri 2 =(R i-1 ) 2 +2(-Yi-Yc)+1. (3) Calculation of area and circumference To calculate the area product of an object, based on the coordinates of the contour point determined by the method (1) above, determine whether the contour point belongs to the right-hand code or the left-hand code. , when it belongs to the right-hand code, add it, and when it belongs to the left-hand code, perform subtraction, and then go around the contour. In this case, the coordinates may be coordinates with the starting point as the origin. In addition, the circumference is calculated using a series of mask patterns obtained by one line of raster scanning, with containment codes numbered 1, 2,
4, 7, 8, 11, 13, and 14 by measuring it as “√2/2” and when the containment code is number 3, 6, 9, and 12, it should be measured as “1”. Can be done. [Effects of the Invention] The present invention can generate a chain code corresponding to the contour shape in a binary image using raster scanning, so real-time processing can be performed using simpler hardware than contour shape measurement using the conventional contour tracking method. It can be carried out. Also, since the binary image is converted into one-dimensional data, data compression is performed, and therefore it is convenient for signal transmission and storage. Furthermore, in addition to the area and circumference of the object, information on the irregularities of the outer periphery can also be obtained, which is convenient for identifying the outer shape during pattern recognition.
第1図は輪郭追跡法を説明する模式図。第2図
はチエイン・コードを説明する図。第3図は本発
明の実施例回路の構成を示すブロツク構成図。第
4図は2×2マスク・パターンの枠名称の説明
図。第5図は画像の領域番号を示す説明図。第6
図は輪郭のコンテイメント・コード発生状態を示
す図。第7図は特定のラスター走査によるコンテ
イメント・コードの発生状態を示す図。第8図は
輪郭の領域番号を示す説明図。第9図〜第11図
は並べ換えプロセツサの動作を説明する論理流れ
図。第12図は信号の対照図。第13図は彎曲点
ペアの説明図。第14図はXY座標データ・メモ
リと入出力の接続を示す図。第15図および第1
6図は極座標方式による輪郭形状表現の説明図。
11……走査線、12,130……対象物輪
郭、30……画像信号入力端子、31……コンテ
イメント・コード発生回路、32……コントロー
ル・ロジツク回路、33……領域番号付け回路、
34……チエイン・コード発生回路、35……タ
イミング発生回路、50……画面、52……対象
物の輪郭、53……対象物領域切断線、90……
座標データメモリ、91……X座標信号入力端
子、92……Y座標信号入力端子、131……定
点、132……始点、133……領域番号上の任
意点、134…偏位角、135……極座標ベクト
ル、311……ワンライン・メモリ、312……
2×2マスク回路、341……番号バツフア回
路、342……番号セレクタ回路、343……デ
ータ・メモリ、344……並べ換えプロセツサ、
345……コンテイメント・コード・カウンタ。
FIG. 1 is a schematic diagram explaining the contour tracking method. FIG. 2 is a diagram explaining a chain code. FIG. 3 is a block configuration diagram showing the configuration of a circuit according to an embodiment of the present invention. FIG. 4 is an explanatory diagram of frame names of a 2×2 mask pattern. FIG. 5 is an explanatory diagram showing area numbers of images. 6th
The figure shows a state in which contour containment codes are generated. FIG. 7 is a diagram showing how a containment code is generated by a specific raster scan. FIG. 8 is an explanatory diagram showing area numbers of contours. 9-11 are logic flow diagrams illustrating the operation of the reordering processor. FIG. 12 is a comparison diagram of signals. FIG. 13 is an explanatory diagram of curved point pairs. FIG. 14 is a diagram showing the connection of the XY coordinate data memory and input/output. Figure 15 and 1
Figure 6 is an explanatory diagram of contour shape expression using the polar coordinate system. 11... Scanning line, 12, 130... Object outline, 30... Image signal input terminal, 31... Containment code generation circuit, 32... Control logic circuit, 33... Area numbering circuit,
34... Chain code generation circuit, 35... Timing generation circuit, 50... Screen, 52... Outline of object, 53... Target area cutting line, 90...
Coordinate data memory, 91...X coordinate signal input terminal, 92...Y coordinate signal input terminal, 131...fixed point, 132...start point, 133...arbitrary point on area number, 134...deviation angle, 135... ...Polar coordinate vector, 311...One line memory, 312...
2×2 mask circuit, 341...Number buffer circuit, 342...Number selector circuit, 343...Data memory, 344...Reordering processor,
345...Containment code counter.
Claims (1)
査された2値画像が入力する入力端子と、 この端子の信号が表わす各画素に画素領域毎の
番号付けを行う回路と、 上記入力端子に入力する信号が表わす画面の隣
接する4個の画素についてこの4個の画素の組合
せを示すコンテイメント・コードを発生する回路
と、 各画素毎に上記画素領域の番号およびその画素
の上記コンテイメント・コードを一組として記憶
する記憶回路と、 この記憶回路に接続されこの記憶回路の記憶内
容のアドレス並べ換えを行うプロセツサと を備え、 このプロセツサは、上記記憶回路の記憶内容の
読出し順序が上記画像領域の輪郭を一周するチエ
イン・コードと同等になるようにアドレス並べ換
えを行う手段を含むことを特徴とする輪郭形状情
報抽出回路。[Claims] 1. An input terminal into which a binary image plane-scanned according to horizontal synchronization and vertical synchronization is input, and a circuit that numbers each pixel represented by the signal of this terminal for each pixel area; A circuit that generates a containment code indicating a combination of four adjacent pixels on the screen represented by a signal input to the input terminal; A memory circuit that stores the content codes as a set, and a processor that is connected to the memory circuit and rearranges the addresses of the memory contents of the memory circuit. 1. A contour shape information extraction circuit comprising means for rearranging addresses so that the chain code is equivalent to a chain code that goes around the contour of the image area.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP58182589A JPS6074092A (en) | 1983-09-30 | 1983-09-30 | Extracting circuit of contour shape information |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP58182589A JPS6074092A (en) | 1983-09-30 | 1983-09-30 | Extracting circuit of contour shape information |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6074092A JPS6074092A (en) | 1985-04-26 |
| JPH0148587B2 true JPH0148587B2 (en) | 1989-10-19 |
Family
ID=16120930
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP58182589A Granted JPS6074092A (en) | 1983-09-30 | 1983-09-30 | Extracting circuit of contour shape information |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS6074092A (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS62145384A (en) * | 1985-12-20 | 1987-06-29 | Dainippon Printing Co Ltd | Contour extraction method |
| JP3014097B2 (en) * | 1987-02-20 | 2000-02-28 | 株式会社日立製作所 | Contour tracking method and system |
| JPH0535872A (en) * | 1991-07-31 | 1993-02-12 | Victor Co Of Japan Ltd | Contour tracing system for binary image |
-
1983
- 1983-09-30 JP JP58182589A patent/JPS6074092A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6074092A (en) | 1985-04-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4853971A (en) | Method and apparatus for processing image data | |
| JPH0148587B2 (en) | ||
| JP2676116B2 (en) | Image data processing method and apparatus | |
| JPH0130180B2 (en) | ||
| JPS6074093A (en) | Extracting circuit of contour shape information | |
| JPS63116866A (en) | Character font converting system | |
| JP3582734B2 (en) | Table vectorizer | |
| JP4004217B2 (en) | Image processing device | |
| JPS62170287A (en) | Apparatus for forming stitch data of embroidering machine | |
| KR930004645B1 (en) | Image coding apparatus | |
| JP2511966B2 (en) | Graphic processing device | |
| JPH0535872A (en) | Contour tracing system for binary image | |
| JPH03269773A (en) | Picture element/vector converter and converting method | |
| JP2831218B2 (en) | Image generation device | |
| JP2646577B2 (en) | Image information creation device | |
| JPH05165456A (en) | Outline extracting method | |
| JPH11144074A (en) | Image processing device | |
| JPH07101450B2 (en) | Labeling processor | |
| JPS5930317B2 (en) | pattern | |
| JPS62235688A (en) | Image blank-filling processing method | |
| JPH0691598B2 (en) | Pattern recognition method and image reduction apparatus therefor | |
| JPH01136282A (en) | Contour line tracking method | |
| JPH035630B2 (en) | ||
| JPH036778A (en) | Boundary tracking convex hull generation method | |
| JPH0442712B2 (en) |