JPS60163164A - Smear-out device of picture - Google Patents

Smear-out device of picture

Info

Publication number
JPS60163164A
JPS60163164A JP59017357A JP1735784A JPS60163164A JP S60163164 A JPS60163164 A JP S60163164A JP 59017357 A JP59017357 A JP 59017357A JP 1735784 A JP1735784 A JP 1735784A JP S60163164 A JPS60163164 A JP S60163164A
Authority
JP
Japan
Prior art keywords
storage means
pixel
contents
polygon
fish
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
JP59017357A
Other languages
Japanese (ja)
Other versions
JPH061493B2 (en
Inventor
Hajime Kawakami
肇 川上
Shuichi Yahiro
八尋 秀一
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.)
NEC Corp
Original Assignee
NEC Corp
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp, Nippon Electric Co Ltd filed Critical NEC Corp
Priority to JP59017357A priority Critical patent/JPH061493B2/en
Publication of JPS60163164A publication Critical patent/JPS60163164A/en
Publication of JPH061493B2 publication Critical patent/JPH061493B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

PURPOSE:To complete smear out of a picture with one main scanning by tracing respectively a closed polygonal shape picture clockwise and counter-clockwise, generating an initial point group of smear out and inputting/outputting the point group while referencing a profile line. CONSTITUTION:A profile line generating means 215 traces an apex of a closed polygonal picture representing the content of a polygonal storage means 200 and writes a value 1 to a picture element to which a line segment deciced by two apexes among picture elements of a profile line storage means 245. Then a forward inner line generating means 205 and a reverse inner line generating means 210 trace respectively an apex of the closed polygonal picture to calculate a vector of each side, traces forward or reverse a vector group, finds out a vector whose y-axis component is negative and writes a value 1 to the picture element. A summing point group generating means 230 writes a value 1 to a region storage means 235 when any of picture elements is 1. A condition transfer means 240 traces picture elements in the x direction, references the content of the profile line storage means 245 to decide the content of the region storage means 235.

Description

【発明の詳細な説明】 (技術分野) 本発明は画像の塗りつぶし装置、特にディジタル画像で
表現された図形から前記図形が囲むすべての画素に同一
の色を彩色したディジタル画像を生成する時などに必要
なディジタル画像の塗りつぶし装置に関する。
DETAILED DESCRIPTION OF THE INVENTION (Technical Field) The present invention relates to an image filling device, particularly when generating a digital image from a figure expressed in a digital image in which all pixels surrounded by the figure are colored with the same color. This invention relates to a necessary digital image filling device.

(従来技術〉 与えられた図形から該図形が囲む画素に同一の色を彩色
したディジタル画像を生成する従来の方式を例えば第1
図(a)に示す図形1より同図(b)の2に示すぬりつ
ぶし図形を得る時に応用する場合、まず第1段階として
第2図(a)に例示する種となる画素50を前記図形の
例えばラスタ1ooに与えて彩色し、第2段階として前
記画素50から出発してラスタ100 をX軸方向に主
走査して画素をたどり、前記図形の輪郭線が通過する画
素でなく。
(Prior art) For example, the conventional method of generating a digital image from a given figure in which the pixels surrounded by the figure are colored with the same color is
When applied to obtain the filled figure shown in figure 2 in figure (b) from figure 1 shown in figure (a), first, as a first step, the seed pixel 50 illustrated in figure 2 (a) is extracted from the figure. For example, the raster 100 is given color and colored, and as a second step, starting from the pixel 50, the raster 100 is main scanned in the X-axis direction to trace the pixels, not the pixels through which the outline of the figure passes.

且つ上下左右に隣接する画素のいずれかが彩色されてい
れば注目画素を彩色する処理を行ない、第2図(blに
示す結果を得、第3段階として前記画素50から出発し
てラスタ100 を負のX軸方向に主走査して上記処理
を行ない、第2図(C1に示す結果を併、以上の処理全
前記ラスタ100からy軸方向に副走査して、次に負の
y軸方向に副走査し第2図(dlの塗りつぶし結果のデ
ィジタル画像を得ていた。
In addition, if any of the pixels adjacent to the top, bottom, left, or right are colored, the pixel of interest is colored, and the result shown in FIG. The above processing is performed by main scanning in the negative X-axis direction, and the results shown in FIG. A digital image of the filling result of dl was obtained by sub-scanning the image in Fig. 2 (dl).

しかしながら、このような画像の塗りつぶし方式では複
数回の走査が必要となる欠点があった。
However, such an image filling method has the drawback of requiring multiple scans.

(発明の目的) 本発明の目的は1回の主走査で画像の塗りつぶしを完了
する画像塗りつぶし製麹を提供するととである。
(Object of the Invention) An object of the present invention is to provide an image-filling koji-making process that completes filling of an image in one main scan.

(発明の構成) 本発明によれば、塗りつぶしを行なう閉多角形ディジタ
ル画像を記憶する多角形記憶手段と、該多角形記憶手段
の内容が表わす閉多角形画像を構成する複数個の辺を時
計回りにたどり塗りつぶしの初期点群を生成する順方向
内線生成手段と、該順方向内線生成手段が生成する魚群
を記憶する順方向内線記憶手段と、前記多角形記憶手段
の内容が表わす閉多角形画像を構成する複数個の辺を反
時計回りにたどり塗りつぶしの初期点群を生成する逆方
向内線生成手段と、該逆方向内線生成手段が生成する魚
群を記憶する逆方向内線記憶手段と、前記多角形記憶手
段の内容が表わす閉多角形画像の輪郭線を生成する輪郭
線生成手段と、該輪郭線生成手段が生成する輪郭線を魚
群として記憶する輪郭線記憶手段と、前記順方向内線記
憶手段の内容が表わす魚群、前記逆方向内線記憶手段の
内容が表わす魚群の和集合となる魚群を算出する利点群
生成手段と、該利点群生成手段が生成する魚群を記憶す
る領域記憶手段と、前記輪郭線記憶手段の内容が表わす
魚群を参照しながら前記領域記憶手段の内容を入出力と
するφ件転送手段を含むことを特徴とする画像塗りつぶ
し装置が得られる。
(Structure of the Invention) According to the present invention, there is provided a polygon storage means for storing a closed polygon digital image to be filled, and a plurality of sides constituting the closed polygon image represented by the contents of the polygon storage means. a forward extension generation means for generating an initial point group for filling in the surroundings; a forward extension storage means for storing a school of fish generated by the forward extension generation means; and a closed polygon represented by the contents of the polygon storage means. a backward extension generation means for tracing a plurality of sides constituting an image counterclockwise and generating an initial point group for filling; a backward extension storage means for storing a school of fish generated by the reverse extension generation means; a contour generating means for generating a contour of a closed polygon image represented by the contents of the polygon storing means; a contour storing means for storing the contour generated by the contour generating means as a school of fish; and the forward extension line storing. advantageous group generation means for calculating a fish school that is the union of the fish school represented by the contents of the means and the fish school represented by the contents of the backward extension storage means; and area storage means for storing the fish school generated by the advantageous group generation means; There is obtained an image filling device characterized in that it includes φ transfer means for inputting and outputting the contents of the area storage means while referring to the school of fish represented by the contents of the contour storage means.

(@弔/I原1!l) 以下本発明の原理を図面を参照して説明する。(@condolence/Ihara1!l) The principle of the present invention will be explained below with reference to the drawings.

第3図(a)に示す図形300を例にとると1本発明の
原理はディジタル画像において予めすべての画素をクリ
ヤしておき、次に図形300の内部で且つ前記図形の輪
郭線が通過する第3図(blに示す画素のX軸方向に隣
接する第3図(C)の斜線で示す画素群を種として彩色
し、最後に画面をX軸方向に主走査、y軸方向に副走査
して画素をたどり、若し注目画素を輪郭線が通過してい
なければ注目画素のX軸方向に隣接する画素に注目画素
の値を代入し、若し注目画素を輪郭線が通過していれば
何もせず走査を進めることにより画像の塗りつぶしを行
なうものである。
Taking the figure 300 shown in FIG. 3(a) as an example, the principle of the present invention is to clear all pixels in the digital image in advance, and then clear the inside of the figure 300 and the outline of the figure. Figure 3 (The pixel group shown with diagonal lines in Figure 3 (C) adjacent to the pixels shown in bl in the X-axis direction is colored as a seed, and the screen is finally scanned in the X-axis direction and sub-scanned in the y-axis direction. If the contour line does not pass through the pixel of interest, the value of the pixel of interest is assigned to the pixel adjacent to the pixel of interest in the X-axis direction; if the contour line does not pass through the pixel of interest, In this case, the image is filled in by scanning without doing anything.

第3図(C)の2スタ310 において上記原理に従っ
た処理を説明するために、ラスタ310を第3図(d)
に取り出して示す。第3図(d)に示すラスタ310 
において、走査を行なう前には画素322と画素326
と画素329だけが彩色されていて、他の画素はすべて
クリヤされている。走査は画素320を調べる事から始
まる。この場合画素320を輪郭線が通過しないため、
画素320 のクリヤされた値を画素321 に代入す
る処理が行なわれ。
In order to explain the processing according to the above principle in the two-star 310 in FIG. 3(C), the raster 310 is shown in FIG. 3(d).
It is taken out and shown. Raster 310 shown in FIG. 3(d)
, before scanning, pixel 322 and pixel 326
Only pixel 329 is colored, and all other pixels are cleared. The scan begins by examining pixel 320. In this case, since the contour line does not pass through pixel 320,
Processing is performed to assign the cleared value of pixel 320 to pixel 321.

走査は画素321に進む。画素321において、上記画
素321を輪郭線が通過するため、画素321のクリヤ
された値を画素322に代入する処理は行なわれず、種
である画素322が彩色されたま捷走査は画素322に
進む。画素322において、該画素322を輪郭線が通
過しないため、画素322の彩色された値を画素323
に代入する処理が行なわれ、画素323が彩色されて走
査は進み、前記処理と同じ処理で画素324と画素32
5も彩色され走査は画素325に進む。
The scan proceeds to pixel 321. At the pixel 321, since the outline passes through the pixel 321, the process of assigning the cleared value of the pixel 321 to the pixel 322 is not performed, and the continuous scanning in which the pixel 322, which is the seed, is colored advances to the pixel 322. At pixel 322, since the contour line does not pass through this pixel 322, the colored value of pixel 322 is transferred to pixel 323.
The pixel 323 is colored and the scanning proceeds, and the pixel 324 and the pixel 32 are colored by the same process as the above process.
5 is also colored and scanning proceeds to pixel 325.

画素325において、該画素325を輪郭線が通過する
ため画素325の彩色された値を画素326に代入する
処理は行なわれない。しかし、画素326は種であるた
めあらかじめ保色されており。
At pixel 325, since the outline passes through pixel 325, the process of assigning the colored value of pixel 325 to pixel 326 is not performed. However, since the pixel 326 is a seed, its color is maintained in advance.

次に走査が画素326に進む。該画素326を輪郭線が
通過しないため、画素326の彩色された値を画素32
7に代入する処理が行なわれ、同様の処理が画素327
でも行なわれ1画素327 と画素328が彩色されて
走査は画素328に進む。画素328において、前記画
素325における処理と同じ処理が行なわれ、走査は画
素329に進む。
The scan then advances to pixel 326. Since the contour line does not pass through the pixel 326, the colored value of the pixel 326 is transferred to the pixel 32.
7 is performed, and similar processing is performed for pixel 327.
However, one pixel 327 and one pixel 328 are colored, and scanning proceeds to pixel 328. At pixel 328, the same processing as at pixel 325 is performed, and the scan continues to pixel 329.

画素329において、画素329を輪郭線が通過しない
ため、画素329の彩色された値を画素330に代入す
る処理が行なわれ画素330が彩色されて走査は進み、
前記処理と同じ処理で画素330から画素331までの
画素は彩色され走査は画素331に進む。画素331に
おいて該画素331を輪郭線が通過するため、画素33
1の彩色された値を画素332に代入する処理は行なわ
れず、以上でラスタ310における処理を完了する。
At pixel 329, since the contour line does not pass through pixel 329, processing is performed to assign the colored value of pixel 329 to pixel 330, pixel 330 is colored, and scanning proceeds.
The pixels from pixel 330 to pixel 331 are colored by the same process as the above process, and scanning proceeds to pixel 331. Since the contour line passes through the pixel 331 at the pixel 331, the pixel 331
The process of assigning a colored value of 1 to pixel 332 is not performed, and the process for raster 310 is thus completed.

前記処理をすべてのラスタについて行なえ目゛図形30
0が囲む画素を同一の色で彩色した第3図(e)に示す
ディジタル画像を生成することができる。
Perform the above process for all rasters.
A digital image shown in FIG. 3(e) in which pixels surrounded by 0 are colored in the same color can be generated.

さて、本発明の原理を実行するためには予め第3図(C
1の斜線で示す種となる画素をめて彩色しておかなけれ
ばならないので以下その方法を示す。
Now, in order to carry out the principle of the present invention, in advance, as shown in FIG.
Since it is necessary to select and color the seed pixels indicated by diagonal lines in 1, the method for doing so will be described below.

まず第3図(alに示す図形300 の辺を、前記図形
300の輪郭上を時計回りにたどる方向で方向づけた第
4図(a)に示すベクトル → 寸 E1+’2パ°′・E12 を考える。第3図(C)に示す種となる画素は前記ベク
トル群のうちy軸方向成分が負である辺E1+E3 +
 E6 + ”8 + E□□が通過する画素のX軸方
向に隣接し、且つ図形300の内部に含まれることにな
る。そこで、まず辺E1 r E3 + E6 r E
8+ElfをX軸方向に1画素分だけ平行移動させた線
分が通過する第4図(b)の斜線で示す画素を種となる
画素の候補とし、次に不適当な画素410,420゜4
30.440を取り除く処理を行なう。
First, consider the vector shown in FIG. 4(a) in which the sides of the figure 300 shown in FIG. The pixel serving as the seed shown in FIG.
E6 + "8 + E□□ is adjacent to the pixel through which it passes in the X-axis direction and is included inside the figure 300. Therefore, first, the sides E1 r E3 + E6 r E
The diagonally shaded pixels in FIG. 4(b), through which the line segment obtained by translating 8+Elf by one pixel in the X-axis direction passes, are selected as seed pixel candidates, and then the inappropriate pixels 410, 420° 4
Perform processing to remove 30.440.

前記不適当な画素はy軸方向成分が負である辺とy軸方
向成分が正である辺が凸に接合している所に発生する。
The inappropriate pixels occur where a side having a negative y-axis direction component and a side having a positive y-axis direction component are joined in a convex manner.

そこで例えば画素410と画素440はy軸方向成分が
正である辺B12と辺E2が頂点Vlと頂点v2におい
てy軸方向成分が負である辺E1と凸に接合しているこ
とを確認した後、辺Eユ2をX軸方向に1画素分だけ平
行移動させた線分が通過する第4図(C)の記号○で示
す画素と、辺E2をX軸方向に1画素分だけ平行移動さ
せた線分が通過する第4図(C1の記号*で示す画素の
和集合となる画素と、前記第4図fblの斜線で示す画
素の共通画素とじて検出し取り除くことができる。
For example, after confirming that the sides B12 and E2, which have positive y-axis direction components, are convexly connected to the side E1, whose y-axis direction components are negative, at vertices Vl and V2, pixel 410 and pixel 440 , the pixel indicated by the symbol ○ in Figure 4 (C), through which the line segment passing by which the side E2 is translated by one pixel in the X-axis direction, and the side E2 is translated by one pixel in the X-axis direction. It is possible to detect and remove the pixel that is the union of the pixels shown by the symbol * in FIG. 4 (C1) through which the line segment passed through, and the pixel shown by diagonal lines in FIG.

ところが、前記処理を行なうと種として残しておかなけ
ればならない画素450と画素460も取り除かれてし
まう。
However, when the above processing is performed, pixels 450 and 460, which should be left as seeds, are also removed.

この事を避けるために、まずy軸方向成分が負で、→ ある辺E17kx軸方向に1画素分だけ平行移動させた
線分が通過する画素を種となる画素の候補とした後、前
記方法で検出した不適当な画素440・と画素410金
この時点の前記候補から取り除き、次にy軸方向成分が
負である辺E3fx軸方向に1画素分だけ平行移動させ
た線分が通過する画素を新たに種となる画素の候補に加
えた後、前記方法で不適当な画素の存在を調べる。この
場合、辺E2はy軸方向成分が正であるが頂点■3にお
いて辺E2は辺IC3と凹に接合するため、また辺E4
はy軸方向成分が零であり正でないため、それぞれ不適
当な画素は存在しないことになる。よってこの時点で画
素450は種となる画素の候補に残ることになる。
In order to avoid this, first, a pixel whose y-axis direction component is negative and which is passed by a line segment translated by one pixel in the x-axis direction on a certain side E17k is selected as a candidate pixel as a seed pixel, and then the method described above is performed. Remove the inappropriate pixels 440 and 410 detected from the candidates at this point, and then remove the pixel through which the line segment that is translated by one pixel in the x-axis direction on side E3f whose y-axis direction component is negative is added to the new seed pixel candidates, and then the presence of inappropriate pixels is checked using the method described above. In this case, the side E2 has a positive y-axis direction component, but at the vertex ■3, the side E2 joins the side IC3 in a concave manner, and the side E4
Since the y-axis direction component is zero and not positive, there are no inappropriate pixels. Therefore, at this point, pixel 450 remains as a candidate pixel to become a seed.

以上の処理を辺1ら1 r E3 + be r E’
8 r El□とy軸方向成分が負である辺を時計回り
にたどっ −て行なえば、第3図(C)の斜線で示す種
となる画素をめることができる。しかしながら、若し種
となる画素をめる処理を辺E6から時計回りに始めたと
すると、画素450は種として残るが、第4図(d)に
示す様に画素440 を取り除く辺E1での処理で種と
して必要な画素460 が取り除かれてしまう。そこで
、上記処理を辺E6がら反時計回りにE、、E3.Iシ
1.E0□、E8と行なった場合には、画素460は種
として残るが第4図(e)に示す画素410を取り除く
辺E□での処理では種として必要な画素450が取り除
かれてしまうことに着目し、前記時計回りの処理で得た
種となる画素と、前記反時計回りの処理で得た種となる
画素のオロ集合を新たに種となる画素とすれば、どの辺
から処理を始めても第3図(C1の斜線で示す種となこ
の実施例を用いて、例えば第4図(a)に示す図形30
0が囲む領域を塗りつぶす場合を例として説明する。本
発明で〆例として用いる図形300は前記図形の頂点を
負の2軸方向から見て時計回りに順序づけ、座標値が成
分である位置ベクトル■1.■2.・・・+■13(但
しVl3−Vl) (1)と、頂点の個数N (−12
)で構成し、多角形記憶手段200の内容として格納す
る。第6図は上記多角形記憶手段200の内容をメモリ
上で表現した概念図である。
The above processing is performed as side 1 to 1 r E3 + be r E'
By tracing 8 r El□ and the side where the y-axis direction component is negative in a clockwise direction, it is possible to find the seed pixel shown by diagonal lines in FIG. 3(C). However, if the process of inserting the seed pixels starts clockwise from side E6, pixel 450 will remain as a seed, but the process on side E1 will remove pixel 440 as shown in FIG. 4(d). In this case, pixel 460, which is necessary as a seed, is removed. Therefore, the above process is performed counterclockwise from side E6 to E, , E3 . Ishi1. If steps E0□ and E8 are performed, the pixel 460 remains as a seed, but in the processing on side E□, which removes the pixel 410 shown in FIG. 4(e), the pixel 450 necessary as a seed is removed. Focusing on this, if we set the seed pixel obtained through the clockwise processing and the seed pixel obtained through the counterclockwise processing as a new seed pixel, then from which side should we start processing? For example, the shape 30 shown in FIG.
The case where the area surrounded by 0 is filled will be explained as an example. In the figure 300 used as an example in the present invention, the vertices of the figure are ordered clockwise when viewed from the negative two axis directions, and the coordinate values are position vectors whose components are 1. ■2. ...+■13 (however, Vl3-Vl) (1) and the number of vertices N (-12
) and stored as the contents of the polygon storage means 200. FIG. 6 is a conceptual diagram representing the contents of the polygon storage means 200 on memory.

一方、順方向内線記憶手段220 と逆方向内線記憶手
段225と領域記憶手段235と輪郭線記憶手段245
は同じ画面を表わす画像メモリとする。
On the other hand, the forward extension storage means 220, the backward extension storage means 225, the area storage means 235, and the contour storage means 245
are image memories representing the same screen.

上記画面は第7図に示すようにy軸方向のラスタに分割
しておく。また、表示手段250は従来のディスプレイ
技術で実現できる。
The above screen is divided into rasters in the y-axis direction as shown in FIG. Additionally, the display means 250 can be implemented using conventional display technology.

処理は例えばコンビーータで構成した制御手段255が
輪郭線生成手段215を起動して始まる。
The process begins when the control means 255, which is constituted by, for example, a conbeater, activates the contour line generation means 215.

起動された輪郭線生成手段215はまず輪郭線記憶手段
245を構成する画像メモリのすべての画素に値Oを書
き込み、次に多角形記憶手段200の内容の先頭に格納
された頂点の個数12を得゛C1多角形記憶手段200
の内容が表わす閉多角形画像の頂点の個数を知った後、
1番目の頂点vIから12番目の頂点V1□まで一つづ
つ順に頂点をたどり、現在の頂点とそれに絖〈頂点を取
り出し輪郭線記憶手段245の内容が表わす画素のうち
それら2つの頂点で定まる線分が通過するすべ・Cの画
素に値1を書き込む。
The activated contour generating means 215 first writes the value O to all pixels of the image memory constituting the contour storing means 245, and then writes the number 12 of vertices stored at the beginning of the contents of the polygon storing means 200. Gain C1 polygon storage means 200
After knowing the number of vertices of the closed polygon image represented by the contents of
The vertices are traced one by one from the first vertex vI to the 12th vertex V1□, and the current vertex and the line defined by the two vertices of the pixels represented by the contents of the contour storage means 245 are extracted. Write the value 1 to all pixels of C where the minute passes.

輪郭線生成手段215が処理を完了すると、制御手段2
55は順方向内線生成手段205を起動する。起動され
た順方向内線生成手段205はまず順方向内線記憶手段
2201構成する画像メモリのすべての画素に値Oを書
き込み、次に多角形記憶手段200 の内容の先頭に格
納された頂点の個数12を得て、多角形記憶手段200
の内容が表わす閉多角形画像の頂点の個数を知った後、
1番目の頂点から12番目の頂点まで一つづつ順に頂点
をたどり、現在の頂点を始点としそれに続く頂点を終点
とするベクトル El =■、v2 + E2=■2 ■3 + ”’ 
+ E12=■12■13(=■12”i )を算出し
、更にiを2から13までの整数としたとき任意の1に
対して辺El−1と辺E、+□が存在し、しかも上記i
ですべての辺を指定できるように Ex3=E’x・E 14= E2 f3)として、順
方向内線生成手段205が持つメモリに、X軸方向成分
の値とy軸方向成分の価の組E、=(t、+ul )+
 ’=1+ 2+−,14(4)として第8図に示す構
造で保持する。
When the contour generation means 215 completes the processing, the control means 2
55 activates the forward extension generation means 205. The activated forward extension generation means 205 first writes the value O to all pixels of the image memory constituting the forward extension storage means 2201, and then writes the number of vertices 12 stored at the beginning of the contents of the polygon storage means 200. and the polygon storage means 200
After knowing the number of vertices of the closed polygon image represented by the contents of
Trace the vertices one by one from the 1st vertex to the 12th vertex, and use the current vertex as the starting point and the following vertex as the ending point. El = ■, v2 + E2 = ■2 ■3 + "'
+ E12=■12■13 (=■12"i), and furthermore, when i is an integer from 2 to 13, for any 1, side El-1, side E, +□ exist, Moreover, the above i
In order to be able to specify all the sides, Ex3=E'x・E14=E2 f3) is stored in the memory of the forward extension generation means 205 as a set E of the value of the X-axis direction component and the value of the y-axis direction component. ,=(t,+ul)+
'=1+2+-, 14(4), and the structure shown in FIG. 8 is maintained.

最後に、順方向内線生成手段205は以上で生成したベ
クトル群E1+E2+・・・、El4をE2からElB
まで一つづつ順にたどり、y軸方向成分が負であるベク
トルE、を見付ける。上記ベクトルE、が見付かればそ
の度に、 まず添字Iを用いて なるに、/?をめ、Kと/を添字とする頂点vK。
Finally, the forward extension generation means 205 converts the vector group E1+E2+..., El4 generated above from E2 to ElB.
Find a vector E whose y-axis direction component is negative. Whenever the above vector E is found, first use the subscript I, /? , and the vertex vK with K and / as subscripts.

■1の座標値を多角形記憶手段200の内容から取り込
み、頂点■、の座標値を (X青、y%) (6) 頂点■、の座標値を (Xl、Yl) (7) として得てから順方向内線記憶手段220の内容が表わ
す画素のうち (XK+1 + YK ) + (xz+t + Yi
 ) (8)なる2点で定まる線分が通過するすべての
画素に値1を書き込み、次に δC””1x”l 1 t、−0xu1 (9)なるδ
。をp、出しその結果が負で、且つU、−4が正であれ
ば添字iを用いて なるに、lをめ、Kとlを添字とする頂点■え。
■ Take the coordinate values of 1 from the contents of the polygon storage means 200, and obtain the coordinate values of vertex ■, as (X blue, y%) (6) The coordinate values of vertex ■, as (Xl, Yl) (7) Then, among the pixels represented by the contents of the forward extension storage means 220, (XK+1 + YK) + (xz+t + Yi
) (8) Write the value 1 to all pixels through which the line segment defined by two points passes, then δC""1x"l 1 t, -0xu1 (9) δ
. If the result is negative and U, -4 is positive, use the subscript i, put l, and the vertex with K and l as subscripts.

■jの座標値を多角形記憶手段200の内容から取り込
み、順方向内線記憶手段220の内容が表わす画素のう
ち前記式(8)が示す2点で定まる線分が通過するすべ
ての画素に値0を書き込み、更にδcc”t++xxu
t tlXul+1 (11)なるδCCを算出しその
結果が負で、且つuI+、が正であれば添字iを用いて なるに、lをめ%にとlを添字とする頂点■え。
■ The coordinate value of j is fetched from the contents of the polygon storage means 200, and values are assigned to all pixels through which the line segment defined by the two points indicated by the formula (8) above passes among the pixels represented by the contents of the forward extension storage means 220. Write 0 and then δcc”t++xxu
t tlXul+1 (11) If δCC is calculated and the result is negative and uI+ is positive, the subscript i is used to form the vertex with l as the subscript.

vlの座標値を多角形記憶手段200の内容から取り込
み、順方向内線記憶手段220の内容が表わす画素のう
ち前記式(8)が示す2点で定まる線分が通過するすべ
ての画素に値0を書き込む処理を行なう。
The coordinate value of vl is fetched from the contents of the polygon storage means 200, and the value 0 is assigned to all pixels through which the line segment defined by the two points shown by the above formula (8) passes among the pixels represented by the contents of the forward extension storage means 220. Performs the process of writing.

順方向内線生成手段205が処理を完了すると、制御手
段255は逆方向内線生成手段210を起動する。起動
された逆方向内線生成手段210はまず逆方向内線記憶
手段225を構成する画像メモリのすべての画素に値O
を書き込み、次に多角形記憶手段200の内容の先頭に
格納された頂点の個数12を得で、多角形記憶手段20
0の内容が表わす閉多角形画像の頂点の個数を知った後
、1番目の頂点から12番目の頂点まで一つづつ順に頂
点をたどり、前記式(2) 、 (3) 、 (41で
示すベクトルE量(i=1.2.・・・、14)を算出
し、それらのベクトルを逆方向内線生成手段210が持
つメモリに両式(4)の表現で保持する。
When the forward extension generation means 205 completes the processing, the control means 255 activates the backward extension generation means 210. The activated backward extension generation means 210 first sets the value O to all pixels of the image memory constituting the backward extension storage means 225.
Then, the number of vertices stored at the beginning of the contents of the polygon storage means 200, 12, is obtained, and the number of vertices stored at the beginning of the contents of the polygon storage means 200 is obtained.
After knowing the number of vertices of the closed polygon image represented by the content of 0, trace the vertices one by one from the 1st vertex to the 12th vertex, as shown in the above equations (2), (3), and (41). The vector E quantity (i=1.2..., 14) is calculated, and these vectors are stored in the memory of the backward extension generation means 210 in the form of expressions (4).

最後に、逆方向内線生成手段210は以上で生成したベ
クトル群EitE2+・・・、E14をE13からE2
まで一つづつ逆にたどり、y軸方向成分が負であるベク
トルE、を見付ける。上記ベクトルE、が見付かれば、
その度にまず添字iを用いて前記式(5)で示すに、/
をめ、Kとlを添字とする頂点vK、■1の座標値を多
角形記憶手段200の内容から取り込み、逆方向内線記
憶手段225の内容が表わす画素のうち前記式(8)が
示す2点で定まる線分が通過するすべての画素に値1を
書き込み、次に前記式(9)でδ。を算出し、その結果
が負で、且つul−1が正であれば添字iを用いて前記
式(10)が示すに、lをめKとlを添字とする頂点V
K、V、の座標値を多角形記憶手段200の内容から取
り込み、逆方向内線記憶手段225の内容が表わす画素
のうち前記式(8)が示す2点で定まる線分が通過する
すべての画素に値Oを書き込み、さらに前記式(ii)
でδCCを算出し、その結果が負で且つul+1が正で
あれば添字iを用いて前記式(12)が示すに、/をめ
、Kとlを添字とする頂点vK、Vノの座標値を多角形
記憶手段200の内容から取り込み、逆方向内線記憶手
段225の内容が表わす画素のうち前記式(8)が示す
2点で定まる線分が通過するすべての画素に値Oを書き
込む処理を行なう。
Finally, the backward extension generation means 210 converts the vector group EitE2+..., E14 generated above from E13 to E2.
Find a vector E whose y-axis direction component is negative. If the above vector E is found,
Each time, first using the subscript i, as shown in the above formula (5), /
, the coordinate value of the vertex vK with K and l as subscripts, (1) is fetched from the contents of the polygon storage means 200, and among the pixels represented by the contents of the backward extension storage means 225, 2 shown by the above formula (8) is obtained. Write the value 1 to all pixels through which the line segment defined by the point passes, and then calculate δ using the equation (9) above. is calculated, and if the result is negative and ul-1 is positive, the subscript i is used to calculate the vertex V with K and l as subscripts, as shown by the above equation (10).
The coordinate values of K and V are fetched from the contents of the polygon storage means 200, and among the pixels represented by the contents of the backward extension storage means 225, all the pixels through which the line segment defined by the two points shown by the above formula (8) pass. Write the value O into , and further write the above formula (ii)
Calculate δCC with A process of fetching a value from the contents of the polygon storage means 200 and writing the value O to all pixels through which the line segment determined by the two points shown by the above formula (8) passes among the pixels represented by the contents of the backward extension storage means 225. Do the following.

順方向内線生成手段205と逆方向内線生成手段210
が処理を完了すると、制御手段255は利点群生成手段
230を起動する。利点群生成手段230は画面を構成
する各画素ごとに順方向内線記憶手段220の内容が表
わす画素と、上記画素と同じ位置にある逆方向内線記憶
手段225の内容が表わす画素のうち少なくともいずれ
か一方の画素の値が1なら上記画素と同じ位置にある領
域記憶手段235の内容が表わす画素に値1を書き込み
、順方向内線記憶手段220の内容が表わす画素と上記
画素と同じ位置にある逆方向内線記憶手段225の内容
が表わす画素のいずれもが値0を持っていれば、上記画
素と同じ位置にある領域記憶手段235の内容が表わす
画素に値0を書き込む。
Forward extension generation means 205 and backward extension generation means 210
When the processing is completed, the control means 255 starts the advantage group generation means 230. The advantage group generation means 230 generates, for each pixel constituting the screen, at least one of a pixel represented by the contents of the forward extension storage means 220 and a pixel represented by the contents of the backward extension storage means 225 located at the same position as the above pixel. If the value of one pixel is 1, write the value 1 to the pixel represented by the contents of the area storage means 235 located at the same position as the above pixel, and write the value 1 to the pixel represented by the contents of the forward extension storage means 220 and the opposite pixel located at the same position as the above pixel. If any of the pixels represented by the contents of the direction extension storage means 225 have the value 0, the value 0 is written to the pixels represented by the contents of the area storage means 235 located at the same position as the above pixels.

オロ魚群生成手段230と輪郭線生成手段215が処理
を完了すると、制御手段255は条件転送手段240を
起動する。条件転送手段240は画面を構成する画素k
y軸方向のラスタに分割し、各ラスタごとにX軸方向に
走査して画素をたどり、各画素ごとに、若し輪郭線記憶
手段245の内容が表わす画素が値1を持っていれば何
もせず、若し輪郭線記憶手段245の内容が表わす画素
が値0を持っていれば領域記憶手段235の内容が表わ
す画素の値を上記画素の次に走査する領域記憶手段23
5の内容が表わす画素の値として書き込む処理を行なう
When the Oro fish school generation means 230 and the contour line generation means 215 complete their processing, the control means 255 activates the condition transfer means 240. The condition transfer means 240 transfers the pixel k constituting the screen.
Divide into rasters in the y-axis direction, scan each raster in the If the pixel represented by the contents of the contour storage means 245 has a value of 0, the area storage means 23 scans the value of the pixel represented by the contents of the area storage means 235 next to the pixel.
Processing is performed to write the value of the pixel represented by the contents of 5.

条件転送手段240が処理を完了すると、制御手段25
5は表示手段250を起動する。表示手段250は領域
記憶手段235の内容が表わす各画素ごとに値を取り込
み、若しその値が1なら上記画素が位置する画面上の位
置を塗り、若しその値が0なら上記画素が位置する画面
上の位置を塗らない処理を行ない、その結果前記図形3
00から上記図形が囲む領域を同一の色で彩色したディ
ジタル画像を生成し表示することができる。
When the condition transfer means 240 completes the processing, the control means 25
5 activates the display means 250. The display means 250 takes in a value for each pixel represented by the contents of the area storage means 235, and if the value is 1, the position on the screen where the said pixel is located is painted, and if the value is 0, the position of the said pixel is painted. As a result, the above figure 3
00, it is possible to generate and display a digital image in which the area surrounded by the above figure is colored in the same color.

この実施例の説明では輪郭線生成手段215の処理と順
方向内線生成手段205の処理と逆方向内線生成手段2
10の処理を逐次的処理として述べたが、これらは本質
的に並列動作が可能である。
In the description of this embodiment, the processing of the contour line generation means 215, the processing of the forward extension generation means 205, and the processing of the backward extension generation means 2 will be described.
Although the 10 processes have been described as sequential processes, they can essentially operate in parallel.

また利点列生成手段230は画素単位の並列動作が可能
であり、更に条件転送手段240 もラスタ単位の並列
動作が可能である。
Further, the advantage column generating means 230 is capable of parallel operation on a pixel basis, and furthermore, the condition transfer means 240 is also capable of parallel operation on a raster basis.

画面の走査に関しては、前記説明において主走査方向を
X軸方向に限定したが、主走査を負のX軸方向にした時
は順方向内線生成手段と逆方向内線生成手段が行なう前
記種となる画素の生成において、辺を表わすベクトルの
うちy軸方向成分が正である辺EIを見付け、該辺E、
が見付かる度に辺E、を負のX軸方向に1画素分だけ平
行移動させた線分が通過する画素を種となる画素の候補
に加えた後、前記辺Elの両端点においてy軸方が存在
する場合には上記辺E、を負のX軸方向に1画素分だけ
平行移動させた線分が通過する画素を上記候補から取り
除く処理、主走査をy軸方向にした時は順方向内線生成
手段と逆方向内線生成手段が行なう種となる画素の生成
において、辺を表わすベクトルのうちX軸方向成分が正
である辺y軸方向に1画素分だけ平行移動させた線分が
通過する画素を種となる画素の候補に加えた後、上記辺
E、の両端点においてX軸方向成分が負で、には、上記
辺E、をy軸方向に1画素分だけ平行移動させた線分が
通過する画素を上記候補から取り除く処理、主走査を負
のy軸方向にした時は順方向内線生成手段と逆方向内線
生成手段が行なう種となる画素の生成において、辺を光
わすベクトルのうちX軸方向成分が負である辺E、を見
付け、上記辺E、が見付かる度に辺E、を負のy軸方向
に1画素分だけ平行移動させた線分が通過する画素を種
となる画素の候補に加えた後、上記辺E。
Regarding scanning of the screen, in the above description, the main scanning direction was limited to the X-axis direction, but when the main scanning is set to the negative X-axis direction, the forward extension generation means and the reverse extension generation means perform the above-mentioned type of scanning. In the generation of pixels, find the side EI whose y-axis direction component is positive among the vectors representing the side, and calculate the side E,
Each time the side E is found, the pixel through which the line segment passes by one pixel in the negative X-axis direction is added to the seed pixel candidates. If exists, the pixels passed by the line segment obtained by parallelly moving the side E by one pixel in the negative In the generation of seed pixels performed by the extension line generation means and the reverse direction extension generation means, a line segment that is translated in parallel by one pixel in the y-axis direction of the side whose X-axis direction component is positive among the vectors representing the side passes through. After adding the pixel to the seed pixel candidates, if the X-axis direction component is negative at both end points of the side E, then the side E is translated by one pixel in the y-axis direction. The process of removing pixels through which the line segment passes from the candidates, and when the main scanning is in the negative y-axis direction, the edges are illuminated in the generation of seed pixels performed by the forward extension generation means and the reverse extension generation means. Find the side E whose X-axis direction component is negative in the vector, and every time the above side E is found, find the pixel through which the line segment passing by parallelly moving the side E by one pixel in the negative y-axis direction. After adding the seed pixel candidates, the above edge E.

の両端点においてX軸方向成分が正で、且つ辺E。The X-axis direction component is positive at both end points, and the side E.

と凸に接合する辺E、が存在する場合には上記辺E、を
負のy軸方向に1画素分だけ平行移動させた線分が通過
する画素を上記候補から取り除く処理を行なえば同様の
効果を帰ることができる。
If there is a side E that joins convexly to E, the same result can be obtained by removing from the above candidates the pixels through which the line segment, which is obtained by translating the side E by one pixel in the negative y-axis direction, passes through. You can return the effect.

(発明の効果) 本発明は1回の主走査で画像の塗りつぶしを完了できる
効果がある。
(Effects of the Invention) The present invention has the advantage that filling of an image can be completed with one main scan.

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

第1図(a)(b)は画像の塗りつぶしの説明図、第2
図(a)〜(d)は従来技術の説明図、第3図(a)〜
(e)、第4図(a)〜(elは本発明の詳細な説明図
、第5図は本発明の一実施例を示すブロック図、第6図
は多角形記憶手段の内容の説明図、第7図は画面の説明
図、第8図は辺を示すベクトルを格納する方法の断1明
図である。 200・・・・・・多角形記憶手段、205・・・・・
・順方向内線生成手段、210・・・・・・逆方向内線
生成手段、215・・・・・・輪郭線生成手段、220
・・・・・・順方向内線記憶手段、225・・・・・逆
方向内線記憶手段、230・・・・・・オロ魚群生成手
段、235・・・・・・領域記憶手段、240・・・・
・・条件転送手段、245・・・・・・輪郭線記憶手段
。 250・・・・・・表示手段、255・・・・・・制御
手段。
Figures 1 (a) and (b) are illustrations of filling in images;
Figures (a) to (d) are explanatory diagrams of the prior art, and Figures 3 (a) to
(e), FIGS. 4(a) to (el is a detailed explanatory diagram of the present invention, FIG. 5 is a block diagram showing an embodiment of the present invention, and FIG. 6 is an explanatory diagram of the contents of the polygon storage means. , FIG. 7 is an explanatory diagram of the screen, and FIG. 8 is a schematic diagram of a method for storing vectors indicating sides. 200...Polygon storage means, 205...
・Forward extension generation means, 210...Reverse extension generation means, 215...Contour line generation means, 220
... Forward extension storage means, 225 ... Reverse extension storage means, 230 ... Oro fish school generation means, 235 ... Area storage means, 240 ...・・・
...Condition transfer means, 245... Contour storage means. 250... Display means, 255... Control means.

Claims (1)

【特許請求の範囲】[Claims] 塗りつぶしを行なう閉多角形ディジタル画像を記憶する
多角形記憶手段と、該多角形記憶手段の内容が表わす閉
多角形画像を構成する複数個の辺を時計回りにたどり塗
りつぶしの初期点群を生成する順方向内線生成手段と、
該順方向内線生成手段が生成する魚群を記憶する順方向
内線記憶手段と、前記多角形記憶手段の内容が表わす閉
多角形画像を構成する複数個の辺を反時計回りにたどり
塗りつぶしの初期点群を生成する逆方向内線生成手段と
、該逆方向内線生成手段が生成する魚群を記憶する逆方
向内線記憶手段と、前記多角形記憶手段の内容が表わす
閉多角形画像の輪郭線を生成する輪郭線生成手段と、該
輪郭線生成手段が生成する輪郭線を魚群として記憶する
輪郭線記憶手段と、前記順方向内線記憶手段の内容が表
わす魚群、前記逆方向内線記憶手段の内容が表わす魚群
の和集合となる魚群を算出する利点群生成手段と、該利
点群生成手段が生成する魚群を記憶する領域記憶手段と
、前記輪郭線記憶手段の内容が表わす魚群を8照しなが
ら前記領域記憶手段の内容を入出力とする条件転送手段
を含むことを特徴とする画iりつぶし装置。
A polygon storage means for storing a closed polygon digital image to be filled, and a plurality of sides constituting the closed polygon image represented by the contents of the polygon storage means are traced clockwise to generate an initial point group for filling. Forward extension generation means;
a forward extension storage means for storing a school of fish generated by the forward extension generation means, and an initial point for tracing counterclockwise a plurality of sides constituting a closed polygon image represented by the contents of the polygon storage means; Reverse extension generation means for generating schools; Reverse extension storage means for storing schools of fish generated by the reverse extension generation means; and generation of outlines of closed polygon images represented by the contents of the polygon storage means. a contour line generation means, a contour line storage means for storing the contour lines generated by the contour line generation means as a school of fish, a school of fish represented by the contents of the forward extension storage means, and a school of fish represented by the contents of the backward extension storage means. an advantage group generation means for calculating a school of fish that is the sum of the above, an area storage means for storing the fish school generated by the advantage group generation means, and an area storage means for storing the fish school represented by the contents of the outline storage means. An image filling device characterized by comprising a condition transfer means for inputting and outputting the contents of the means.
JP59017357A 1984-02-02 1984-02-02 Image filling device Expired - Lifetime JPH061493B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59017357A JPH061493B2 (en) 1984-02-02 1984-02-02 Image filling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59017357A JPH061493B2 (en) 1984-02-02 1984-02-02 Image filling device

Publications (2)

Publication Number Publication Date
JPS60163164A true JPS60163164A (en) 1985-08-26
JPH061493B2 JPH061493B2 (en) 1994-01-05

Family

ID=11941789

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59017357A Expired - Lifetime JPH061493B2 (en) 1984-02-02 1984-02-02 Image filling device

Country Status (1)

Country Link
JP (1) JPH061493B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01109478A (en) * 1987-10-23 1989-04-26 Canon Inc Image processor
JPH01276380A (en) * 1988-04-28 1989-11-06 Sharp Corp Picture processor
JPH02244221A (en) * 1989-03-17 1990-09-28 Hitachi Ltd Character graphic generating device
US8390641B2 (en) 2009-02-23 2013-03-05 Fujitsu Limited Device and method for multicolor vector image processing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01109478A (en) * 1987-10-23 1989-04-26 Canon Inc Image processor
JPH01276380A (en) * 1988-04-28 1989-11-06 Sharp Corp Picture processor
JPH02244221A (en) * 1989-03-17 1990-09-28 Hitachi Ltd Character graphic generating device
US8390641B2 (en) 2009-02-23 2013-03-05 Fujitsu Limited Device and method for multicolor vector image processing

Also Published As

Publication number Publication date
JPH061493B2 (en) 1994-01-05

Similar Documents

Publication Publication Date Title
CN100470452C (en) Method and system for implementing three-dimensional enhanced reality
RU2215326C2 (en) Image-based hierarchic presentation of motionless and animated three-dimensional object, method and device for using this presentation to visualize the object
US4935879A (en) Texture mapping apparatus and method
US6016148A (en) Automated mapping of facial images to animation wireframes topologies
EP0989536A1 (en) Graphic pattern processing apparatus
JP3885262B2 (en) Method for mixing a plurality of pixels on a texture map, and a plurality of pixel mixing circuit and image processing apparatus using the same
CN109146991B (en) Picture format conversion method, device, equipment and storage medium
US20010031086A1 (en) Image processor, image processing apparatus, and image processing method
KR910009102B1 (en) Image synthesizing apparatus
WO2006006666A1 (en) Image processing method and image processor by tracking digital image contour
US11769195B2 (en) Systems and methods for visualizing wall coverings in an image of a scene
JPS60163164A (en) Smear-out device of picture
Shibayama et al. Reconstruction of 3D surface and restoration of flat document image from monocular image sequence
JPH07129762A (en) Sketch-fashion image generator
US11770496B2 (en) Systems and methods for visualizing surface coverings in an image of a scene
US5454070A (en) Pixel to spline based region conversion method
JP2747822B2 (en) Graphic display device
JPS6177984A (en) Paint-out system of closed polygonal picture
JP2559359B2 (en) Image structure storage method and image registration apparatus
JPH0355867B2 (en)
KR950007532B1 (en) Grapic pattern processing apparatus
AU670841B2 (en) Pixel to spline based region conversion method
JP2634905B2 (en) How to paint shapes
JP2766478B2 (en) Image processing system
Baudelaire et al. Computer-assisted animation—an overview