JPH01131971A - Method and device for processing affine transformation of image - Google Patents

Method and device for processing affine transformation of image

Info

Publication number
JPH01131971A
JPH01131971A JP62289318A JP28931887A JPH01131971A JP H01131971 A JPH01131971 A JP H01131971A JP 62289318 A JP62289318 A JP 62289318A JP 28931887 A JP28931887 A JP 28931887A JP H01131971 A JPH01131971 A JP H01131971A
Authority
JP
Japan
Prior art keywords
image
circuit
transformation
memory
affine transformation
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.)
Pending
Application number
JP62289318A
Other languages
Japanese (ja)
Inventor
Hirotada Ueda
博唯 上田
Hitoshi Matsushima
整 松島
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP62289318A priority Critical patent/JPH01131971A/en
Publication of JPH01131971A publication Critical patent/JPH01131971A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

PURPOSE:To perform the affine transformation of a binary image at almost the same processing speed only by a small memory circuit and a simple transformation circuit or a program by combining rotation at 90 deg., expansion and compression only in a direction of (y)-axis, and the transformation of an oblique axis only in a direction of (x)-axis. CONSTITUTION:An original image stored in an image memory 30 is read out in sequence of raster scan by an oblique axis transformation circuit 10, and receives the transformation of the oblique axis in the direction of (x)-axis and the transformation of the expansion and compression in the direction of (y)-axis, then, is returned to a memory 30. Next, the image is read out by a 90 deg. rotation circuit 20, and the rotation at 90 deg. is applied, then, it is returned to the memory 30 again. And finally, the same transformation as the previous one is applied by the oblique axis transformation circuit 10 again, and a final image is generated in the image memory 30. In such a way, the binary image is stored in the memory with ordinary word constitution, and the rotation or the affine transformation of the image can be performed without complicating a circuit.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は画像処理装置に関し、特に2値画像のアフィン
変換を高速に行なうための方法及び装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an image processing apparatus, and more particularly to a method and apparatus for performing affine transformation of a binary image at high speed.

〔従来の技術〕[Conventional technology]

画像の回転(アフィン変換の一例)を高速に行なうため
、従来技術では、特願昭58−20486号に記載のよ
うに、座標変換の式ただし、x、yは原画像の画素の座
標であり、u、vは回転後の対応画素の座標であり、と
書き直せること、そしてT、はy軸に関する斜交軸変換
、T2は拡大縮小変換、T3はX軸に関する斜交軸変換
というように、それぞれ単純な変換であるということを
利用して、(1)式を直接実行するよりも、高速に実行
できるというものであった。
In order to perform image rotation (an example of affine transformation) at high speed, in the prior art, as described in Japanese Patent Application No. 58-20486, a coordinate transformation formula is used, where x and y are the coordinates of pixels of the original image. , u, v are the coordinates of the corresponding pixels after rotation, and T is the oblique axis transformation about the y axis, T2 is the scaling transformation, T3 is the oblique axis transformation about the X axis, and so on. Taking advantage of the fact that each of these is a simple conversion, it was possible to execute the equation (1) faster than directly executing it.

又、類似の方法として、情報処理学会筒32目金国大会
1発表番号2N−8,rビデオレート回転プロセッサ」
に述べられているものがある。こに分解する方式が提案
されている。
Also, as a similar method, Information Processing Society of Japan 32nd Gold Country Conference 1 Presentation No. 2N-8, r Video Rate Rotation Processor.
There is something mentioned in A method has been proposed that decomposes the

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上記従来技術の前者では、X軸方向と共にy軸方向への
斜交軸変換を用いているが、特に2値の画像処理を考え
た場合、y軸方向の変換が画像メモリ周辺回路の規模を
増大するという問題があった。一方、後者においても、
やはり画像メモリの読出し時に、y軸方向へのアドレッ
シングを行なうという構成が採られており、同じ問題を
生じる。
The former of the above-mentioned conventional techniques uses oblique axis transformation in the y-axis direction as well as the The problem was that it was growing. On the other hand, even in the latter case,
After all, a configuration is adopted in which addressing is performed in the y-axis direction when reading the image memory, and the same problem occurs.

すなわち、一般にメモリは、−次元のアドレスでアクセ
スするような構造しか取れないため、上記の先頭にも記
載されているように、2次元アクセスを特徴とする特別
な回路を付加する必要がある。
That is, since a memory can generally only have a structure that can be accessed using a -dimensional address, it is necessary to add a special circuit that is characterized by two-dimensional access, as described at the beginning of the above.

又、これら2つの従来技術では、共にX軸方向の拡大・
縮小を行なうようにしており、そのため回路規模が増大
するという問題も存在した。
Furthermore, in both of these two conventional technologies, expansion and
However, since the size of the circuit is reduced, there is also the problem that the circuit scale increases.

本発明の目的は、これらの問題を解決し、1次元アクセ
スの通常の小型のメモリ回路と単純な変換回路又はプロ
グラムだけで、はぼ同等の処理速度で、2値画像のアフ
ィン変換を実行できる方法及び装置を提供することであ
る。
The purpose of the present invention is to solve these problems, and to be able to perform affine transformation of binary images at approximately the same processing speed using only a normal small memory circuit with one-dimensional access and a simple conversion circuit or program. An object of the present invention is to provide a method and apparatus.

さらにもう1つの目的は、2値画像メモリ固有のX方向
に並ぶ画素をワードとして並列アクセスするという特性
をフルに活用した高速の処理方法を提供することである
Yet another object is to provide a high-speed processing method that fully utilizes the characteristic of binary image memory, in which pixels arranged in the X direction are accessed in parallel as words.

〔問題点を解決するための手段〕[Means for solving problems]

上記の目的は、90度の回転とy軸方向のみへの拡大・
縮小とX軸方向のみへの斜交軸変換とを組み合せること
によって達成される6すなわち、90度回転をあいだに
はさんで実行することによって、従来必要であったX軸
方向への拡大・縮小、およびy軸方向への斜交軸変換を
不要とする。
The above purpose is to rotate 90 degrees and expand only in the y-axis direction.
This is achieved by combining reduction and oblique axis transformation only in the X-axis direction.6 In other words, by performing a 90-degree rotation in between, it is possible to eliminate the conventionally necessary expansion in the X-axis direction. Eliminates the need for reduction and oblique axis transformation in the y-axis direction.

〔作用〕[Effect]

前述のごとく、従来技術においては、(1)式をそのま
ま実行するか、高速化のための改良技術においては、(
1)式を(2)式のように変形して、これを順次実行す
るようにしていたが、本発明では、(1)式を次のよう
に分解する(ここでは、原理を説明するために、−例の
み示し、後で詳しく全体を示す)。
As mentioned above, in the conventional technology, formula (1) is executed as is, or in the improved technology for speeding up, (
Previously, equation (1) was transformed into equation (2) and executed sequentially, but in the present invention, equation (1) is decomposed as follows (here, to explain the principle, , - only examples are given, and the whole is shown in detail later).

ただし、 このように分解すると、T1′とT3′は共にX軸方向
への斜交軸変換とyM力方向拡大縮小を組合せた変換で
あり、T2’は90度の回転となる。これらの変換を順
次行なうようにすると、画像メモリに特別な回路を付加
することなく、従来にない高速処理が実現される。
However, when broken down in this way, both T1' and T3' are transformations that combine oblique axis transformation in the X-axis direction and scaling in the yM force direction, and T2' is a rotation of 90 degrees. By sequentially performing these conversions, unprecedented high-speed processing can be achieved without adding any special circuit to the image memory.

何故ならば、メモリは前述したように、X軸方向へのア
クセスは高速に行なえるため、その方向の斜交軸変換も
高速に実行できる。そして、y軸方向への拡大縮小は、
−水平走査毎のアドレス更新によって実行できる(画素
毎ではない)ため、全体の処理速度には大きく影響しな
い。更に、90度の回転は簡単に実現できるから、これ
らの相乗効果として、本発明によれば、極めて小型で高
速な画像の回転が実現される。
This is because, as described above, the memory can be accessed at high speed in the X-axis direction, so that oblique axis transformation in that direction can also be performed at high speed. And the scaling in the y-axis direction is
- Since it can be executed by updating the address for each horizontal scan (not for each pixel), it does not greatly affect the overall processing speed. Furthermore, since a rotation of 90 degrees can be easily achieved, as a synergistic effect, the present invention realizes extremely compact and high-speed image rotation.

なお、分り易くするため1回転のみについて説明したが
、後述するように、一般のアフィン変換についても、本
発明は適用できる。
Although only one rotation has been described for the sake of clarity, the present invention can also be applied to general affine transformation, as will be described later.

〔実施例〕〔Example〕

以下、実施例により詳細に説明する。第1図(、)は本
発明を実現するハードウェア構成の一例を示す。図中、
10は斜交軸変換回路、20は90度回転回路、30は
画像メモリである。そして40はマイクロコンピュータ
などで実現され、全体の動作を制御するための制御部で
ある。画像メモリ30は、通常のメモリ回路であって、
この中には2値画像が格納される。
Hereinafter, it will be explained in detail using examples. FIG. 1(,) shows an example of a hardware configuration for realizing the present invention. In the figure,
10 is an oblique axis conversion circuit, 20 is a 90 degree rotation circuit, and 30 is an image memory. A control section 40 is realized by a microcomputer or the like and controls the overall operation. The image memory 30 is a normal memory circuit,
A binary image is stored in this.

一般にメモリは、Wビット(1ワード)をひとまとまり
として読み書き(アクセス)されるように構成されるの
で、2値画像を格納する場合、第2図に示すように、連
続するX方向のW画素が1ワードとして記憶される。画
像のサイズをX方向MXW画素、X方向N画素とすると
、この画像の占めるメモリの大きさは、MXNワードで
あり。
Generally, memory is configured so that W bits (one word) are read and written (accessed) as a unit, so when storing a binary image, W pixels in the is stored as one word. If the size of the image is MXW pixels in the X direction and N pixels in the X direction, the memory size occupied by this image is MXN words.

メモリのO番地から(M−1)番地までに、1番目の水
平走査線分の画像が、M番地から(2M−1)番地まで
に2番目の水平走査線分の画像が、というように、ラス
ラスキャン類(テレビジョンの走査と同じような順)に
格納される。
The image for the first horizontal scanning line is stored from memory address O to address (M-1), the image for the second horizontal scanning line is stored from address M to address (2M-1), and so on. , and are stored in a series of scans (in an order similar to television scans).

従って、このような通常のメモリ回路においては、一般
にX方向に連続する画素をまとめてアクセスすることは
不可能であるため、従来は特願昭58−204826に
示されているごとく、特別な回路を用意する必要があっ
た。
Therefore, in such a normal memory circuit, it is generally impossible to collectively access pixels that are continuous in the X direction. It was necessary to prepare.

しかし、本発明によれば、このような特殊回路を必要と
はしないことが、以下の説明によって。
However, according to the present invention, such a special circuit is not required as explained below.

明らかにされる。be revealed.

本発明では(3)式に従って、3回の変換T 1’ *
 T2’ e T3′を順に実行する。すなわち1画像
メモリ30に格納されている原画像(第3図(a))は
、斜交軸変換回路10によって、ラスクスキャンの順に
読み出され、T1′の変換を受けて、再び画像メモリ3
0に書き戻される。
In the present invention, according to equation (3), three transformations T 1' *
Execute T2' e T3' in order. That is, the original image (FIG. 3(a)) stored in the 1-image memory 30 is read out in the order of rask scan by the oblique axis conversion circuit 10, and after being converted by T1', it is read out from the image memory 3 again.
Will be written back to 0.

この中間結果画像を第3図(b)に示す。次いで、90
度回転回路20によって、この画像が読み出されT2′
の変換、すなわち90度回転されて、再び画像メモリ3
0に書き戻される(第3図(C))。そして最後に、再
び斜交軸変換回路10によって、T3′の変換が行なわ
れ、最終画像(第3図(d))が、画像メモリ30内に
出来上る。
This intermediate resultant image is shown in FIG. 3(b). Then 90
This image is read out by the degree rotation circuit 20 and T2'
, that is, rotated by 90 degrees, and then transferred to the image memory 3 again.
It is written back to 0 (Fig. 3(C)). Finally, the oblique axis conversion circuit 10 performs T3' conversion again, and the final image (FIG. 3(d)) is created in the image memory 30.

上記の処理手順は、制御回路40によって決定され、制
御回路40からの制御信号41および42によって、上
記それぞれの回路が順次起動される。
The above processing procedure is determined by the control circuit 40, and each of the above circuits is sequentially activated by control signals 41 and 42 from the control circuit 40.

ここで注目すべきことは、斜交軸変換回路10と90度
回転回路20は共に1画像メモリ3oへの読み出しも書
き込みも、X軸方向への連続画素に対するアクセスで実
行できるということである。
What should be noted here is that both the oblique axis conversion circuit 10 and the 90-degree rotation circuit 20 can perform reading and writing into one image memory 3o by accessing continuous pixels in the X-axis direction.

これによって、本発明では、y軸方向への連続画素アク
セスのための複雑な特殊回路を画像メモリ30に付加す
ることを不要としている。
As a result, the present invention eliminates the need to add a complicated special circuit to the image memory 30 for continuous pixel access in the y-axis direction.

尚、以上の説明では、斜交軸変換回路10で。In the above description, the oblique axis conversion circuit 10 is used.

X軸方向への斜交軸変換とy軸方向への拡大・縮小変換
を同時に行なう実施例について説明したが、などと分解
できることから分るように、上記2種の変換を別々に行
なうようにしてもよい。この場合の実施例の全体構成は
、第1図(b)のようになる。
Although we have described an example in which oblique axis transformation in the X-axis direction and enlargement/reduction transformation in the y-axis direction are performed at the same time, as can be seen from the fact that the above two types of transformation can be performed separately. You can. The overall configuration of the embodiment in this case is as shown in FIG. 1(b).

以下では、各部の詳細を説明することによって、この特
徴について明らかにする。
This feature will be clarified below by explaining the details of each part.

まず、第4図によってT、′の変換時の画像メモリ上の
データの動きを説明する。第4図(a)は変換前の画像
であり、ここでは1mワードXn画素の領域の画像を領
域の中心を回転中心として変換する例を示している。T
1′の式から分るように、この変換は、X軸方向へはc
otθyだけシフトすることであり、y方向へはcos
ecθ倍することになっているから、結果は第4図(b
)のようになる。
First, the movement of data on the image memory when converting T,' will be explained with reference to FIG. FIG. 4(a) shows an image before conversion, and here shows an example in which an image of an area of 1m words and Xn pixels is converted with the center of the area as the center of rotation. T
As can be seen from the equation 1', this transformation is c
It is a shift by otθy, and cos in the y direction.
Since it is supposed to be multiplied by ecθ, the result is shown in Figure 4 (b
)become that way.

この処理の様子をフローチャートで示すと、第5図のよ
うになる。今、処理領域の中心を回転中心としたから、
X軸方向へのシフト量は、cot OX k ただしkは、処理中の画素のy座標値と中心のy座標の
差(k=0.1,2−n/2)となり、この値は画像メ
モリ30のワード幅Wの整数倍とはならない。それ故こ
こでは、ワード境界にまたがる領域のデータの転送法(
ビットプロツクトランスファ法(B I TB LT)
 )として良く知られているローテート・アンド・マー
ジの方法を応用すると良い。第5図では、ステップ53
5がら570に示されるループにおいてローテート・ア
ンド・マージが実行される。
The state of this processing is shown in a flowchart as shown in FIG. Now, since the center of the processing area is the center of rotation,
The amount of shift in the X-axis direction is cot OX k. However, k is the difference between the y-coordinate value of the pixel being processed and the y-coordinate of the center (k = 0.1, 2-n/2), and this value is It is not an integral multiple of the word width W of the memory 30. Therefore, here we will discuss how to transfer data in regions that span word boundaries (
Bit block transfer method (BITBLT)
) is a good idea to apply the well-known rotate-and-merge method. In FIG. 5, step 53
Rotate and merge is performed in the loop shown at 570.

一方、y軸方向の拡大・縮小は、ステップ585によっ
て実行される。このステップ585でのアドレス決定は
、よく知られているDDAアルゴリズムに従えば良い。
On the other hand, expansion/reduction in the y-axis direction is executed in step 585. Address determination in step 585 may be performed in accordance with the well-known DDA algorithm.

例えば拡大の場合にはステップ585が実行される毎に
、cosecθの値を1回ずつ積算し、その小数部が1
を越える毎に、前回と同じ走査線上の画像データが、も
う−度繰り返して読まれるように、読出しアドレスを設
定し、そうでない場合には、っぎの走査線上の画像デー
タが読まれるようにする。このようにすれば、第4図(
b)に示したように、y軸方向に適当な間隔で、画像デ
ータの繰り返しが生じ、所定の倍率(cosecθ倍)
の拡大ができる。逆に縮小の場合も同様にy軸方向のア
ドレスの操作を行なうと。
For example, in the case of enlargement, each time step 585 is executed, the value of cosecθ is integrated once, and the decimal part is 1
Set the read address so that every time the number exceeds , the image data on the same scanning line as before is read again, and if not, the image data on the next scanning line is read. . If you do this, Figure 4 (
As shown in b), the image data is repeated at appropriate intervals in the y-axis direction, and the image data is repeated at a predetermined magnification (cosecθ times).
can be expanded. Conversely, in the case of reduction, the address in the y-axis direction is operated in the same way.

適当な間隔で間引きが生じて、所定倍率の縮小が実行さ
れる。
Thinning occurs at appropriate intervals, and reduction by a predetermined magnification is executed.

なお、処理前の画像のアドレスと処理後の画像を書込む
アドレスが重複する場合の取扱いや、画像データの端の
処理、および、シフト量Co!9eCθ×nがワード長
Wを越える場合の処理については。
In addition, how to handle cases where the address of the image before processing and the address where the image after processing is written overlap, processing of the edges of image data, and shift amount Co! Regarding the processing when 9eCθ×n exceeds the word length W.

前述のBITBLTの技法として周知であるので省略す
る。
Since the above-mentioned BITBLT technique is well known, the description thereof will be omitted.

ところで、第5図においては、1水平走査線分の処理が
終る毎に、ステップ580において、kの値の更新が行
なわれるが、これはT、′の変換式によれば、y座標が
変化した時にのみれ、X方向のシフト量が変化するとい
う事実に基づくものである(これを特徴Iと呼ぶ)。又
、この後ステップ585において、読出しアドレスの更
新が行なわれるが、これはT1′がy方向のみの拡大・
縮小であって、X方向には拡大・縮小が不要であるとい
う事実に基づくものである(これを特徴■と呼ぶ)。
By the way, in FIG. 5, each time the processing for one horizontal scanning line is completed, the value of k is updated in step 580, but this is because the y coordinate changes according to the conversion formula of T,'. This is based on the fact that the amount of shift in the X direction changes as the image changes (this is called feature I). Also, after this, in step 585, the read address is updated, but this is because T1' is expanded only in the y direction.
This is based on the fact that there is no need for enlargement or reduction in the X direction (this is called feature (2)).

これに対し従来技術では、X方向の拡大・縮小を必要と
していたため、2値画像に対しこれを実行するためには
、ワードとして読書きされる画像データに対して、その
ワード内でのビット(すなわち画素)を、間引いたり、
繰返したりという操作が必要であった。このビット操作
は、ハード量と処理時間に大きな負担となっていたが、
本発明によれば、これを取除くことができたため、小型
化と高速化が可能となった。
On the other hand, in the conventional technology, it was necessary to expand/reduce in the X direction, so in order to perform this on a binary image, it was necessary to (i.e. pixels),
Repeated operations were required. This bit manipulation was a big burden on hardware and processing time, but
According to the present invention, this can be removed, making it possible to reduce the size and increase the speed.

ここで特に強調したいことは、適切な90度回転を間に
はさむことによって、特徴■と■が大きく生かせたとい
うことである。
What I would like to particularly emphasize here is that by interposing appropriate 90 degree rotations, features (2) and (3) were brought to full use.

次に、斜交軸変換回路10を実現する方法について説明
する。斜交軸変換回路IOの動作は、第5図のフローチ
ャートによって詳述したとおりであり、これを実行する
方法として、適切な方法の1つは、マイクロプログラム
制御のプロセッサを用いることである。具体的には、A
MD社のAm29116というプロセッサが適している
。このプロセッサの演算部には、前述したローテート・
アンド・マージを実行するハードウェアが用意されてい
るため、マイクロプログラムのステップ数が少なくなり
好都合である。Am29L16によるプロセッサの回路
結成の方法については周知であり、第5図には詳細なフ
ローチャートを示したので、ここではこれ以上の説明は
しない。
Next, a method for realizing the oblique axis conversion circuit 10 will be described. The operation of the oblique axis conversion circuit IO is as detailed in the flowchart of FIG. 5, and one suitable method for performing this is to use a microprogram-controlled processor. Specifically, A
A processor called Am29116 from MD is suitable. The arithmetic unit of this processor includes the rotation and
Since hardware is available to perform the and-merge, the number of steps in the microprogram is advantageously reduced. The method of circuit implementation of the Am29L16 processor is well known and a detailed flowchart is shown in FIG. 5, so no further explanation will be given here.

第6図は、斜交軸変換回路10を実現する別の方法を示
すブロック図である。図において、100はローテート
・アンド・マージ回路であり。
FIG. 6 is a block diagram showing another method of implementing the oblique axis conversion circuit 10. In the figure, 100 is a rotate and merge circuit.

110はバレルシフタ、120はデータを一時記憶する
ためのレジスタ、130と140はマスク回路、]50
はOR回路である。第7図により動作を説明する。ここ
で同図(a)は一つ前データであるとする。データ入力
線101がら入力されたワードデータ(第7図(b)に
示すX軸方向に並ぶW画素の画像データ)は、バレルシ
フタ110によって所定ビット数ローデートされ(第7
図(d))、レジスタ120に記憶されている(ローテ
ートされた)一つ前のデータ(第7図(C))と共にそ
れぞれ、マスク回路130と140を介して、OR回路
に導かれ、ここでマージされる(第7図(e))。マス
ク回路7130と140では、2つのデータ第7図(c
)と(d)の必要部分だけ(左斜めハツチと右斜めハツ
チの部分)を取り出すために設けられている。
110 is a barrel shifter, 120 is a register for temporarily storing data, 130 and 140 are mask circuits, ]50
is an OR circuit. The operation will be explained with reference to FIG. Here, it is assumed that (a) in the figure is the previous data. Word data input through the data input line 101 (image data of W pixels lined up in the X-axis direction shown in FIG.
7(d)) and the previous data (rotated) stored in the register 120 (FIG. 7(C)) via mask circuits 130 and 140, respectively, to the OR circuit. (Fig. 7(e)). In the mask circuits 7130 and 140, two data (c
) and (d) (parts of the left diagonal hatch and right diagonal hatch).

190は実行制御回路であって、信号線41を介して、
制御回路40から回転角θや処理領域の大きさ、アドレ
スなどのパラメータを受取り、起動信号が信号線41に
来た場合には、これらパラメータに基づき、ローテート
・アンド・マージ回路100.読出アドレス発生回路1
60.書込アドレス発生回路170.セレクタ180を
、第5図のフローチャートに従って順次制御するように
なっている。すなわち、新しいデータを画像メモリ30
から読出すことが必要となった時点、そしてこのデータ
に基づきローテート・アンド・マージ回路100からの
出力データ102が現われ。
190 is an execution control circuit, and via the signal line 41,
It receives parameters such as the rotation angle θ, the size of the processing area, and the address from the control circuit 40, and when the activation signal comes to the signal line 41, the rotation and merge circuit 100. Read address generation circuit 1
60. Write address generation circuit 170. The selector 180 is sequentially controlled according to the flowchart shown in FIG. That is, new data is stored in the image memory 30.
The output data 102 from the rotate and merge circuit 100 appears based on this data.

画像メモリ30へのデータが供給可能になる時点で、そ
れぞれ実行制御回路190からは、画像メモリ30への
リード・ライト制御信号104が出力され、この時同時
に、セレクタ180からは、画像メモリ30へのアドレ
スが正しく出力されるように、制御が行なわれる。
When data can be supplied to the image memory 30, the execution control circuit 190 outputs the read/write control signal 104 to the image memory 30, and at the same time, the selector 180 outputs the read/write control signal 104 to the image memory 30. Control is performed so that the address of is output correctly.

