JPH0650525B2 - Mask processing method - Google Patents
Mask processing methodInfo
- Publication number
- JPH0650525B2 JPH0650525B2 JP7581686A JP7581686A JPH0650525B2 JP H0650525 B2 JPH0650525 B2 JP H0650525B2 JP 7581686 A JP7581686 A JP 7581686A JP 7581686 A JP7581686 A JP 7581686A JP H0650525 B2 JPH0650525 B2 JP H0650525B2
- Authority
- JP
- Japan
- Prior art keywords
- address
- work area
- mask
- read
- generating means
- 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 - Fee Related
Links
- 238000003672 processing method Methods 0.000 title claims description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 2
- 238000000034 method Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000008719 thickening Effects 0.000 description 1
Landscapes
- Image Processing (AREA)
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明はマスク処理方式に関し、特に入力画像に対する
細線化,太線化,エッジ抽出,フィルタリングなどを行
うためのマスク処理方式に関する。The present invention relates to a mask processing method, and more particularly to a mask processing method for performing thinning, thickening, edge extraction, filtering, etc. on an input image.
(従来の技術) 一般に(2K+1)×(2L+1)のマスクを行う場合は第
6図に示すように入力画像のy=q−L〜q+L,x=
p−K〜p+Kの部分を読み出す毎に、マスク係数との
積和を行い出力画像の一画素(p,q)を得る。(Prior Art) Generally, when a mask of (2K + 1) × (2L + 1) is performed, y = q−L to q + L, x = of an input image as shown in FIG.
Each time the part of p−K to p + K is read, the product sum with the mask coefficient is performed to obtain one pixel (p, q) of the output image.
(発明が解決しようとする問題点) 従来、この種のマスク処理方式は−M×Nの画像に対し
(2K+1)×(2L+1)のマスク処理を行う場合入力画
像マスク係数との読み出しのために各々MN(2K+1)
×(2L+1)回、出力画像書き出しのためにMN回のメ
モリアクセスが必要である。一般にはプロセッサ内部の
メモリは高速であるが容量が少く画像を格納するメモリ
は大容量であるがあまり速くないため、画像のはいった
メモリへのアクセス回数が多いことにより処理に時間が
かかっていた。(Problems to be Solved by the Invention) Conventionally, in this type of mask processing method, in the case of performing (2K + 1) × (2L + 1) mask processing on an image of −M × N, it is necessary to read with an input image mask coefficient. Each MN (2K + 1)
Memory access is required x (2L + 1) times and MN times for writing the output image. Generally, the memory inside the processor is fast, but the capacity is small and the memory that stores images is large but not so fast, so it took a long time to process because the number of accesses to the memory containing images is large. .
本発明の目的はこのような中速のメモリへのアクセス回
数を減らし高速に処理できるマスク処理方式を提供する
ことである。An object of the present invention is to provide a mask processing method capable of reducing the number of times of accessing such a medium speed memory and processing at high speed.
(問題点を解決するための手段) 本発明のマスク処理方式はM×Nの入力画像とMのワー
クエリアと(2K+1)×(2L+1)のマスクを格納する
手段と、前記出力画像への書きこみ(x,y)アドレス
としてy=1〜N生成し、各yについてx=1〜M生成
する手段と、前記入力画像からの読み出し(x,y)ア
ドレスとして、前記出力アドレス生成手段がy=q,x
=1〜Mを生成する毎に、y=q−L〜q+L生成し、
各yについてx=1〜M生成する手段と、マスク読み出
し(i,j)アドレスとして、前記入力アドレス生成手
段が1アドレスを生成する毎にj=y−q,i=−K〜
K生成する手段と、ワークエリアへの書きこみ、読み出
し(k)アドレスとして、前記入力アドレス生成手段が1
アドレスを生成する毎にk=x−K〜x+K生成する手
段と、前記ワークエリアアドレス生成手段が1アドレス
を生成する毎に前記入力アドレス生成手段と前記マスク
アドレス生成手段で読み出された各々の値を乗じ、前記
ワークエリアアドレス生成手段で読み出されたワークエ
リア値の値に和して再び同じワークエリアへ書き戻す手
段とを有している。(Means for Solving Problems) The mask processing method of the present invention is a means for storing an M × N input image, a M work area, and a (2K + 1) × (2L + 1) mask, and writing to the output image. Means for generating y = 1 to N as the indent (x, y) address and x = 1 to M for each y, and the output address generating means as the read (x, y) address from the input image = Q, x
= 1 to M each time y = q−L to q + L is generated,
Means for generating x = 1 to M for each y, and j = y−q, i = −K to each time the input address generating means generates one address as a mask read (i, j) address.
The means for generating K and the input address generating means for writing to the work area and the read (k) address are 1
Means for generating k = x−K to x + K each time an address is generated, and each of the input address generation means and the mask address generation means read out each time the work area address generation means generates one address. There is provided means for multiplying by a value, adding to the value of the work area value read by the work area address generating means, and writing back to the same work area again.
(実施例) 次に本発明の実施例について図面を参照して説明する。(Example) Next, the Example of this invention is described with reference to drawings.
第1図は本発明の一実施例を示す。第1図において、本
実施例は入力画像,出力画像,ワークエリアおよびマス
クを格納する手段10と、出力画像への書き込みアドレ
スを生成する手段11と、入力画像からの読み出しアド
レスを、出力アドレス生成手段11が出力アドレスを生
成する毎に生成する手段12と、マスク読み出しアドレ
スを、入力アドレス生成手段が1アドレスを生成する毎
に生成するマスク手段13と、ワークエリアへの書き込
み,読み出しアドレスを入力アドレス生成するワークエ
リア手段14と、入力アドレス生成手段12が1アドレ
スを生成する毎に入力アドレスにより読み出された値と
マスクアドレスにより読み出された値とを乗じ、ワーク
エリア値に和して再び同じワークエリアへ書き戻す手段
15とを含む、 第2図は本発明の一実施例における格納手段を示す。第
2図において、本実施例の格納手段10は各メモリ大き
さを次のように仮定する 最初に出力画像のqライン目を出力する際の処理を説明
すると、入力画像からy=q−L〜q+L、各yについ
てx=1〜Mのアドレス生成により値Axyを順次読み出
す。一画素Axyが読み出されると、マスクのy−qライ
ン目すなわち入力画像から読み出される部分のライン数
の順番に対応したライについてi=−K〜Kのアドレス
生成しMij(j=y−q)について読み出しこれをAxyに
順次乗じる。この値をワークエリアのk=x−i番目の
値に和して更新する。すなわち次式で表される処理を行
う。FIG. 1 shows an embodiment of the present invention. Referring to FIG. 1, this embodiment uses a means 10 for storing an input image, an output image, a work area and a mask, a means 11 for generating a write address to the output image, and a read address from the input image for generating an output address. The means 11 for generating the output address by the means 11 and the mask means 13 for generating the mask read address each time the input address generating means generate one address, and the write / read address for the work area are input. Each time the work area means 14 for generating an address and the input address generation means 12 generate one address, the value read by the input address is multiplied by the value read by the mask address, and the work area value is summed. FIG. 2 includes a means 15 for writing back data to the same work area again. Indicates the means of payment. In FIG. 2, the storage means 10 of the present embodiment assumes the size of each memory as follows. First, the process for outputting the q-th line of the output image will be described. The value Axy is sequentially read from the input image by generating addresses y = q-L to q + L and x = 1 to M for each y. When one pixel Axy is read, an address of i = -K to K is generated for a line corresponding to the y-th line of the mask, that is, the number of lines of the portion read from the input image, and Mij (j = y-q) is generated. Read out and multiply this by Axy. This value is added to the k = xi-th value in the work area and updated. That is, the processing represented by the following equation is performed.
B′x-i=Axy×Mi,y-q+Bx-i(i=−K〜K) B′x-i;x-i番目のワークエリアの更新された値 Bx-i; 〃 前の値 Axy;入力画像から読み出したアドレス(x,y)の値 Mi,y-q;マスクのアドレス(i,y-q)の値 この様子を第3図に示す。すなわち一画素Axyが入力画
像から読みこまれると、マスク係数を矢印の方向にア
ドレス生成して読み出しAxyに乗じ、ワークエリアを
矢印の方向にアドレス生成してこの値と先の積を和して
また書き戻す。B'xi = Axy × Mi, y-q + Bx-i (i = -K to K) B'xi; updated value of the xi-th work area Bx-i; 〃 previous value Axy; from the input image The read address (x, y) value Mi, yq; the mask address (i, yq) value This state is shown in FIG. That is, when one pixel Axy is read from the input image, the mask coefficient is generated in the direction of the arrow, the address is generated and multiplied by Axy, the work area is generated in the direction of the arrow, and the product of this value and the above is summed. Write back again.
これを入力画像のy=q−L〜q+L,x=1〜Mを読
み出して得られるAxyに対して上式を繰り返えすことに
より、ワークエリアB1〜BMに出力画像qライン目の
結果が累積される。最後にワークエリアをマスクの係数
の総和で割って出力画像qライン目にコピーする。This is repeated for Axy obtained by reading y = q−L to q + L, x = 1 to M of the input image, and the work areas B 1 to B M are output to the qth line of the output image. The results are cumulative. Finally, the work area is divided by the sum of the mask coefficients and copied to the output image q-th line.
この処理をすべての出力画像ラインy=1〜Nについて
行うことにより、M×N画像の(2K+1)×(2L+1)
のマスク処理が行える。 By performing this processing for all output image lines y = 1 to N, (2K + 1) × (2L + 1) of M × N images
Can be masked.
第4図は本実施例における各処理によって変化するワー
クエリアを示す。第4図において、8×8の入力画像を
3×3のマスク処理を行う場合、一画素入力画像を読み
込むだびにワークエリアの3画素分にアクセスしてマス
ク係数との積を書き込んでいく、これにより全入力画像
がマスク処理される。次に本実施例を具体的に実現する
装置としては第5図に示すようにイメージメモリ51と
出力バスインタフェース54,55およびイメージ・メ
モリ・バスインタフェース52をリング状に構成した処
理部から成る。この装置ではイメージメモリ51に入力
画像と出力画像を貯え、出力バスインタフェース内部の
メモリにワークエリアとマスクを貯えて処理することに
より処理が高速化される。すなわちイメージメモリ51
へのアクセスは3×8×8回の入力と8×8の出力で、
合計256回となる。一方従来の方法では3×3×8×
8回の入力と8×8の出力で合計640回となる。FIG. 4 shows a work area which is changed by each processing in this embodiment. In FIG. 4, when the 8 × 8 input image is subjected to the 3 × 3 mask processing, every time one pixel input image is read, three pixels in the work area are accessed and the product of the mask coefficient is written. As a result, all input images are masked. Next, as a device for specifically realizing the present embodiment, as shown in FIG. 5, an image memory 51, output bus interfaces 54 and 55, and an image memory bus interface 52 are constituted by a ring-shaped processing section. In this apparatus, the input image and the output image are stored in the image memory 51, the work area and the mask are stored in the memory inside the output bus interface, and the processing is speeded up. That is, the image memory 51
Access is 3x8x8 inputs and 8x8 outputs,
The total is 256 times. On the other hand, in the conventional method, 3 × 3 × 8 ×
A total of 640 times with 8 inputs and 8 × 8 outputs.
(発明の効果) 以上説明したように本発明は、M×Nの画像に対し(2K
+1)×(2L+1)マスク処理を行う場合一般に中速メ
モリへのアクセス回数はMN(2K+1)(2L+1)+M
N回あったがMN(2L+1)+MN回で少くてすみ、マ
スクサイズが大きくなるとさらに効果が大きくなる。ま
たプロセッサ内部の高速メモリへのアクセスは従来では
ワークエリアのリードライト,マスクのリードで3MN
(2K+1)(2L+1)本発明でも3MN(2K+1)(2L
+1)と変わらない。(Effects of the Invention) As described above, the present invention applies (2K
+1) × (2L + 1) mask processing Generally, the number of accesses to the medium speed memory is MN (2K + 1) (2L + 1) + M
There were N times, but MN (2L + 1) + MN times were less, and the effect became even greater as the mask size increased. In addition, the access to the high-speed memory inside the processor is conventionally 3MN by reading / writing the work area and reading the mask.
(2K + 1) (2L + 1) In the present invention, 3MN (2K + 1) (2L
Same as +1).
したがって本発明は画像のはいった中速メモリのアクセ
ス回数を減らすことにより処理が高速に行える。Therefore, according to the present invention, the processing can be performed at high speed by reducing the number of times of accessing the medium speed memory including the image.
第1図は本発明の一実施例を示すクレーム対応図、第2
図は本実施例における格納手段を示す図、第3図は本発
明の一実施例におけるマスク処理方式におけるマスク係
数の読み出しアドレスとワークエリアの読み書きアドレ
スを示す図、第4図は本発明の一実施例におけるワーク
エリアの処理状態を示す図、第5図は本発明を実現する
装置を示す図、第6図は従来のマスク処理方式を示す図
である。 10……格納手段、11……出力画像アドレス生成手
段、12……入力画像アドレス生成手段、13……マス
ク読み出しアドレス生成手段、14……ワークエリアア
ドレス生成手段、15……ワークエリア書き戻し手段。FIG. 1 is a claim correspondence diagram showing an embodiment of the present invention, and FIG.
FIG. 3 is a diagram showing a storage means in the present embodiment, FIG. 3 is a diagram showing a read address of a mask coefficient and a read / write address of a work area in a mask processing system in an embodiment of the present invention, and FIG. FIG. 5 is a diagram showing a processing state of a work area in the embodiment, FIG. 5 is a diagram showing an apparatus for realizing the present invention, and FIG. 6 is a diagram showing a conventional mask processing system. 10 ... Storing means, 11 ... Output image address generating means, 12 ... Input image address generating means, 13 ... Mask reading address generating means, 14 ... Work area address generating means, 15 ... Work area writing back means .
Claims (1)
のワークエリアと(2K+1)×(2L+1)のマスクとを
格納する手段と、前記出力画像への書きこみ(x,y)
アドレスとしてy=1〜N生成し、各yについてx=1
〜M生成する出力画像アドレス生成手段と、前記入力画
像からの読み出し(x,y)アドレスとして、前記画像
出力アドレス生成手段がy=q,x=1〜Mを生成する
毎に、y=q−L〜q+L生成し、各yについてx=1
〜M生成する入力画像アドレス生成手段と、マスク読み
出し(i,j)アドレスとして、前記入力画像アドレス
生成手段が1アドレスを生成する毎にj=y−q,i=
−K〜K生成するマスク読み出しアドレス生成手段と、
ワークエリアへの書きこみ、読み出し(k)アドレスと
して、前記入力画像アドレス生成手段が1アドレスを生
成する毎にk=x−K〜x+K生成するワークエリアア
ドレス生成手段と、前記ワークエリアアドレス生成手段
が1アドレスを生成する毎に前記入力画像アドレス生成
手段と前記マスク読み出しアドレス生成手段で読み出さ
れた各々の値を乗じ、前記ワークエリアアドレス生成手
段で読み出されたワークエリア値の値に和して再び同じ
ワークエリアへ書き戻す手段とを備え、入力画像からy
=q−L〜q+L,x=1〜Mの部分を読み出す毎に、
(2K+1)×(2L+1)のマスク処理を施した出力画像
のy=q,x=1〜Mの部分を得ることを特徴とするマ
スク処理方式。1. An M × N input image, an M × N output image and M
Means for storing the work area and the (2K + 1) × (2L + 1) mask, and writing (x, y) into the output image
Y = 1 to N are generated as addresses, and x = 1 for each y
~ M, and y = q each time the image output address generating means generates y = q, x = 1 to M as a read (x, y) address from the input image. Generate −L to q + L, x = 1 for each y
~ M input image address generating means and j = y-q, i = every time the input image address generating means generates one address as a mask read (i, j) address.
Mask read address generation means for generating -K to K,
Work area address generating means for generating k = x−K to x + K each time the input image address generating means generates one address as a write (k) address for writing to a work area, and the work area address generating means. Each time one address is generated, the value is multiplied by each value read by the input image address generating means and the mask read address generating means, and added to the value of the work area value read by the work area address generating means. And a means for writing back again to the same work area.
= Q−L to q + L, x = 1 to M,
A mask processing method characterized by obtaining a portion of y = q, x = 1 to M of an output image subjected to a mask processing of (2K + 1) × (2L + 1).
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7581686A JPH0650525B2 (en) | 1986-04-01 | 1986-04-01 | Mask processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP7581686A JPH0650525B2 (en) | 1986-04-01 | 1986-04-01 | Mask processing method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS62232086A JPS62232086A (en) | 1987-10-12 |
| JPH0650525B2 true JPH0650525B2 (en) | 1994-06-29 |
Family
ID=13587081
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP7581686A Expired - Fee Related JPH0650525B2 (en) | 1986-04-01 | 1986-04-01 | Mask processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0650525B2 (en) |
-
1986
- 1986-04-01 JP JP7581686A patent/JPH0650525B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPS62232086A (en) | 1987-10-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3482660B2 (en) | Image data processing apparatus and image data processing method | |
| JPH0650525B2 (en) | Mask processing method | |
| JP2709356B2 (en) | Image processing method | |
| JP2984516B2 (en) | Image sharpness adjustment method | |
| EP0114203B1 (en) | An image processor | |
| JP2946360B2 (en) | Image data interpolation method and apparatus | |
| JP2840706B2 (en) | Image processing method | |
| JPS61267095A (en) | Display method | |
| JP2652973B2 (en) | Image processing device | |
| JPH0650524B2 (en) | Mask processing method | |
| KR900000605B1 (en) | Affine transfer adress generation circuit | |
| JPS6067990A (en) | Picture information processor having density converting function | |
| JPH1074077A (en) | Method and device for two dimensional spatial conversion of picture | |
| JPS61157979A (en) | System for grasping state of variable density image at high speed | |
| JP2962148B2 (en) | Image processing device | |
| JPH0831983B2 (en) | Image reduction processor | |
| JP3205416B2 (en) | Image data correction method | |
| JPH0440162A (en) | Picture output device | |
| JP2761220B2 (en) | 3D graphic display system | |
| JPS60132271A (en) | Paint-out processing system | |
| JPS5945577A (en) | Addressing system of picture memory | |
| JPH0244433B2 (en) | ||
| JPS58219663A (en) | Picture rotation system | |
| JPH08202861A (en) | Data processing device | |
| JPS5917586A (en) | Pixel density reduction method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |