JP2575047B2 - Digital image restoration device - Google Patents

Digital image restoration device

Info

Publication number
JP2575047B2
JP2575047B2 JP13414488A JP13414488A JP2575047B2 JP 2575047 B2 JP2575047 B2 JP 2575047B2 JP 13414488 A JP13414488 A JP 13414488A JP 13414488 A JP13414488 A JP 13414488A JP 2575047 B2 JP2575047 B2 JP 2575047B2
Authority
JP
Japan
Prior art keywords
pixel
value
coordinate
image memory
state value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP13414488A
Other languages
Japanese (ja)
Other versions
JPH01303584A (en
Inventor
直樹 佐野
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric Corp
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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP13414488A priority Critical patent/JP2575047B2/en
Publication of JPH01303584A publication Critical patent/JPH01303584A/en
Application granted granted Critical
Publication of JP2575047B2 publication Critical patent/JP2575047B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Description

【発明の詳細な説明】 <産業上の利用分野> 本発明は、ディジタル画像の境界線を形成する頂点座
標リストから原画像を高速に復元するディジタル画像の
復元装置に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital image restoration apparatus for quickly restoring an original image from a vertex coordinate list forming a boundary of a digital image.

<従来の技術> コンピュータ・グラフィックス、画像データベース等
の分野では、塗り潰し図形を含むディジタル画像を何ら
かの形(例えば、境界追跡によってその境界線図形を多
角形近似する方法)で圧縮してファイル化し、これを高
速に復元する必要がある。この場合、復元時にはディジ
タル図形の内部を一般に黒画素領域として塗り潰さなけ
ればならない。
<Prior Art> In the fields of computer graphics, image databases, and the like, a digital image including a filled figure is compressed into a file in some form (for example, a method of approximating the boundary figure by a polygon by boundary tracking), and is converted into a file. This needs to be restored at high speed. In this case, when restoring, the inside of the digital figure must generally be filled as a black pixel area.

ディジタル画像を圧縮してファイル化する方式とし
て、ディジタル画像の境界線図形を1つの多角形とみな
してその頂点座標リストを作成する方式があり、更にこ
の頂点座標リストを用いて原画像を復元する方式とし
て、コンピュータ・グラフィックス分野で知られるスキ
ャン・ライン・アルゴリズム(例えば、J.D.FOLEY/A.VA
N DAM,“Fundamentals of Interactive Computer Grap
hics,"Addision−Wesley,1982等に記載されている方
式)が利用されている。
As a method of compressing a digital image into a file, there is a method in which a boundary line figure of the digital image is regarded as one polygon and a vertex coordinate list is created, and the original image is restored using the vertex coordinate list. The scan line algorithm known in the computer graphics field (for example, JDFOLEY / A.VA
N DAM, “Fundamentals of Interactive Computer Grap
hics, "Addision-Wesley, 1982") is used.

このスキャン・ライン・アルゴリズムは、頂点座標リ
ストより得られた多角形と交わる全ての走査線につい
て、各走査線毎に、走査線と多角形各辺(水平辺は除
く)との交点を算出し、交点対を求め、その交点対間の
全ての画素を順次塗り潰していく方式である。
This scan line algorithm calculates, for each scan line, the intersection of the scan line and each side of the polygon (excluding the horizontal side) for all the scan lines that intersect the polygon obtained from the vertex coordinate list. , An intersection pair is obtained, and all pixels between the intersection pairs are sequentially filled.

対象とするディジタル画像を第7図に、このディジタ
ル画像より得られる頂点座標リストから形成される境界
線図形を第8図に示す。
FIG. 7 shows a target digital image, and FIG. 8 shows a boundary graphic formed from a vertex coordinate list obtained from the digital image.

また、ディジタル画像の境界線を形成する頂点座標リ
ストは、一般性を失うことなく、左側に図形部分を見る
ように境界を8連結走査に基づいて追跡することによっ
て予め下記の形式で得られるものである。
The vertex coordinate list forming the boundary line of the digital image is obtained in advance in the following format by tracing the boundary based on 8-connected scanning so as to see the graphic portion on the left without losing generality. It is.

頂点座標リスト= [{境界線#1の頂点座標リスト}, {境界線#2の頂点座標リスト}, …,{境界線#nの頂点座標リスト}] ここで、境界線#iの頂点座標リスト(総頂点数をm
とする)は次のようになる。
Vertex coordinate list = [{Vertex coordinate list of boundary line # 1}, {Vertex coordinate list of boundary line # 2}, ..., {Vertex coordinate list of boundary line #n} Here, vertex coordinates of boundary line #i List (the total number of vertices is m
) Is as follows.

{総頂点数m|Pi1(Xi1,Yi1),Pi2(Xi2,Yi2),… Pim−1(Xim−1,Yim−1),Pim(Xim,Yim)} ここに各点P(X,Y)は頂点座標を表わす。{Total number of vertices m | P i1 (X i1 , Y i1 ), P i2 (X i2 , Y i2 ),... Pim−1 (Xim−1, Yim−1), P im (X im , Y im )} Here, each point P (X, Y) represents vertex coordinates.

尚、Pimi=Pi1とし、終点頂点には始点頂点と同じ値
を入れる。
Note that P imi = P i1 , and the same value as the start vertex is input to the end vertex.

ここで扱うディジタル画像は、画像メモリ上において
第9図に示すように、左上の点を始点(0,0)とし、水
平方向X,垂直方向Yとする2次元座標(X,Y)を定義
し、座標(X,Y)における画素値をF(X,Y)とする時、
F(X,Y)=1であれば図形部分(黒画素)、F(X,Y)
=0であれば背景部分(白画素)とする。
The digital image handled here defines two-dimensional coordinates (X, Y) with the upper left point as the starting point (0, 0) and the horizontal direction X and the vertical direction Y on the image memory as shown in FIG. When the pixel value at the coordinates (X, Y) is F (X, Y),
If F (X, Y) = 1, figure part (black pixel), F (X, Y)
If = 0, it is set as a background portion (white pixel).

即ち、第7図に示すディジタル画像の頂点座標リスト
は次のようになる。
That is, the vertex coordinate list of the digital image shown in FIG. 7 is as follows.

頂点座標リスト= [{33|P11(8,1),P12(8,3),P13(7,4),…,P
132(8,3),P133(8,1)}, {8|P21(9,7),P22(9,9),P23(8,10),…,P27(8,
6),P28(9,7)}, {12|P31(19,7),P32(19,8),P33(18,9),…,P311
(18,6),P312(19,7)} …(I) この頂点座標リストより形成される境界線図形を第8
図に示し、更に、この境界線図形にスキャン・ライン・
アルゴリズムを適用した場合を第10図に示す。
Vertex coordinate list = [{33 | P 11 (8,1), P 12 (8,3), P 13 (7,4),…, P
132 (8,3), P 133 (8,1)}, {8 | P 21 (9,7), P 22 (9,9), P 23 (8,10),…, P27 (8,
6), P28 (9,7)} , {12 | P 31 (19,7), P 32 (19,8), P 33 (18,9), ..., P 311
(18,6), P 312 (19,7)} ... (I) The boundary line figure formed from this vertex coordinate list is
As shown in the figure, scan lines
FIG. 10 shows a case where the algorithm is applied.

例えば走査線Y=5において、X=5からX=11、X
=16からX=18、X=22からX=23の3区間を検出し、
画素値「1」を用いて塗り潰す。
For example, when the scanning line Y = 5, X = 5 to X = 11, X
= 16 to X = 18, X = 22 to X = 23,
Painting is performed using the pixel value “1”.

このような操作をY=1からY=13まで繰り返してこ
の境界線図形の塗り潰しを行う。
Such an operation is repeated from Y = 1 to Y = 13 to fill the boundary graphic.

<発明が解決しようとする課題> しかしながら、上記のような方法であると、走査線が
頂点と交わる場合、例えばY=6において、極大を表わ
す頂点P27,P311、極小を表わす頂点P123では2交点と数
え、他の頂点では1交点と数え、X=4からX=8,X=
8からX=12,X=15からX=18,X=18からX=19,X=23
からX=23の5区間の交点対を算出する必要があり、処
理手順が繁雑である。
<Problems to be Solved by the Invention> However, according to the above method, when the scanning line intersects the vertices, for example, at Y = 6, the vertices P 27 and P 311 representing the local maximum, and the vertex P 123 representing the local minimum. Then, it counts as 2 intersections, and at the other vertices it counts as 1 intersection. From X = 4 to X = 8, X =
8 to X = 12, X = 15 to X = 18, X = 18 to X = 19, X = 23
, It is necessary to calculate an intersection pair of five sections of X = 23, and the processing procedure is complicated.

また、第8図に示すような複雑な形状の多角形で走査
線と交わる辺の数が多い場合、交点対を算出するために
交点のX座標のソーティング処理に時間がかかり、全体
の処理時間が長くなるという問題があった。
In the case of a polygon having a complicated shape as shown in FIG. 8 and a large number of sides intersecting the scanning line, it takes time to sort the X coordinate of the intersection to calculate the intersection pair. There was a problem that becomes longer.

このように、従来の方式ではディジタル画像の境界線
を形成する頂点座標リストから原画像を高速に復元する
ことができなかった。
As described above, in the conventional method, the original image could not be quickly restored from the vertex coordinate list forming the boundary of the digital image.

本発明は、以上の問題を解決するものであり、ディジ
タル画像の境界線を形成する頂点座標リストが与えられ
た場合に、その原画像を高速に復元する方式を提供する
ことを目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to solve the above-described problem, and to provide a method for quickly restoring an original image when a vertex coordinate list forming a boundary line of a digital image is given.

<課題を解決するための手段> 本発明は、与えられた頂点座標リストより線分を発生
して各々の座標値についてその前後の座標値との位置関
係を調べて、注目画素の画素状態値を求め、この画素状
態値に応じた処理を実行するものであり、概要は次の通
りである。
<Means for Solving the Problems> According to the present invention, a line segment is generated from a given vertex coordinate list, the positional relationship between each coordinate value and the coordinate values before and after the line segment is checked, and the pixel state value of the target pixel is determined. , And a process corresponding to the pixel state value is executed. The outline is as follows.

即ち、本発明は、ホスト計算機よりディジタル画像の
境界線を形成する頂点座標リスト及びコマンドが書き込
まれるセグメント・バッファと、 前記頂点座標リスト上の連続する2頂点を結ぶ線分を
形成する座標値を算出する線分発生部と、 この線分発生部より算出された座標値を順次入力して
現在の注目画素の座標値とその前後の画素の座標値の位
置関係より前記注目画素に対応する画素状態値を、現在
の注目画素が境界線の重なり点の可能性を有するときは
“2"、現在の注目画素が極大点または極小点であるとき
は“1"、現在の注目画素が連続する線分を構成する点で
あるときは“0"としその座標値とともに出力する画素状
態値生成部と、 この画素状態値とその座標値を入力し、 予め画像メモリをクリアする処理と、 前記画素状態値が“0"の場合は何もせず、 前記画素状態値が“1"の場合、及び前記画素状態値が
“2"でかつ前記画像メモリ上の画素値が「1」の場合に
注目画素を特異画素として検出し、 前記画素状態値が“2"でかつ前記画像メモリ上の画素
値が「0」の場合に前記画像メモリの対応する位置に画
素値「1」を書き込み、 前記画像メモリをラスタ走査して奇数番目の画素値
「1」を有する画素から偶数番目の画素値「1」を有す
る画素まで画素値「1」を書き込み、 前記特異画素に画素値「1」を書き込む処理 を行うコントローラと とからなるディジタル画像の復元装置。
That is, the present invention provides a segment buffer in which a vertex coordinate list and a command forming a boundary line of a digital image are written from a host computer, and a coordinate value forming a line segment connecting two consecutive vertices on the vertex coordinate list. A line segment generating unit to be calculated, and a coordinate value sequentially calculated by the line segment generating unit, and a pixel corresponding to the pixel of interest based on a positional relationship between the coordinate value of the current pixel of interest and the coordinate values of pixels before and after the pixel of interest. The state value is “2” when the current pixel of interest has a possibility of a boundary overlapping point, “1” when the current pixel of interest is a maximum point or a minimum point, and the current pixel of interest is continuous A pixel state value generating unit that outputs “0” when the point constitutes a line segment and outputs the pixel state value together with its coordinate value; a process of inputting the pixel state value and its coordinate value to clear the image memory in advance; Status value is "0" No action is taken in the case of. If the pixel state value is "1", and if the pixel state value is "2" and the pixel value in the image memory is "1", the target pixel is detected as a singular pixel. When the pixel state value is “2” and the pixel value on the image memory is “0”, a pixel value “1” is written at a corresponding position in the image memory, and the image memory is raster-scanned. A controller that writes a pixel value “1” from a pixel having an odd-numbered pixel value “1” to a pixel having an even-numbered pixel value “1” and writes a pixel value “1” to the singular pixel Digital image restoration device.

<作用> 本発明によるディジタル画像の復元装置の動作の原理
を次に説明する。
<Operation> The principle of operation of the digital image restoration apparatus according to the present invention will be described below.

予め、復元すべきディジタル画像を格納するための画
像メモリを全てクリア(画素値「0」を書き込む)した
後、対象となるディジタル画素の境界線を形成する頂点
座標リストを順次入力する。
After clearing all the image memories for storing the digital images to be restored (writing the pixel value “0”) in advance, a vertex coordinate list forming the boundary line of the target digital pixel is sequentially input.

頂点座標リストの2頂点を結ぶ線分上の各画素の座標
値を算出すると同時に、注目画素をP、その1つ前の画
素をP−、その1つ後の画素をP+とし、P−→Pの方
向CH1とP→P+の方向CH2を第3図に示すフリーマンの
チェイン符号(0〜7)で表わす。
At the same time as calculating the coordinate value of each pixel on the line segment connecting the two vertices of the vertex coordinate list, the target pixel is P, the previous pixel is P−, the next pixel is P +, and P− → The direction CH1 of P and the direction CH2 of P → P + are represented by Freeman chain codes (0 to 7) shown in FIG.

方向CH1と方向CH2の組み合わせから第4図(a)の表
によって画素Pの有する画素状態値(0,1,2)を決定
し、この画素状態値に対応した処理を行う。
The pixel state value (0, 1, 2) of the pixel P is determined from the combination of the direction CH1 and the direction CH2 according to the table of FIG. 4A, and processing corresponding to the pixel state value is performed.

画素状態値0の時は何もしない。 When the pixel state value is 0, nothing is performed.

画素状態値1の時は画素Pを特異画素(極大点,極小
点)とする。
When the pixel state value is 1, the pixel P is a singular pixel (maximum point, minimum point).

画素状態値2の時は画像メモリ上の画素Pの値を調
べ、画素値「0」の場合は画素値「1」を書き込み、画
素値「1」の場合は画素値「0」を書き込むと同時に画
素Pを特異画素(境界線の重なった点)とする。
When the pixel state value is 2, the value of the pixel P in the image memory is checked, and when the pixel value is “0”, the pixel value “1” is written, and when the pixel value is “1”, the pixel value “0” is written. At the same time, the pixel P is set as a peculiar pixel (a point where the boundary line overlaps).

次に、画素メモリを水平方向に走査し、奇数番目の画
素値「1」の画素から偶数番目の画素値「1」の画素ま
で画素値「1」の埋め込みを行う。
Next, the pixel memory is scanned in the horizontal direction, and the pixel value “1” is embedded from the odd-numbered pixel value “1” to the even-numbered pixel value “1”.

最後に特異画素について、画像メモリ上の対応する座
標位置に画素「1」を書き込む。
Finally, the pixel “1” is written at the corresponding coordinate position on the image memory for the unique pixel.

<実施例> 第1図に本発明を実施したディジタル画像の復元装置
の構成ブロック図を表わす。
<Embodiment> FIG. 1 is a block diagram showing the configuration of a digital image restoration apparatus embodying the present invention.

この図において、1はホスト計算機に接続するホスト
計算機インターフェイス、2はホスト計算機インターフ
ェイス1から頂点座標リスト、コマンド等のデータが書
き込まれるセグメント・バッファ、3はセグメント・バ
ッファ2より頂点座標リスト上の連続する2頂点を結ぶ
線分を形成する座標値を発生する線分発生部、4は線分
発生部3からの座標値を順次入力して現在の注目画素の
座標値とその前後の画素の座標値から現在の注目画素の
画素状態値を生成する画素状態値生成部、5は画素状態
値生成部4から現在の注目画素の座標値とその画素状態
値を入力して全体の制御及びディジタル画像の復元処理
を実行するコントローラ、6はCRTモニタ等に表示する
ために復元すべきディジタル画像を格納するための画像
メモリ、7は復元処理に必要な一時的なデータを格納す
るメモリである。
In this figure, 1 is a host computer interface connected to the host computer, 2 is a segment buffer in which data such as a vertex coordinate list and a command is written from the host computer interface 1, and 3 is a sequence buffer on the vertex coordinate list from the segment buffer 2. A line generation unit for generating a coordinate value forming a line segment connecting two vertices to input the coordinate values from the line generation unit 3 sequentially, and the coordinate value of the current pixel of interest and the coordinates of the pixels before and after it The pixel state value generator 5 for generating the pixel state value of the current pixel of interest from the value receives the coordinate value of the current pixel of interest and its pixel state value from the pixel state value generator 4 and performs overall control and digital image processing. Is a controller for executing the restoration processing of the image, 6 is an image memory for storing a digital image to be restored for display on a CRT monitor or the like, and 7 is a restoration processing. A memory for storing temporary data required.

尚、画像メモリ6は1ビット/1画素で画素値「1」=
黒、画素値「0」=白とする。また、コントローラ5
は、画像メモリ6に対しては処理対象となる画素にリー
ド/ライト・アクセスし、必要に応じて画素値変換を行
い、メモリ7に対してはリード/ライト・アクセス可能
である。
The image memory 6 has a pixel value “1” = 1 bit / 1 pixel.
Black, pixel value “0” = white. The controller 5
Read / write access to a pixel to be processed is performed on the image memory 6, pixel value conversion is performed as necessary, and read / write access is possible to the memory 7.

第2図は画素状態値生成部4の詳細ブロック図であ
る。
FIG. 2 is a detailed block diagram of the pixel state value generation unit 4.

線分発生部3から発生する座標値(X,Y)は同期クロ
ックCLにより順次レジスタ41(P+),42(P),43(P
−)へと転送される。第1の符号生成部44では現在の画
素Pの座標値と1つ前の画素P−の座標値から決定され
る方向を表わす符号値CH1(3ビット)が出力され、第
2の符号生成部45では現在の画素Pの座標値と1つ後の
画素P+の座標値から決定される方向を表わす符号値CH
2(3ビット)が出力される。ROM46はCH1,CH2の計6ビ
ットのアドレス入力(RA1,RA2)に従って予め定められ
ている画素状態値S(2ビット)を出力する。レジスタ
47は第1の符号生成部44から最初に出力された方向CH1
を保持するものである。セレクタ48はレジスタ47の出力
と第2の符号生成部45の出力(CH2)を切り換えるもの
であり、通常は第2の符号生成部45の出力(CH2)を選
択している。
The coordinate values (X, Y) generated from the line segment generating unit 3 are sequentially stored in registers 41 (P +), 42 (P), 43 (P
Forwarded to-). The first code generation unit 44 outputs a code value CH1 (3 bits) indicating a direction determined from the coordinate value of the current pixel P and the coordinate value of the immediately preceding pixel P−, and outputs the code value CH1 (3 bits). At 45, a code value CH representing a direction determined from the coordinate value of the current pixel P and the coordinate value of the next pixel P +
2 (3 bits) is output. The ROM 46 outputs a predetermined pixel state value S (2 bits) according to a total of 6-bit address inputs (RA1 and RA2) of CH1 and CH2. register
47 is the direction CH1 first output from the first code generation unit 44.
Is held. The selector 48 switches between the output of the register 47 and the output (CH2) of the second code generation unit 45, and normally selects the output (CH2) of the second code generation unit 45.

尚、ROM46には第4図(b)に示すように、第1の符
号生成部44の出力CH1(RA1;3ビット)及び第2の符号生
成部45の出力CH2(RA2;3ビット)の計6ビット・アドレ
スA5(MSB),…,A0(LSB)に従って、第4図(a)に
対応して、予め画素状態値0,1,2の64通りのデータが格
納されている。
As shown in FIG. 4 (b), the ROM 46 stores the output CH1 (RA1; 3 bits) of the first code generator 44 and the output CH2 (RA2; 3 bits) of the second code generator 45. According to a total of 6-bit addresses A5 (MSB),..., A0 (LSB), 64 data of pixel state values 0, 1, and 2 are stored in advance corresponding to FIG.

さて、以上のように構成された本発明装置の動作を第
5図のフローチャートによって説明する。
Now, the operation of the apparatus of the present invention configured as described above will be described with reference to the flowchart of FIG.

尚、この説明で対象とするディジタル画像は第7図、
その境界線図形は第8図に示したものとし、頂点座標リ
ストは前述の式(1)を用いる。
It should be noted that the digital images targeted in this description are shown in FIG.
The boundary graphic is shown in FIG. 8, and the above-mentioned equation (1) is used for the vertex coordinate list.

はじめに、ホスト計算機はホスト計算機インターフェ
イス1を経由してセグメント・バッファ2に式(1)に
示される頂点座標リストを書き込むと同時に、コマンド
を書き込んでコントローラ5に復元処理の起動をかけ
る。
First, the host computer writes the vertex coordinate list shown in the equation (1) to the segment buffer 2 via the host computer interface 1 and at the same time writes a command to activate the controller 5 for restoration processing.

(イ)コントローラ5は画像メモリ6を全てクリア(画
素値「0」を書き込む)する。
(A) The controller 5 clears the entire image memory 6 (writes the pixel value “0”).

(ロ)線分発生部3はセグメント・バッファ2より境界
線#1の頂点座標リスト上の第1番目の頂点P11(8,1)
と第2番目の頂点P12(8,3)を読み出し、この2個の頂
点を結ぶ線分を発生する座標値(8,1),(8,2),(8,
3)を算出して順次画素状態値生成部4へ送信する。
(B) The line segment generator 3 outputs the first vertex P 11 (8,1) on the vertex coordinate list of the boundary line # 1 from the segment buffer 2
And the second vertex P 12 (8,3), and the coordinate values (8,1), (8,2), (8,2) that generate a line segment connecting these two vertices
3) is calculated and sequentially transmitted to the pixel state value generation unit 4.

画素状態値生成部4では、上記の座標値を線分発生部
33からのクロックCLによりレジスタ41,42,43にシリアル
に取り込む。即ち、レジスタ43(P−)には座標値(8,
1)、レジスタ42(P)には座標値(8,2)、レジスタ41
(P+)には座標値(8,1)がセットされる。
The pixel state value generation unit 4 converts the coordinate values into a line segment generation unit.
The data is serially taken into the registers 41, 42, and 43 by the clock CL from 33. In other words, the coordinate value (8,
1) The coordinate value (8, 2) is stored in the register 42 (P),
The coordinate value (8, 1) is set in (P +).

第1,第2の符号生成部44,45により、第3図の符号に
従い、それぞれ方向CH1=6,CH2=6が算出される。
The directions CH1 = 6 and CH2 = 6 are calculated by the first and second code generation units 44 and 45, respectively, according to the codes in FIG.

方向CH1,CH2は併せてROM46への6ビット・アドレス
(110110=#36)として与えられ、ROM46からは画素状
態値S=2が出力される。画素状態値S=2はレジスタ
42の座標値P(8,2)(現在の注目画素)とともにコン
トローラ5へ送信される。
The directions CH1 and CH2 are given together as a 6-bit address (110110 = # 36) to the ROM 46, and the ROM 46 outputs a pixel state value S = 2. Pixel state value S = 2 is a register
The coordinates are transmitted to the controller 5 together with the 42 coordinate values P (8,2) (current target pixel).

ここで、画素状態値2,1,0に対応するコントローラ5
の一般的な動作を説明する。
Here, the controller 5 corresponding to the pixel state values 2, 1, 0
The general operation of will be described.

(ハ)−(1)画素状態値S=2の場合は次の処理を実
行する。画素状態値S=2の時は注目画素Pが境界線の
重なり点の可撓性がある場合である。
(C)-(1) When the pixel state value S = 2, the following processing is executed. When the pixel state value S = 2, the target pixel P has flexibility at the overlapping point of the boundary line.

(ニ)コントローラ5は画像メモリ6上の注目画素の座
標値(X,Y)の画素値を調べる。
(D) The controller 5 checks the pixel value of the coordinate value (X, Y) of the target pixel on the image memory 6.

(ホ)画素値「0」の場合は(ヘ)の処理を行う。(E) If the pixel value is "0", the processing of (f) is performed.

(ヘ)画像メモリ6上の対応する座標値に画素値「1」
を書き込む。
(F) The pixel value "1" is set to the corresponding coordinate value on the image memory 6.
Write.

(ト)(ホ)において、画素値「0」でない場合は画像
メモリ6上の対応する座標値に画素値「0」を書き込
む。
(G) In (e), if the pixel value is not “0”, the pixel value “0” is written to the corresponding coordinate value on the image memory 6.

(チ)この注目画素Pを特異画素(境界線の重なり点)
としてその座標値(X,Y)をメモリ7に記憶する。
(H) This pixel of interest P is a unique pixel (overlapping point of the boundary line)
And the coordinate value (X, Y) is stored in the memory 7.

(ハ)−(2)画像状態値S=1の場合は、注目画素P
が極大点または極小点であるので、(チ)の処理を実行
し、注目画素Pを特異画素としてその座標値(X,Y)を
メモリ7に記憶する。
(C)-(2) When the image state value S = 1, the target pixel P
Is a local maximum point or a local minimum point, the processing of (h) is executed, and the coordinate value (X, Y) is stored in the memory 7 with the pixel of interest P as a singular pixel.

(ハ)−(3)画像状態値S=0の場合は連続する線分
を構成する画素の一点であるので、何も処理を行わな
い。
(C)-(3) If the image state value S = 0, it is a point of a pixel constituting a continuous line segment, and no processing is performed.

さて、今説明している例にあっては、画素状態値S=
2でありかつ画像メモリ6上で(8,2)=0であるた
め、画像メモリ6上の座標値(8,2)に画素値「1」を
書き込む。
By the way, in the example just described, the pixel state value S =
2 and (8,2) = 0 on the image memory 6, the pixel value “1” is written to the coordinate value (8,2) on the image memory 6.

更に、レジスタ47には方向CH1の初期値6がセットさ
れる。また、セレクタ48は通常A入力が指定される。
Further, the initial value 6 of the direction CH1 is set in the register 47. In addition, the selector 48 is normally designated with an A input.

(リ)全頂点座標リストに対して処理がまだ終了してい
ないため、処理(ロ)に戻る。
(I) Since the processing has not been completed for all the vertex coordinate lists, the processing returns to (b).

線分発生部3はセグメント・バッファ2より第3番目
の頂点P13(7,4)を読み出して先の頂点P12(8,3)と結
ぶ線分を形成する座標値(7,4)を算出し(始点(8,3)
を除く)、画素状態値生成部4へ送信する。
The line segment generating unit 3 reads the third vertex P 13 (7,4) from the segment buffer 2 and calculates the coordinate values (7,4) forming the line segment connected to the previous vertex P12 (8,3). Calculate (Start point (8,3)
), And transmits it to the pixel state value generation unit 4.

画素状態値生成部4ではこの点(7,4)をレジスタ41
(P+)にセットする。ここで、1つ前のレジスタ41
(P+)の内容はレジスタ42(P)に、レジスタ42
(P)の内容はレジスタ43(P−)に転送される。従っ
て、レジスタ43(P−)に(8,2)、レジスタ42(P)
に(8,3)、レジスタ41(P+)に(7,4)がセットされ
る。そして、第1の符号生成部44からは方向CH1=6、
第2の符号生成部45からは方向CH2=5が出力され、ROM
46から画素状態値S=2、座標値(8,3)がコントロー
ラ5へ送信される。
The pixel state value generation unit 4 stores this point (7, 4) in the register 41.
Set to (P +). Here, the previous register 41
The contents of (P +) are stored in register 42 (P),
The contents of (P) are transferred to the register 43 (P-). Therefore, (8, 2) is added to the register 43 (P-), and the register 42 (P)
(8, 3) and (7, 4) in the register 41 (P +). Then, the direction CH1 = 6 from the first code generation unit 44,
The direction CH2 = 5 is output from the second code generator 45, and the ROM
From 46, the pixel state value S = 2 and the coordinate value (8,3) are transmitted to the controller 5.

画像メモリ6上で(8,3)=0であるため、画像メモ
リ6上の座標値(8,3)に画素値「1」を書き込む。
Since (8,3) = 0 on the image memory 6, the pixel value “1” is written to the coordinate value (8,3) on the image memory 6.

次に、線分発生部3は、セグメント・バッファ2より
第4番目の頂点P14(6,4)を読み出し、先の頂点P13
(7,4)と結ぶ線分を形成する座標値(6,4)を算出し
(始点(7,4)を除く)、画素状態値生成部4へ送信す
る。これにより、レジスタ43(P−)には(8,3)、レ
ジスタ42(P)には(7,4)、レジスタ41(P+)には
(6,4)がセットされ、方向CH1=5,CH2=4が算出され
る。このとき画素状態値S=0と座標値(7,4)がコン
トローラ5に送信される。画素状態値S=0であるた
め、コントローラ5は画素メモリ6に対して処理を行わ
ない。
Next, the line segment generator 3 reads the fourth vertex P 14 (6, 4) from the segment buffer 2 and
The coordinate value (6, 4) forming a line segment connected to (7, 4) is calculated (excluding the start point (7, 4)) and transmitted to the pixel state value generation unit 4. As a result, (8, 3) is set in the register 43 (P-), (7, 4) is set in the register 42 (P), and (6, 4) is set in the register 41 (P +). , CH2 = 4. At this time, the pixel state value S = 0 and the coordinate value (7, 4) are transmitted to the controller 5. Since the pixel state value S = 0, the controller 5 does not perform processing on the pixel memory 6.

以下同様にして境界線#1の頂点座標リスト上の第32
番目の頂点P132(8,3)までを読み出し、処理した際の
画像メモリ6の画素の状態を第6図(a)に表わす。
In the same manner, the 32nd on the vertex coordinate list of the boundary line # 1
FIG. 6 (a) shows the state of the pixels in the image memory 6 at the time of reading and processing up to the vertices P 132 (8, 3).

次に、境界線#1の頂点座標リストの最後の頂点P133
(8,1)を読み出し、1つ前の頂点P132(8,3)と結ぶ線
分を形成する座標値(8,2),(8,1)を算出し(始点
(8,3)を除く)、画素状態値生成部4へ転送する。
Next, the last vertex P 133 of the vertex coordinate list of the boundary line # 1
(8,1) is read out, and coordinate values (8,2) and (8,1) forming a line segment connected to the immediately preceding vertex P 132 (8,3) are calculated (starting point (8,3) ), And transfers it to the pixel state value generation unit 4.

画素状態値生成部4では、レジスタ43(P−)には
(9,4)、レジスタ42(P)には(8,3)、レジスタ41
(P+)に(8,2)がセットされ、方向CH1=3,CH2=2
となり、画素状態値S=2及び座標値(8,3)がコント
ローラ5へ送信される。
In the pixel state value generator 4, (9, 4) is set in the register 43 (P-), (8, 3) is set in the register 42 (P), and the register 41 is set.
(P +) is set to (8,2), and the direction CH1 = 3, CH2 = 2
, And the pixel state value S = 2 and the coordinate value (8,3) are transmitted to the controller 5.

画像メモリ6上で(8,3)=「1」であるため、(8,
3)に画素値「0」を書き込み、座標値(8,3)をメモリ
7に特異画素として記憶する。
Since (8,3) = "1" on the image memory 6, (8,3)
The pixel value “0” is written in 3), and the coordinate value (8, 3) is stored in the memory 7 as a unique pixel.

次にレジスタ43(P−)には(8,3)、レジスタ42
(P)には(8,2)、レジスタ41(P+)には(8,1)が
セットされ、このときは画素状態値S=2であり、画像
メモリ6の(8,2)に画素値「0」を書き込み、座標値
(8,3)を特異画素としてメモリ7に記憶する。
Next, (8, 3) is added to the register 43 (P−),
(P) is set to (8,2) and the register 41 (P +) is set to (8,1). At this time, the pixel state value S = 2, and the pixel is stored in (8,2) of the image memory 6. The value “0” is written, and the coordinate value (8, 3) is stored in the memory 7 as a unique pixel.

更に、レジスタ43(P−)には(8,2)、レジスタ42
(P)には(8,1)がセットされる。このとき、レジス
タ41(P+)にセットすべき頂点座標はないので、この
レジスタ41の内容は不定である。ここで、第1の符号生
成部44からは方向CH1=2が出力され、セレクタ48はB
入力即ちレジスタ47に保持していた値を選択し、方向CH
2=6を出力する。従って、画素状態値S=1となり、
注目画素Pの座標値(8,1)が特異画素としてメモリ7
に記憶される。
Further, (8, 2) is added to the register 43 (P−),
(8) is set in (P). At this time, since there is no vertex coordinate to be set in the register 41 (P +), the contents of this register 41 are undefined. Here, the direction CH1 = 2 is output from the first code generation unit 44, and the selector 48
Input, that is, the value held in the register 47 is selected, and the direction CH
2 = 6 is output. Therefore, the pixel state value S = 1, and
The coordinate value (8, 1) of the target pixel P is stored in the memory 7 as a unique pixel.
Is stored.

これにより、境界線#1の頂点座標リストの処理が終
了する。
Thus, the processing of the vertex coordinate list of the boundary line # 1 ends.

以上同様にして境界線#2、境界線#3の頂点座標リ
ストの処理を行う。
In the same manner as described above, the processing of the vertex coordinate list of the boundary line # 2 and the boundary line # 3 is performed.

その終了結果を第6図(b)に示す。 FIG. 6 (b) shows the end result.

この段階で特異画素(図中画素 )として、その座標(23,6),(8,3),(8,2),(8,
1),(6,9),(6,8),(19,8),(18,9),(21,
9),(21,10)の10個のメモリ7に記憶されている。
At this stage, the unique pixels (pixels in the figure) ), The coordinates (23,6), (8,3), (8,2), (8,
1), (6,9), (6,8), (19,8), (18,9), (21,
9), (21, 10) are stored in the ten memories 7.

この時点にあって、画像メモリ6上の処理結果は第6
図(c)の通りである。
At this point, the processing result on the image memory 6 is the sixth
This is as shown in FIG.

(ヌ)コントローラ5は、画像メモリ6を左上よりラス
タ走査し、水平方向の画素値を調べ、奇数番目の画素値
「1」の画素から偶数番目の画素値「1」の画素まで画
素値「1」の埋め込みを行う。
(5) The controller 5 raster-scans the image memory 6 from the upper left, checks the pixel values in the horizontal direction, and determines the pixel values “from the odd-numbered pixel value“ 1 ”to the even-numbered pixel value“ 1 ”. 1 ”is embedded.

(ル)コントローラ5は全走査線についてこの埋め込み
走査を行い、その結果を第6図(d)に表わす。
(G) The controller 5 performs this embedded scanning for all the scanning lines, and the result is shown in FIG. 6 (d).

次に、コントローラ5はメモリ7より特異画素の座標
値を順次読み出し、画像メモリ6上の対応する座標位置
に画素値「1」を書き込む(第6図(e))。
Next, the controller 5 sequentially reads the coordinate values of the specific pixels from the memory 7 and writes the pixel value “1” at the corresponding coordinate position on the image memory 6 (FIG. 6 (e)).

このようにして、与えられた頂点座標リスト(式
(1))により、第6図(f)に示すように、もとのデ
ィジタル画像が画像メモリ6上に復元できる。
In this way, the original digital image can be restored on the image memory 6 according to the given vertex coordinate list (Equation (1)), as shown in FIG.

以上述べたディジタル画像の復元方式では、頂点座標
リストとして式(1)に示すように、絶対座標形式によ
る場合を例にして説明したが、以下のように、始点座標
と相対座標(ベクトル)形式で与えられた場合も同様に
扱うことができる。
In the above-described digital image restoration method, the case of using the absolute coordinate format as the vertex coordinate list as shown in Expression (1) has been described as an example. However, the starting point coordinates and the relative coordinate (vector) format are described below. Can be treated in the same way.

境界線#iの頂点座標リスト= {総ベクトル数m|始点Pis(Xis,Yis)| ΔVi1(ΔXi1,ΔYi1),ΔVi2(ΔXi2,ΔYi2),… …,ΔVim(ΔXim,ΔYim)} 式(1)との対応は、 となる。Vertex coordinate list of boundary line # i = {total vector number m | start point P is (X is , Y is ) | ΔV i1 (ΔX i1 , ΔY i1 ), ΔV i2 (ΔX i2 , ΔY i2 ), ..., ΔV im (ΔX im , ΔY im )} The correspondence with equation (1) is Becomes

また、上述の説明にあっては、画素状態値が“1"の場
合または画素状態値が“2"でかつ画像メモリ6上の画素
値が「1」の場合に、注目画素を特異画素としてメモリ
7に一旦記憶し、最後にこれを読み出して画像メモリ6
上の対応する座標位置に画素値「1」を書き込む処理を
行っているが、特異画素の座標値をメモリ7に記憶せず
に、最後に頂点座標リストから連続する2頂点を結ぶ線
分を画像メモリ6上に画素値「1」を用いて再描画して
も良い。これによって、復元手順が簡単になり、メモリ
7が不要となる。
In the above description, when the pixel state value is “1” or when the pixel state value is “2” and the pixel value on the image memory 6 is “1”, the pixel of interest is set as a singular pixel. The image data is temporarily stored in the memory 7 and finally read out from the image memory 6.
Although the process of writing the pixel value “1” to the corresponding coordinate position above is performed, the line connecting the two consecutive vertices from the vertex coordinate list is finally stored without storing the coordinate value of the unique pixel in the memory 7. The image may be redrawn on the image memory 6 using the pixel value “1”. This simplifies the restoration procedure and makes the memory 7 unnecessary.

更に、本発明による復元装置による方式は、原画像に
対して平行移動、回転、拡大、縮小、傾斜等の操作を施
して復元する場合にも応用することができる。具体的に
は、元の頂点座標リストの各頂点座標リストの各頂点座
標に対して、いわゆるアフィン交換処理を行って新たな
頂点座標リストを作成し、その頂点座標リストに対して
本発明装置を適用することにより、実現できる。
Further, the method using the restoration apparatus according to the present invention can be applied to a case where an original image is restored by performing operations such as translation, rotation, enlargement, reduction, and inclination. Specifically, a so-called affine exchange process is performed on each vertex coordinate of each vertex coordinate list of the original vertex coordinate list to create a new vertex coordinate list, and the present invention device is applied to the vertex coordinate list. It can be realized by applying.

<発明の効果> 本発明のディジタル画像の復元装置にあっては、復元
すべきディジタル画像を格納するための1ビット/1画素
の容量を持つ画像メモリを設け、与えられた頂点座標リ
スト上の連続する2頂点間を結ぶ線分を形成する座標値
を生成し、その各々を注目画素としてその前後の画素の
座標値とから求められる現在の画素状態値と、画像メモ
リ上の対応する座標位置の画素値を用いて極大点、極小
点及び境界線どうしの重なり部分を特異画素として事前
に検出し、これらの点を最後に再描画しているため、画
像メモリを順次ラスタ走査し、水平走査線が図形の境界
線と交差して、次に交差するまでの間を黒く塗り潰すと
いう単純な操作で頂点座標リストから原画像を高速に復
元することができる。
<Effect of the Invention> In the digital image restoration apparatus of the present invention, an image memory having a capacity of 1 bit / 1 pixel for storing the digital image to be restored is provided, A coordinate value forming a line segment connecting two consecutive vertexes is generated, each of which is a target pixel, a current pixel state value obtained from the coordinate values of pixels before and after the target pixel, and a corresponding coordinate position on the image memory. Because the maximum value, the minimum value, and the overlapping portion between the boundary lines are detected as unique pixels in advance using these pixel values, and these points are finally redrawn, the image memory is sequentially raster-scanned and horizontally scanned. The original image can be restored at high speed from the vertex coordinate list by a simple operation in which the line intersects the boundary of the figure and is blacked out until the next intersection.

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

第1図は本発明を実施したディジタル画像の復元装置の
構成を表わすブロック図、第2図は第1図に示した本発
明装置の画素状態値生成部4の詳細を表わす図、第3図
はフリーマンのチェイン符号を表わす図、第4図
(a),(b)は座標値の位置関係と画素状態値との対
応を表わす表、第5図は本発明装置の動作を表わすフロ
ーチャート、第6図(a),(b),(c),(d),
(e),(f)は本発明装置を用いてディジタル画像を
復元する際の状態遷移図、第7図は本発明が対象とする
ディジタル画像の図、第8図は第7図に表わすディジタ
ル画像の境界線図、第9図は画像メモリ内の座標の定義
図、第10図は従来のディジタル画像の復元方式を説明す
るための図である。 1……ホスト計算機インターフェイス、 2……セグメント・バッファ、3……線分発生部、 4……画素状態値生成部、 41,42,43,47……レジスタ、 44……第1の符号生成部、 45……第2の符号生成部、46……ROM、 48……セレクタ。
FIG. 1 is a block diagram showing the configuration of a digital image restoration device embodying the present invention, FIG. 2 is a diagram showing details of a pixel state value generator 4 of the device of the present invention shown in FIG. 1, and FIG. FIG. 4A is a diagram showing a Freeman chain code, FIGS. 4A and 4B are tables showing the correspondence between the positional relationship of coordinate values and pixel state values, FIG. 5 is a flowchart showing the operation of the apparatus of the present invention, FIG. 6 (a), (b), (c), (d),
(E) and (f) are state transition diagrams when restoring a digital image using the apparatus of the present invention, FIG. 7 is a diagram of a digital image to which the present invention is applied, and FIG. 8 is a digital diagram shown in FIG. FIG. 9 is a definition diagram of coordinates in an image memory, and FIG. 10 is a diagram for explaining a conventional digital image restoration method. 1 ... host computer interface 2 ... segment buffer 3 ... line segment generator 4 ... pixel state value generator 41, 42, 43, 47 ... register 44 ... first code generation Unit, 45... Second code generation unit, 46... ROM, 48.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ホスト計算機よりディジタル画像の境界線
を形成する頂点座標リスト及びコマンドが書き込まれる
セグメント・バッファと、 前記頂点座標リスト上の連続する2頂点を結ぶ線分を形
成する座標値を算出する線分発生部と、 この線分発生部より算出された座標値を順次入力して現
在の注目画素の座標値とその前後の画素の座標値の位置
関係より前記注目画素に対応する画素状態値を、現在の
注目画素が境界線の重なり点の可能性を有するときは
“2"、現在の注目画素が極大点または極小点であるとき
は“1"、現在の注目画素が連続する線分を構成する点で
あるときは“0"としその座標値とともに出力する画素状
態値生成部と、 この画素状態値とその座標値を入力し、 予め画像メモリをクリアする処理と、 前記画素状態値が“0"の場合は何もせず、 前記画素状態値が“1"の場合、及び前記画素状態値が
“2"でかつ前記画像メモリ上の画素値が「1」の場合に
注目画素を特異画素として検出し、 前記画素状態値が“2"でかつ前記画像メモリ上の画素
値が「0」の場合に前記画像メモリの対応する位置に画
素値「1」を書き込み、 前記画像メモリをラスタ走査して奇数番目の画素値
「1」を有する画素から偶数番目の画素値「1」を有す
る画素まで画素値「1」を書き込み、 前記特異画素に画素値「1」を書き込む処理 を行うコントローラと とからなるディジタル画像の復元装置。
1. A segment buffer into which a vertex coordinate list and a command forming a boundary line of a digital image are written from a host computer, and a coordinate value forming a line segment connecting two consecutive vertices on the vertex coordinate list are calculated. And a pixel state corresponding to the pixel of interest based on the positional relationship between the current coordinate value of the pixel of interest and the coordinate values of pixels before and after the coordinate value calculated by the line segment generation unit. The value is "2" if the current pixel of interest has the possibility of a boundary overlapping point, "1" if the current pixel of interest is a local maximum or a local minimum, a line where the current pixel of interest is continuous A pixel state value generation unit that sets the pixel state value to “0” when the point constitutes a minute, and outputs the pixel state value and its coordinate value; a process of inputting the pixel state value and its coordinate value to clear the image memory in advance; When the value is “0” If the pixel state value is “1” and the pixel state value is “2” and the pixel value in the image memory is “1”, the target pixel is detected as a singular pixel. When the pixel state value is “2” and the pixel value on the image memory is “0”, a pixel value “1” is written to a corresponding position in the image memory, and the image memory is raster-scanned and an odd number is written. A controller that writes a pixel value “1” from a pixel having a pixel value “1” to a pixel having an even-numbered pixel value “1”, and writes the pixel value “1” to the unique pixel. Digital image restoration device.
JP13414488A 1988-05-31 1988-05-31 Digital image restoration device Expired - Lifetime JP2575047B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13414488A JP2575047B2 (en) 1988-05-31 1988-05-31 Digital image restoration device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13414488A JP2575047B2 (en) 1988-05-31 1988-05-31 Digital image restoration device

Publications (2)

Publication Number Publication Date
JPH01303584A JPH01303584A (en) 1989-12-07
JP2575047B2 true JP2575047B2 (en) 1997-01-22

Family

ID=15121497

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13414488A Expired - Lifetime JP2575047B2 (en) 1988-05-31 1988-05-31 Digital image restoration device

Country Status (1)

Country Link
JP (1) JP2575047B2 (en)

Also Published As

Publication number Publication date
JPH01303584A (en) 1989-12-07

Similar Documents

Publication Publication Date Title
EP0356103B1 (en) Scan-conversion process and processor
EP0360155B1 (en) Image transformation method and device
GB2174278A (en) Area-fill graphic image processing system
US6215501B1 (en) Method and filling a polygon and recording medium
JP2634851B2 (en) Image processing device
JP2575047B2 (en) Digital image restoration device
JPS634380A (en) Computer graphic processor
JPS63305478A (en) Pattern information restoring device
KR100254066B1 (en) Method of producing polygon data, image processor to which the method is applied, and expanded function board
JP2930599B2 (en) Graphic vectorization processing method and apparatus
JP3129717B2 (en) Image processing apparatus and image processing method
JP4214644B2 (en) 2D pattern generator
JPH0431399B2 (en)
JP4214643B2 (en) Two-dimensional pattern generation method and apparatus
KR900008306B1 (en) Method for filling polygon using masking pattern
JPH07152920A (en) Graphic processor and its method
JP2932664B2 (en) 1-pass type figure shape feature quantity calculation device
JPS6160177A (en) Method of drawing thick segment
JPH0245889A (en) Area painting out method
JPS63314591A (en) Smearing image generation system
JPH03222077A (en) Contour paint-out circuit
JPH03269773A (en) Picture element/vector converter and converting method
JPH0391881A (en) Character and graphic generating device
JPH01205388A (en) Generation system for high quality character and graphic or the like
JP2000222569A (en) Plotter