このようにして、画像メモリ30からの読出と書込みが
進行し、制御回路40によって指定された領域分の処理
が終了すると、実行制御回路190は、信号線4Iを介
して、制御回路40に終了通知を行なった後、次の起動
信号が来るまで停止状態に入る。
In this way, reading and writing from the image memory 30 progresses, and when the processing for the area specified by the control circuit 40 is completed, the execution control circuit 190 sends the execution control circuit 190 to the control circuit 40 via the signal line 4I. After giving the notification, it enters a halt state until the next activation signal arrives.

次に、第8図によって90度回転回路20について説明
する。この回路では、画像メモリ30のワードアクセス
機能をフルに利用するよう工夫がなされている。すなわ
ち9画像メモリ30から。
Next, the 90 degree rotation circuit 20 will be explained with reference to FIG. This circuit is designed to fully utilize the word access function of the image memory 30. That is, from 9 image memory 30.

WxW画素(Wはメモリのワード幅)をまとめて読出し
て、これらをW本のレジスタに格納する。
W×W pixels (W is the word width of the memory) are read out at once and stored in W registers.

そして、これらのレジスタ上で、90度の回転を行なっ
た後1画像メモリ30にまとめて書込むというようにし
て、画像メモリ30に対しては1画素単位のアクセスや
yIIil11方向に連続する画素のワ−iへアクセス
ということが生じないようにしている(これを特徴1■
と呼ぶ)。前者のアクセス法では、処理時間が大きく増
大するし、後者のアクセス法では、特殊なメモリ回路を
必要とする。このことが、従来技術で2値画像の回転を
行なう際の大きなネックであったが、本発明によれば、
これらがすべて回避できる。
Then, after performing a 90 degree rotation on these registers, they are written all at once to one image memory 30, and the image memory 30 is accessed pixel by pixel or continuous pixels in the yIIil11 direction are accessed. This prevents access to the work-i from occurring (this is feature 1).
). The former access method significantly increases processing time, and the latter requires special memory circuitry. This was a major bottleneck when rotating binary images using conventional techniques, but according to the present invention,
All of these can be avoided.

第8図において、210−1〜210−WはW木の並列
入力直列出力型のシフトレジスタ(ワード幅はWビット
)であり、26oはWビットの幅のレジスタである。こ
れらのレジスタは1画像データの90度回転を実行する
In FIG. 8, 210-1 to 210-W are W-tree parallel input serial output type shift registers (word width is W bits), and 26o is a W bit wide register. These registers perform a 90 degree rotation of one image data.

実行制御回路250の制御の下で続出アドレス発生回路
220から出力されるアドレスによって。
by the address output from successive address generation circuit 220 under the control of execution control circuit 250.

画像メモリ20のデータが、データ入力線20+を介し
て、Wワード分連続して読出され、順次シフトレジスタ
210−1〜210−Wにロードされる。これにより、
シフトレジスタ210には、WxW画素分の局所局な画
像データが入る。次に、実行制御回路250は、W本の
シフトレジスタ210を一斉に1ビツトだけシフトし、
このデータを並列にレジスタ260にロードする。この
ようにすれば、レジスタ260には、210の左端のW
ピット分が入るから、これでWxW画素中の左端W画素
分が90度回転したことになる。こうして得られた画像
データは、後で説明するセレクタ280とデータ出力線
202を介して1画像メモリ20のしかるべきアドレス
(書込アドレス発生回路230で発生)に書込まれる。
W words of data from the image memory 20 are continuously read out via the data input line 20+ and sequentially loaded into the shift registers 210-1 to 210-W. This results in
The shift register 210 stores local image data for W×W pixels. Next, the execution control circuit 250 shifts the W shift registers 210 by one bit all at once,
This data is loaded into registers 260 in parallel. In this way, the leftmost W of register 210 is stored in register 260.
Since the pit portion is included, this means that the leftmost W pixel among the W×W pixels has been rotated by 90 degrees. The image data thus obtained is written to an appropriate address (generated by write address generation circuit 230) of one image memory 20 via selector 280 and data output line 202, which will be described later.

そして、次にはシフトレジスタ210が再び一斉に1ビ
ツトシフトされ、このデータ(左から2列目の画素)が
並列にレジスタ260にロードされることによって回転
し、上記と同様に画像メモリ30に書込まれる。この動
作をW回繰返してWXW画素の90度回転が終了する。
Then, the shift registers 210 are again shifted by one bit all at once, and this data (pixels in the second column from the left) is loaded in parallel into the register 260, rotated, and written to the image memory 30 in the same way as above. be included. This operation is repeated W times to complete the 90 degree rotation of the WXW pixel.

この一連の処理の後、続出アドレスの更新を行って1次
のWXW画素のブロックの処理に進む。
After this series of processing, successive addresses are updated and processing proceeds to the first WXW pixel block.

この様は第9図と第10図によって説明される。This situation is explained with reference to FIGS. 9 and 10.

第9図に示したように、上述のシフトレジスタ210の
働きによってWxW画素のデータ(図ではW=4の例を
示す)が、同図(a)を入力として、同図(b)のよう
に、A列(1,5,9゜13の画素列)、B列、6列、
D列の順に出力され、ブロック内での90度回転が実行
される。従って、これらのデータを、第】0図にブロッ
ク番号で示すように、左下隅のwxw画素のブロック■
を処理するときは、左下隅のブロックに書込み、以下類
に■、■・・・・・・のように、読出アドレス(a)と
書込アドレス(b)を制御すれば、画像全体が正しく9
0度回転される。読出アドレス発生回路220.書込ア
ドレス発生回路230.セレクタ240、そしてリード
・ライト信号線203はこのような手順を実行すべく、
実行制御回路250によって制御され、画像メモリ3o
へ。
As shown in FIG. 9, by the function of the shift register 210 described above, WxW pixel data (the example of W=4 is shown in the figure) is transferred as shown in FIG. In, column A (1, 5, 9° 13 pixel columns), column B, column 6,
The data is output in the order of column D, and a 90 degree rotation within the block is performed. Therefore, these data are divided into blocks of wxw pixels in the lower left corner, as shown by the block numbers in Figure 0.
When processing, write to the block in the lower left corner, and control the read address (a) and write address (b) as shown below, and the entire image will be correct. 9
Rotated 0 degrees. Read address generation circuit 220. Write address generation circuit 230. The selector 240 and the read/write signal line 203 perform these procedures.
Controlled by the execution control circuit 250, the image memory 3o
fart.

適切なアドレスとリード・ライト信号を供給する。Provide appropriate address and read/write signals.

セレクタ280の役割は、左90度回転と右90度回転
の切替えであり、やはり実行制御部250によって切替
えられる(右と右の切替が何故必要かは後に説明する)
。この逆方向への回転を行なうためにレジスタ270が
設けられており。
The role of the selector 280 is to switch between 90 degrees left rotation and 90 degrees right rotation, which is also switched by the execution control unit 250 (the reason why switching between right and left is necessary will be explained later).
. A register 270 is provided to perform this rotation in the opposite direction.

これは、はぼ220と同様の動作をする。This operates similarly to the robot 220.

先程の説明では、第9図からも分るように1画像は左へ
90度回転するが5右へ回転する場合には、シフトレジ
スタ群210を右へシフトし、出てきたデータをレジス
タ270に入れる。そしてセレクタ280でこのレジス
タ270の出力を選択すれば、先に述べたものと逆の関
係になって、画像は右へ90度回転する。これら一連の
制御は、制御回路40から、信号線42を介して伝えら
れるパラメータに基づき、実行制御回路250によって
行なわれる。
In the previous explanation, as can be seen from FIG. 9, one image is rotated 90 degrees to the left, but if the image is rotated five times to the right, the shift register group 210 is shifted to the right, and the resulting data is transferred to the register 270. Put it in. If the selector 280 selects the output of the register 270, the image will be rotated 90 degrees to the right in the opposite relationship to that described above. These series of controls are performed by the execution control circuit 250 based on parameters transmitted from the control circuit 40 via the signal line 42.

又、前述の斜交軸変換回路10で説明したのと同じよう
に1本回路においても、信号線42を介して、起動と終
了報告がなされる。
Further, in the same way as explained in the above-mentioned oblique axis conversion circuit 10, even in a single circuit, activation and termination reports are made via the signal line 42.

上記の動作説明から明らかなように、90度回転回路も
又、Am29116のようなマイクロプログラム制御方
式のプロセッサで実現することが可能である。この場合
でも、プロセッサは一般に、メモリアクセスに比べ、レ
ジスタアクセスの方が。
As is clear from the above operational description, the 90 degree rotation circuit can also be implemented with a microprogram controlled processor such as the Am29116. Even in this case, processors generally prefer register accesses compared to memory accesses.

はるかに高速であるため1本発明に従えば、マイクロプ
ログラムで実行するようにしても、極めて高速であり、
又小型の回路を提供することができる。
Because it is much faster, 1 According to the present invention, even if it is executed by a microprogram, it is extremely fast,
Furthermore, a compact circuit can be provided.

次に、本発明においてなされた、もう1つの工夫につい
て説明する。
Next, another device made in the present invention will be explained.

これまでの説明では、(3)式に基づいて画像の回転を
行なうことを説明してきたが、より詳細に言うと、回転
角度(−π≦θ≦π)によって、次のように4つの場合
分けし、それぞれに応じた式を用いるのが良い。
In the explanation so far, we have explained that the image is rotated based on equation (3), but in more detail, there are four cases depending on the rotation angle (-π≦θ≦π) as follows. It is best to separate them and use the appropriate formula for each.

ただし、 ただし、 尚、場合(d)が先に説明してきたものであって(7)
式は(3)式と同じものである。
However, if case (d) is the one explained earlier, then (7)
The equation is the same as equation (3).

この場合分け、すなわち(1)式の分解方法では、2つ
のことを考慮している。
In this case division, that is, in the decomposition method of equation (1), two things are taken into consideration.

■ 係数が極度に大きくなったり、極度に小さくなった
りしないこと。
■ Coefficients should not be extremely large or extremely small.

■ 拡大と縮小の鼻合せになるので、先に拡大が施され
るようにすること。
■ Enlargement and reduction will be done at the same time, so make sure that the enlargement is done first.

■は、変換の途中で中間結果画像に大きな歪を与えると
、最終結果において雑音の多い画像となるということを
避ける為である。直感的説明として言うなら、−度極端
に偏平にしてしまった画像は、次の変換で元に戻しても
、元通りにならないということである。又、実際の処理
の上でも、中間結果が、極端に大きくなると、中間画像
を書込む画像メモリ30の容量を浪費することになり、
実用的とは言えないので、このことは重要である。
(2) is to avoid that if large distortion is applied to the intermediate result image during the conversion, the final result will be a noisy image. An intuitive explanation is that an image that has been extremely flattened by -degrees will not return to its original state even if it is restored in the next transformation. Furthermore, in actual processing, if the intermediate result becomes extremely large, the capacity of the image memory 30 in which the intermediate image is written will be wasted.
This is important because it is not practical.

もっと重要な本発明の特徴の1つは■であって、(4)
〜(7)式を見ると分るように、y軸方向の拡大が最初
に来るようにして、拡大の後縮小が行なわれるようにし
である(これを特徴■と呼ぶ)。
One of the more important features of the present invention is (4)
As can be seen from equation (7), the expansion in the y-axis direction comes first, and the reduction is performed after the expansion (this is called feature (2)).

これにより回転処理後の画像の品質を高く保つことがで
きる。
This makes it possible to maintain high quality of the image after rotation processing.

一般にディジタル画像処理では、画像を有限個の画素に
分解して処理するため、縮小を行なうと当然画素数が減
少する。その結果、情報が失われるから、これを再び拡
大する場合に、失なわれた情報を取り戻すことができず
、画質が劣化する。
Generally, in digital image processing, an image is processed by dividing it into a finite number of pixels, so when the image is reduced, the number of pixels naturally decreases. As a result, information is lost, and when the image is enlarged again, the lost information cannot be recovered and the image quality deteriorates.

本発明では、拡大を先に行なうようにしたため、このよ
うな画質劣化を生ずることがない。
In the present invention, since the enlargement is performed first, such image quality deterioration does not occur.

ところで1回転・拡大・縮小・平行移動などを一般個し
たものが、アフィン変換として知られている。アフィン
変換の式は、 で表されるが、E、Fについては単なる平行移動なので
、処理上問題は少く、すでにBITBLTとして解決さ
れている。そこで、 の変換をどうするかであるが、(9)式は例えば。
By the way, a general combination of one rotation, enlargement, reduction, translation, etc. is known as an affine transformation. The affine transformation formula is expressed as follows, but since E and F are simply parallel movements, there are few processing problems, and they have already been solved as BITBLT. Therefore, the question is how to convert .Equation (9) is, for example.

T=T、’xT2’xT1’    ・=(to)ただ
し。
T=T, 'xT2'xT1' ・=(to) However.

あるいは。or.

’r=’r4’x’r3’x’r2’x’r1’   
−(11)ただし、 などというように分解できるから、(4)〜(7)式の
場合分けのときに説明したのと同じ方針に従って、本発
明を適用することができる。
'r='r4'x'r3'x'r2'x'r1'
- (11) However, since it can be decomposed as follows, the present invention can be applied according to the same policy as explained when dividing the cases of equations (4) to (7).

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

以上詳述したように、特に特徴■〜■として述べた効果
により本発明によれば1通常のワード構成のメモリに2
値画像を格納し、その回転あるいはアフィン変換を実行
する際1回路を複雑にせず。
As described in detail above, the present invention provides two functions in one normal word-structured memory, particularly due to the effects described in features (■) to (■).
It is possible to store a value image and perform its rotation or affine transformation without complicating one circuit.

画像メモリの構造に適したワード単位のアクセスを最大
限に生かした極めて高速の処理方法ならびに装置を得る
ことができる。
It is possible to obtain an extremely high-speed processing method and device that makes maximum use of word-by-word access suitable for the structure of an image memory.

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

第1図は本発明の全体構成図、第2図〜第4図は本発明
の詳細な説明するための図、第5図〜第7図は本発明の
斜交軸変換回路の説明図、第8図〜第10図は本発明の
90度回転回路の説明図である。 10・・・斜交軸変換回路、20・・・90度回転回路
。 30・・・画像メモリ、40・・・制御部。 郊11!1 C(2) (ト) (ν) (e) 葉ヂ国 (b) 1/θ図 (a) (b)
FIG. 1 is an overall configuration diagram of the present invention, FIGS. 2 to 4 are diagrams for explaining the present invention in detail, and FIGS. 5 to 7 are explanatory diagrams of the oblique axis conversion circuit of the present invention. 8 to 10 are explanatory diagrams of the 90 degree rotation circuit of the present invention. 10... Oblique axis conversion circuit, 20... 90 degree rotation circuit. 30... Image memory, 40... Control unit. Suburb 11!1 C (2) (g) (ν) (e) Leaf country (b) 1/θ diagram (a) (b)

Claims (1)

【特許請求の範囲】 1、直交座標系で記憶されている画像データに対し、そ
れぞれx軸方向へずれた平行四辺形に変換(斜交軸変換
)する第1のステップと、y軸方向への拡大あるいは縮
小を実行する第2のステップと、90度回転する第3の
ステップを交互に所定回数実行することを特徴とする、
画像のアフィン変換処理方法。 2、上記第1のステップと第2のステップを同時に1つ
のステップとして実行するようにしたことを特徴とする
特許請求の範囲第1項記載の、画像のアフィン変換処理
方法。 3、上記90度回転は、メモリのワード長を1辺とする
正方形のエリアを単位として実行するようにしたことを
特徴とする特許請求の範囲第1項又は第2項記載の画像
のアフィン変換処理方法。 4、画像を格納するメモリと、この画像に対して画素が
連続してワードとして記憶される方向への斜交軸変換を
施す第1の回路と、画像に対して前記と直角方向への拡
大・縮小を施す第2の回路と、画像に対して90度の回
転を施す第3の回路から成る、画像のアフィン変換装置
。 5、上記第1の回路と第2の回路は、統合化された第4
の回路で置換されたことを特徴とする、特許請求の範囲
第4項記載の画像のアフィン変換装置。 6、上記90度回転回路は、メモリのワード長を一辺と
する正方形のエリアの画像をブロックとして一度に読み
込み、該回路内で90度回転を行なった後、ブロックと
して一度に画像メモリに書込むようにしたことを特徴と
する特許請求の範囲第4項記載の画像のアフィン変換装
置。 7、画像データのアフィン変換を施す際に、これをいく
つかのステップに分けて実行する方法であって、その第
1のステップを、ある軸方向への斜交軸変換と、その軸
と直交する方向への拡大処理を同時に行うステップとし
たことを特徴とする、画像のアフィン変換処理方法。
[Claims] 1. A first step of converting the image data stored in the orthogonal coordinate system into parallelograms shifted in the x-axis direction (oblique axis transformation) and in the y-axis direction. A second step of enlarging or reducing the image and a third step of rotating it by 90 degrees are alternately executed a predetermined number of times.
Affine transformation processing method for images. 2. The image affine transformation processing method according to claim 1, wherein the first step and the second step are executed simultaneously as one step. 3. Affine transformation of an image according to claim 1 or 2, wherein the 90 degree rotation is executed in units of square areas whose sides are word lengths of the memory. Processing method. 4. A memory for storing an image, a first circuit that performs oblique axis transformation on this image in a direction in which pixels are successively stored as words, and an enlargement of the image in a direction perpendicular to the above direction. - An affine transformation device for images, consisting of a second circuit that performs reduction and a third circuit that rotates the image by 90 degrees. 5. The first circuit and the second circuit are integrated into a fourth circuit.
5. The image affine transformation device according to claim 4, wherein the image affine transformation device is replaced with a circuit. 6. The above 90 degree rotation circuit reads the image of a square area whose side is the word length of the memory at once as a block, performs a 90 degree rotation within the circuit, and then writes it to the image memory as a block at once. An image affine transformation device according to claim 4, characterized in that the image affine transformation device is configured as follows. 7. A method of performing affine transformation of image data in several steps, the first step of which is an oblique axis transformation in a certain axis direction and an orthogonal axis transformation to that axis. A method for processing an affine transformation of an image, characterized in that the step includes simultaneously performing enlargement processing in a direction in which the image is enlarged.
JP62289318A 1987-11-18 1987-11-18 Method and device for processing affine transformation of image Pending JPH01131971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62289318A JPH01131971A (en) 1987-11-18 1987-11-18 Method and device for processing affine transformation of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62289318A JPH01131971A (en) 1987-11-18 1987-11-18 Method and device for processing affine transformation of image

Publications (1)

Publication Number Publication Date
JPH01131971A true JPH01131971A (en) 1989-05-24

Family

ID=17741637

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62289318A Pending JPH01131971A (en) 1987-11-18 1987-11-18 Method and device for processing affine transformation of image

Country Status (1)

Country Link
JP (1) JPH01131971A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61221881A (en) * 1985-03-27 1986-10-02 Fuji Xerox Co Ltd Picture revolving device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61221881A (en) * 1985-03-27 1986-10-02 Fuji Xerox Co Ltd Picture revolving device

Similar Documents

Publication Publication Date Title
US5335296A (en) Process for high speed rescaling of binary images
JPH10304184A (en) Image processor and image processing method
US5263135A (en) Image processing apparatus
JPH0810462B2 (en) Image processing device
US4768029A (en) Video display system with graphical cursor
EP0230352B1 (en) Graphic and data display system
JPH01131971A (en) Method and device for processing affine transformation of image
JPH0481231B2 (en)
JP3154741B2 (en) Image processing apparatus and system
JPH0525143B2 (en)
JPS58138163A (en) Picture signal rotating system
JPH026106B2 (en)
JPS6156555B2 (en)
JPH07122899B2 (en) High speed rotation circuit
JPS62177676A (en) Picture processor
JPH0520450A (en) Picture processor
JP2512252B2 (en) Image scaling device
GB2210760A (en) Image rotation circuit
JP2797660B2 (en) Pixel correction method
JPH0833919B2 (en) Image processing apparatus and method
JPH07146932A (en) Image display device
JPH0969155A (en) Image processor and method therefor
JPS61223986A (en) Picture processing method
JPH04329482A (en) Image rotation processing method and processing device for relevant method
JPS6220074A (en) Image processing method