JPH0481231B2 - - Google Patents
Info
- Publication number
- JPH0481231B2 JPH0481231B2 JP58204827A JP20482783A JPH0481231B2 JP H0481231 B2 JPH0481231 B2 JP H0481231B2 JP 58204827 A JP58204827 A JP 58204827A JP 20482783 A JP20482783 A JP 20482783A JP H0481231 B2 JPH0481231 B2 JP H0481231B2
- Authority
- JP
- Japan
- Prior art keywords
- image
- data
- memory
- axis
- angle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 230000015654 memory Effects 0.000 claims description 52
- 230000009466 transformation Effects 0.000 claims description 50
- 238000000034 method Methods 0.000 claims description 27
- 238000006243 chemical reaction Methods 0.000 claims description 26
- 238000003672 processing method Methods 0.000 claims 1
- 238000011946 reduction process Methods 0.000 claims 1
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 12
- 238000000844 transformation Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000007796 conventional method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000000354 decomposition reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000011426 transformation method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/60—Rotation of whole images or parts thereof
- G06T3/608—Rotation of whole images or parts thereof by skew deformation, e.g. two-pass or three-pass rotation
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Controls And Circuits For Display Device (AREA)
- Image Processing (AREA)
- Storing Facsimile Image Data (AREA)
- Editing Of Facsimile Originals (AREA)
Description
【発明の詳細な説明】
〔発明の利用分野〕
本発明はデイジタル画像処理における、画像の
回転法および装置に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to an image rotation method and apparatus in digital image processing.
回転は、画像処理分野における基本的な処理の
1つで、たとえばフアクシミリにおける入力原稿
の傾き補正、印鑑照合における印影の重ね合わせ
(たとえば、「図心に関する周辺密度の相関を利用
した印影パターンの位置合わせ法」、著者金子透
氏他、電子通信学会、IE81−13、37ページ〜42
ページなどのような方式)等に必要である。
Rotation is one of the basic processes in the field of image processing, such as correcting the tilt of an input document in facsimile, superimposing seal impressions in seal matching (for example, ``positioning of a seal pattern using the correlation of peripheral density with respect to the centroid''). "Matching Method", author Toru Kaneko et al., Institute of Electronics and Communication Engineers, IE81-13, pages 37-42
This is necessary for methods such as pages, etc.
回転の方法に関しては、従来、アフイン変換に
よる方法と、斜交軸変換による方法が、代表的で
ある。アフイン変換による方式は、式
X
Y=cosθ
sinθ−sinθ
cosθx
y …(1)
により座標変換を行うものである。ここに(x
y)
は原画像中の座標、(X
Y)は回転後の画像(以下、
回転画像と略す)中の座標、θは回転角である。
変換(1)は幾何学における回転変換の定義式自身で
あり、回転画像に歪みを生じないが、変換(1)の計
算には時間を要する。このため、この回転方法
は、高速化が困難である欠点があつた。斜交軸変
換による方法は、縦方向および横方向の2回の斜
交軸変換により、回転のアフイン変換(1)を近似す
るもので、「画像の回転方法」(特開昭55−95145、
発明者宮井均氏)等に詳しい。具体的には、縦方
向斜交軸変換
x′
y′=1
tanθ0
1x
y …(2)
および
X
Y=1
0−tanθ
1x′
y′ …(3)
より
X
Y=1
0−tanθ
11
tanθ0
1x
y=1−tan2θ
tanθ−tanθ
1x
y …(4)
で変換(1)を近似する。斜交軸変換(2)および(3)は、
変換(1)に比べて高速処理が可能である。このため
本回転方法は、アフイン変換による方法に比べて
高速である。ただし、回転角θの増大と共に回転
画像が歪む(たとえばθ=π/4で正方形が、1頂
角がπ/4の平行四辺形となる)等の欠点があつた。 Conventionally, typical methods of rotation include a method using affine transformation and a method using oblique axis transformation. The affine transformation method performs coordinate transformation using the formula X Y = cos θ sin θ - sin θ cos θx y (1). Here (x y)
are the coordinates in the original image, (X Y) are the rotated image (hereinafter,
(referred to as a rotated image), θ is the rotation angle.
Transformation (1) is the definition of rotational transformation in geometry itself, and does not cause distortion in the rotated image, but calculation of transformation (1) takes time. Therefore, this rotation method has the disadvantage that it is difficult to increase the speed. The method using oblique axis transformation approximates the affine transformation (1) of rotation by performing oblique axis transformation twice in the vertical and horizontal directions, and is described in "Image Rotation Method" (Japanese Patent Application Laid-Open No. 55-95145,
(Inventor Hitoshi Miyai) etc. Specifically, from the vertical oblique axis transformation x'y'=1 tanθ0 1x y...(2) and X Y=1 0-tanθ 1x'y'...(3), 1x y=1-tan 2 θ tanθ-tanθ 1x y (4) Approximate transformation (1). Oblique axis transformations (2) and (3) are
Faster processing is possible than conversion (1). Therefore, this rotation method is faster than a method using affine transformation. However, as the rotation angle θ increases, the rotated image becomes distorted (for example, when θ=π/4, a square becomes a parallelogram with one vertex angle of π/4).
本発明の目的は、以上の如き従来方式の欠点を
解消し、高速処理可能でかつ回転画像に歪みを生
じない画像回転方式を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to eliminate the drawbacks of the conventional methods as described above, and to provide an image rotation method that is capable of high-speed processing and does not cause distortion in rotated images.
本発明は、上記目的を達成するために、以下の
考え方に基づいてなされたものである。
In order to achieve the above object, the present invention has been made based on the following idea.
通常、画像を各種処理のためにメモリに格納す
る場合、画像上横または縦方向に連続する画素
を、メモリ上連続アドレスをもつ領域に対応させ
る。特に2値画像の場合、横または縦方向に連続
する画素を、1ワードとして読み書きできるのが
普通である。前記従来アフイン変換による方法
が、高速化困難であるのは、前記変換(1)で原画像
をメモリ上アドレスが連続している画素の順に読
み出しても、一般に変換画像はメモリ上、1画素
単位にアドレスが連続していないメモリ領域に書
き込まねばならないためである。逆に前記斜交軸
変換による方法が高速化できるのは、前記変換(2)
および(3)で原画像の連続領域が、変換画像の連続
領域に一部画像境界部を除いて対応するためであ
る。従つて特に1ワードが複数画素の情報をもつ
2値画像を対象とするとき、アフイン変換は1画
素単位の処理しかできず効率が悪いが、斜交軸変
換は1ワード単位の処理が可能であり効率がよ
い。このような意味で高速処理可能な変換方式と
しては、上記斜交軸変換の外、横または縦方向の
拡大縮小変換がある。 Normally, when an image is stored in a memory for various processing, pixels that are continuous in the horizontal or vertical direction on the image are made to correspond to areas having continuous addresses on the memory. Particularly in the case of binary images, pixels that are continuous in the horizontal or vertical direction can usually be read and written as one word. The reason why it is difficult to increase the speed of the conventional affine conversion method is that even if the original image is read out in the order of pixels with consecutive addresses in the memory in the conversion (1), the converted image is generally stored in memory in units of one pixel. This is because the address must be written to a memory area that is not consecutive. On the other hand, the method using the oblique axis transformation can be speeded up by the transformation (2)
This is because in (3), the continuous area of the original image corresponds to the continuous area of the converted image, excluding some image boundaries. Therefore, especially when dealing with a binary image in which one word contains information for multiple pixels, affine transformation can only process one pixel unit and is inefficient, but oblique axis transformation can process one word unit. Yes, it is efficient. In this sense, conversion methods capable of high-speed processing include horizontal or vertical scaling conversion in addition to the above-mentioned oblique axis conversion.
本発明の要点は、アフイン変換1が、上記斜交
軸変換、および上記拡大縮小変換の組合せで表現
できることに着目し、これらの変換を順次実行す
ることにより変換(1)を実行する点にある。組合わ
された変換は、アフイン変換(1)と同値のため変換
画像に歪みを生じない。組合わせに用いる各変換
は、既述のとおり高速処理でき、結果として回転
処理の高速化が期待できる。 The gist of the present invention is to focus on the fact that affine transformation 1 can be expressed by a combination of the above-mentioned oblique axis transformation and the above-mentioned scaling transformation, and to perform transformation (1) by sequentially performing these transformations. . Since the combined transformation is equivalent to the affine transformation (1), no distortion occurs in the transformed image. Each transformation used for combination can be processed at high speed as described above, and as a result, speeding up of rotation processing can be expected.
以下、本発明を実施例により詳細に説明する。 Hereinafter, the present invention will be explained in detail with reference to Examples.
回転を表すアフイン変換(1)については、1例と
して
する分解が成立する。(ただし−π/4θπ/4)
よつて変換(1)は、縦(y)方向斜交軸変換
x1
y1=1
tanθ0
1x
y (6)
縦方向縮小変換
x2
y2=1
00
cosθx1
y1 (7)
横(x)方向拡大変換
横方向斜交軸変換
X
Y=1
0−tanθ
1x3
y3 (9)
の4つの変換を順次実行することにより実現でき
る。変換(1)に同値な斜交軸変換と拡大縮小変換の
組は、他にも存在するが、変換の回数は上例のよ
うに4回が最小である。変換(6)〜(9)の概略の様子
を、第1図に示す。 For affine transformation (1) that represents rotation, as an example, The decomposition holds true. (However, -π/4θπ/4) Therefore, transformation (1) is vertical (y) direction oblique axis transformation x 1 y 1 = 1 tanθ0 1x y (6) Vertical direction reduction transformation x 2 y 2 = 1 00 cosθx 1 y 1 (7) Horizontal (x) direction expansion conversion This can be realized by sequentially executing four transformations: horizontal oblique axis transformation X Y=1 0-tanθ 1x 3 y 3 (9). There are other sets of oblique axis transformation and scaling transformation that are equivalent to transformation (1), but the minimum number of transformations is four as in the above example. The outline of conversions (6) to (9) is shown in FIG.
ただし、本発明で対象とするデイジタル画像で
は、その濃度は標本化された座標上でのみ定義さ
れるので、変換(6)〜(9)を実際に実行するには補間
が必要である。ここでは補間法に最近傍点選択法
(例えば「計算機による画像の回転シミユレーシ
ヨン」、著者景山氏、昭和55年度電子通信学会総
合全国大会、No.1067)を用いる。変換(6)〜(9)を実
際には、次の手順で実現する。以下の説明では、
座標の単位を上記の標本点の間隔にとる。 However, in the digital image targeted by the present invention, the density is defined only on the sampled coordinates, so interpolation is required to actually execute transformations (6) to (9). Here, the nearest neighbor point selection method (for example, "Computer-based Image Rotation Simulation", author Mr. Kageyama, 1981 National Conference of the Institute of Electronics and Communication Engineers, No. 1067) is used as the interpolation method. Conversions (6) to (9) are actually realized by the following steps. In the following explanation,
The unit of coordinates is the interval between the sample points above.
〔ステツプ1〕
整数値m,nに対して、変換(6)を施し、x1,n,o,
y1,n,oを得る。すなわち
x1,n,o
y1,n,o=1
tanθ0
1m
n
なる座標変換を行う。[Step 1] Apply transformation (6) to the integer values m and n, and x 1,n,o ,
Get y 1,n,o . That is, coordinate transformation is performed such that x 1,n,o y 1,n,o = 1 tanθ0 1m n .
次に、x1,n,o,y1,n,oを四捨五入により整数化し
て結果をそれぞれm1,n1とする。(補間処理)。 Next, x 1,n,o and y 1,n,o are rounded off to integers, and the results are set as m1 and n1, respectively. (Interpolation processing).
最後に変換画像の座標(m1
n1)の画素濃度を、
被変換画像の座標(m
n)の画素濃度とする。 Finally, the pixel density of the coordinates (m1 n1) of the converted image is
Let it be the pixel density at the coordinates (m n) of the image to be transformed.
〔ステツプ2〕
整数値m1,n1に対して、変換(7)を施し、
x2,n1,o1,y2,n1,o1を得る。すなわち
x2,n1,o1
y2,n1,o1=1
00
cosθm1
n1
なる座標変換を行う。[Step 2] Apply conversion (7) to the integer values m1 and n1,
Obtain x 2,n1,o1 and y 2,n1,o1 . That is, coordinate transformation is performed such that x 2,n1,o1 y 2,n1,o1 =1 00 cosθm1 n1.
次に、x2,n1,o1,y2,n1,o1を四捨五入により整数化
して結果をそれぞれm2,n2とする。 Next, x 2, n1, o1 and y 2, n1, o1 are rounded off to integers, and the results are set as m2 and n2, respectively.
最後に変換画像の座標(m2
n2)の画素濃度を、
被変換画像の座標(m1
n1)の画素濃度とする。 Finally, the pixel density at the coordinates (m2 n2) of the converted image is
Let it be the pixel density at the coordinates (m1 n1) of the image to be transformed.
〔ステツプ3〕
整数値m2,n2に対して、変換(8)を施し、
x3,n2,o2,y3,n2,o2を得る。すなわち
なる座標変換を行う。[Step 3] Apply conversion (8) to the integer values m2 and n2,
Obtain x 3,n2,o2 and y 3,n2,o2 . i.e. Perform the coordinate transformation.
次に、x3,n2,o2,y3,n2,o2を四捨五入により整数化
して、結果をそれぞれm3,n3とする。 Next, x 3,n2,o2 and y 3,n2,o2 are rounded off to integers, and the results are set as m3 and n3, respectively.
最後に変換画像の座標(m3
n3)の画素濃度を、
被変換画像の座標(m2
n2)の画素の濃度とする。 Finally, the pixel density of the coordinates (m3 n3) of the converted image is
Let it be the density of the pixel at the coordinates (m2 n2) of the image to be transformed.
〔ステツプ4〕
整数値m3,n3に対して変換(9)を施し、Xn3,o3,
Yn3,o3を得る。すなわち
Xn3,o3
Yn3,o3=1
0−tanθ
1m3
n3
なる座標変換を行う。[Step 4] Apply conversion (9) to the integer values m3, n3, and obtain X n3,o3 ,
Y get n3,o3 . That is, coordinate transformation is performed as follows: X n3,o3 Y n3,o3 =1 0-tanθ 1m3 n3.
次に、Xn3,o3,Yn3,o3を四捨五入により整数化
して、結果をそれぞれM,Nとする。 Next, X n3,o3 and Y n3,o3 are rounded off to integers, and the results are M and N, respectively.
最後に変換画像の座標(M
N)の画素の濃度を、
被変換画像の座標(m3
n3)の画素の濃度とする。 Finally, the density of the pixel at the coordinates (M N) of the converted image is
Let it be the density of the pixel at the coordinates (m3 n3) of the image to be transformed.
以上のステツプにおける変換および被変換画像
の画素の対応を、第2図に示す。図中1〜10は
画素番号で、同一番号をもつ画素が対応する画素
である。 The conversion in the above steps and the correspondence between the pixels of the converted image are shown in FIG. In the figure, 1 to 10 are pixel numbers, and pixels with the same number are corresponding pixels.
上記ステツプ1およびステツプ3では、被変換
画像上で縦方向に連続する画素の組は、変換画像
上で縦方向に連続する画素の組としてそのまま現
れる。また、ステツプ2およびステツプ4では、
被変換画像上で横方向に連続する画素の組は、変
換画像上で横方向に連続する画素の組としてその
まま現れる。従つて、座標計算が簡単なばかりで
なく、特に対象が2値画像のとき、縦または横に
連続するN画素を1ワードとして読み書きできる
装置を使えば、処理はさらに高速化できる。以
下、本条件を満足する装置の構成の1例を説明す
る。 In steps 1 and 3 above, a set of pixels that are continuous in the vertical direction on the image to be converted appears as a set of pixels that are continuous in the vertical direction on the converted image. Also, in step 2 and step 4,
A set of pixels that are continuous in the horizontal direction on the converted image appears as is as a set of pixels that are continuous in the horizontal direction on the converted image. Therefore, not only is coordinate calculation simple, but especially when the target is a binary image, processing can be further speeded up by using a device that can read and write N vertically or horizontally continuous pixels as one word. An example of the configuration of an apparatus that satisfies this condition will be described below.
第3図は、本発明を実現する装置の全体構成を
示す。図中、101はマイクロプロセツサまたは
マイクロプログラム制御プロセツサから成る処理
部、102は処理部101のプログラムとテーブ
ル等の数値データを格納するプログラムメモリ、
103は画像入力装置、104は画像出力装置、
105は画像データを格納する画像メモリ、10
6はデータ、アドレスおよびコントロール信号用
バスを示す。 FIG. 3 shows the overall configuration of a device that implements the present invention. In the figure, 101 is a processing section consisting of a microprocessor or a microprogram control processor, 102 is a program memory for storing programs of the processing section 101 and numerical data such as tables;
103 is an image input device, 104 is an image output device,
105 is an image memory for storing image data; 10
6 indicates a bus for data, address and control signals.
画像メモリ105は、次の機能を有する。 Image memory 105 has the following functions.
(B−1)指定した画素座標を左端または上端
として、指定したアクセス方向(横または縦)に
連続するN画素に同時にアクセスする。ここにN
はデータバスのデータ巾(ワード長)を示す。1
ワード内のビツトと画素の対応は、両端がそれぞ
れ、LSB(Least Singnificant Bit)に対応
する順序とする。 (B-1) Simultaneously access N pixels that are continuous in the specified access direction (horizontal or vertical) with the specified pixel coordinates as the left end or top end. N here
indicates the data width (word length) of the data bus. 1
The correspondence between bits and pixels within a word is such that each end corresponds to an LSB ( LSB ) .
(B−2)前記(B−1)における指定画素座標
は、横および縦の2次元アドレス指定とする。(B-2) The specified pixel coordinates in the above (B-1) are specified as horizontal and vertical two-dimensional addresses.
以下簡単のためワード長Nを4として説明す
る。前記(B−1)を実現するために、画像メモ
リは4個のメモリモジユールから構成し、任意の
横方向または縦方向に連続する4画素がそれぞれ
相異なるメモリモジユールに格納されるように、
画素とメモリモジユールを対応づける。画像左上
を原点、右横方向をx軸、下縦方向をy軸と定義
するとき、座標(x,y)である画素を格納すべ
きメモリモジユール番号μを、
μ=(x+y)4 (10)
とすると、前記画素とメモリモジユールの対応を
満足できる。ここに、は除算の剰余をとる演算
である。また、座標(x,y)である画素を格納
すべきメモリモジユール内のアドレスαを、
α=mxy+〔×/4〕 (11)
とすると、相異なる画素が同一のメモリモジユー
ルでかつ同一のメモリモジユール内アドレスとな
ることなく、画素とメモリモジユール内アドレス
の対応を決定できる。ここに、〔 〕は小数点以
下切捨てによる整数化、mは4×mが画像メモリ
横巾となる画像メモリ固有の定数である。第4図
aは、式(10)による画素とメモリモジユール番号の
対応、同図bは式(11)による画素とメモリモジユー
ル内アドレスの対応を模式的に示す。図中、20
1はx座標2、y座標3の画素であり、第1メモ
リモジユールの第6番地に格納される。ただし、
mは2とする。 The following description will be made assuming that the word length N is 4 for the sake of simplicity. In order to realize the above (B-1), the image memory is composed of four memory modules so that four consecutive pixels in any horizontal or vertical direction are stored in different memory modules. ,
Associate pixels and memory modules. When defining the upper left of the image as the origin, the right horizontal direction as the x axis, and the lower vertical direction as the y axis, the memory module number μ that should store the pixel with coordinates (x, y) is μ = (x + y) 4 ( 10), the correspondence between the pixels and the memory module can be satisfied. Here, is an operation that takes the remainder of division. Also, if the address α in the memory module where a pixel with coordinates (x, y) is to be stored is α=mxy+[×/4] (11), then different pixels are in the same memory module and The correspondence between a pixel and an address within the memory module can be determined without determining the address within the memory module. Here, [ ] is converted into an integer by rounding down the decimal places, and m is a constant specific to the image memory where 4×m is the width of the image memory. FIG. 4a schematically shows the correspondence between pixels and memory module numbers according to equation (10), and FIG. 4b schematically shows the correspondence between pixels and addresses in the memory module according to equation (11). In the figure, 20
1 is a pixel with an x coordinate of 2 and a y coordinate of 3, and is stored at address 6 of the first memory module. however,
Let m be 2.
第5図は画像メモリの構成を示す。図中、30
1〜303は機能(B−1)において指定する。
それぞれ画素座標x座標,y座標,およびアクセ
ス方向を格納するレジスタ、304〜307はそ
れぞれ第0,第1,第2,第3メモリモジユー
ル、308〜311はそれぞれ第0,第1,第
2,第3メモリモジユール内アドレスを生成する
アレス生成部、312は読み出しデータを機能
(B−1)で述べたビツト順序に配列するルーテ
イング部、313は機能(B−1)で述べたビツ
ト順序を所定のメモリモジユールに振分ける順序
に配列するルーテイング部である。 FIG. 5 shows the configuration of the image memory. In the figure, 30
1 to 303 are specified in function (B-1).
Registers that store pixel coordinates x coordinate, y coordinate, and access direction, respectively; 304 to 307 are 0th, 1st, 2nd, and 3rd memory modules, respectively; 308 to 311 are 0th, 1st, and 2nd memory modules, respectively. , an address generation unit that generates an address in the third memory module, 312 a routing unit that arranges the read data in the bit order described in function (B-1), and 313 the bit order described in function (B-1). This is a routing unit that arranges the data in the order in which it is distributed to predetermined memory modules.
画像メモリ105のデータの読出しおよび書込
み動作は次のとおりである。まずアクセスする画
素の組の左または上端画素のx座標(以下x0と略
す)、y座標(以下y0と略す)、およびアクセス方
向(右または左または下または上方向、以下tと
略す)を、バス106および320,321,3
22を通じて、それぞれレジスタ301,30
2,303に格納する。アドレス生成部308〜
311は、t=0(アクセス方向が右)のとき、
座標(x0,y0),(x0+1,y0),(x0+2,y0),
(x0+3,y0)について、t=1(アクセス方向が
左)のとき、座標(x0,y0),(x0−1,y0),(x0
−2,y0),(x0−3,y0)について、t=2(ア
クセス方向が下)のとき、座標(x0,y0)(x0,
y0+1),(x0,y0+2),(x0,y0+3)につい
て、t=3(アクセス方向が上)のとき、座標
(x0,y0),(x0,y0−1),(x0,y0−2),(x0,
y0−3)について、式(10)および式(11)により各メモ
リモジユール内アドレスを生成する。データ読出
し時は、次に信号323により各メモリモジユー
ル304〜307に読出し指令を出す。信号32
3により所定のデータがバス324〜327に読
出される。ルーテイング部312は、バス324
〜327のデータを、x0,y0に基づいて、前記画
素とビツトの対応に示す順序にデータを配列し、
バス328を通じてバス106に出力する。他
方、データ書込み時は、データバス106より書
込むべきデータを、バス328を通じて、ルーテ
イング部313に送る。次に書込み指令を信号3
23を通じて出すと、ルーテイング部313で、
x0,y0に基づいて、前記画素とビツトの対応に示
す順序にデータを配列して、バス329〜333
に出力する。最後に、書込み指令信号323によ
りメモリモジユール304〜307に、データ
を、それぞれバス329〜333より書込む。 Data reading and writing operations of image memory 105 are as follows. First, the x coordinate (hereinafter abbreviated as x 0 ), y coordinate (hereinafter abbreviated as y 0 ), and access direction (right, left, bottom, or top direction, hereinafter abbreviated as t) of the left or top pixel of the set of pixels to be accessed. , buses 106 and 320, 321, 3
22, registers 301 and 30, respectively.
2,303. Address generation unit 308~
311, when t=0 (access direction is right),
Coordinates (x 0 , y 0 ), (x 0 +1, y 0 ), (x 0 +2, y 0 ),
For (x 0 +3, y 0 ), when t = 1 (access direction is left), the coordinates (x 0 , y 0 ), (x 0 -1, y 0 ), (x 0
-2, y 0 ), (x 0 -3, y 0 ), when t=2 (access direction is down), the coordinates (x 0 , y 0 ) (x 0 ,
y 0 +1), (x 0 , y 0 +2), (x 0 , y 0 +3), when t=3 (access direction is up), the coordinates (x 0 , y 0 ), (x 0 , y 0 −1), (x 0 , y 0 −2), (x 0 ,
y 0 -3), an address within each memory module is generated using equations (10) and (11). When reading data, a read command is then issued to each memory module 304-307 using a signal 323. signal 32
3, predetermined data is read onto buses 324-327. The routing unit 312 uses the bus 324
Arrange the data of ~327 in the order shown in the correspondence between pixels and bits based on x 0 and y 0 ,
Output to bus 106 via bus 328. On the other hand, when writing data, the data to be written is sent from the data bus 106 to the routing section 313 via the bus 328. Next, write command to signal 3
23, the routing section 313 outputs the
Based on x 0 , y 0 , the data is arranged in the order shown in the correspondence between pixels and bits, and is sent to buses 329 to 333.
Output to. Finally, write command signal 323 writes data to memory modules 304-307 via buses 329-333, respectively.
次に、前記の装置を用いて本発明の回転を実現
するための手順を説明する。処理部101はプロ
グラムメモリにあらかじめ格納されたプログラム
を実行する。第6図は、このプログラムの概略の
フローチヤートである。まず画像入力のステツプ
で、画像入力装置103から画像を入力する。た
だし、別の処理を施した画像または、処理部10
1のプログラムで生成した画像を対象とすること
もでき、この場には本ステツプは省略する。次に
変換(6)〜(9)を順次実行し、画像を回転する。最後
に画像出力のステツプで、画像出力装置104か
ら画像を出力する。ただし、回転画像に対して別
の処理を施すこともでき、この場合には本ステツ
プは省略する。 Next, a procedure for realizing the rotation of the present invention using the above-described apparatus will be explained. The processing unit 101 executes a program stored in advance in a program memory. FIG. 6 is a schematic flowchart of this program. First, in an image input step, an image is input from the image input device 103. However, images that have been subjected to other processing or
It is also possible to target an image generated by program 1, and this step is omitted in this case. Next, perform transformations (6) to (9) in sequence to rotate the image. Finally, in an image output step, the image is output from the image output device 104. However, it is also possible to perform other processing on the rotated image, and in this case, this step is omitted.
第7図〜第10図は、それぞれ変換(6)〜(9)のス
テツプの詳細なフローチヤートである。各フロー
チヤートは、すべて同様の形式であるため、個々
には説明せず、以下一括して説明する。まず、処
理する変換および被変換画像画素位置を、左上画
素に初期化する。次に画像メモリのアクセス方
向、すなわちtの値をセツトする。次に、現被変
換画像画素位置から、現アクセス方向にN画素
(Nビツト=1ワード)を、現変換画像画素位置
に、転送する。次に、同一アクセス方向ライン上
の、次のN画素の位置に、変換および被変換画像
画素位置を移動する。以上を1ライン分繰返した
後、変換および被変換画像画素位置を、次のライ
ンの先頭に移動する。以上を1画像分繰返し処理
を終了する。 7 to 10 are detailed flowcharts of the steps of conversion (6) to (9), respectively. Since each flowchart has a similar format, it will not be explained individually, but will be explained collectively below. First, the conversion to be processed and the pixel position of the converted image are initialized to the upper left pixel. Next, the access direction of the image memory, that is, the value of t, is set. Next, N pixels (N bits=1 word) are transferred from the current converted image pixel position to the current converted image pixel position in the current access direction. Next, the converted and converted image pixel positions are moved to the next N pixel positions on the same access direction line. After repeating the above for one line, the conversion and conversion target image pixel positions are moved to the beginning of the next line. The above steps are repeated for one image and the processing is completed.
本実施例によれば、2値画像の回転処理を行う
のに、4回の変換を要するものの、N画素(Nは
ワード長)単位に処理することができる。しかも
N画素の処理は、x,y座標中の一方のみのイン
クリメントを変換,被変換画像について行うこ
と、および実際にデータを転送することのみであ
る。一方従来のアフイン変換による方法は、変換
は2回であるが、1画素単位に、x,y両座標の
インクリメントを変換,被変換画像について行う
必要がある。よつて、本発明による方法は、従来
のアフイン変換による方法に比べて少なくともN
が4以上のとき高速であり、しかもNを大きくす
ることにより、さらに高速化することができる。
回転画像の画質については、本発明の方法、アフ
イン変換による方法と同等で、従つて従来斜交軸
変換による方法に優る。 According to this embodiment, although four conversions are required to perform rotation processing on a binary image, processing can be performed in units of N pixels (N is word length). Moreover, the processing of N pixels consists only of incrementing only one of the x and y coordinates, performing the conversion on the converted image, and actually transferring the data. On the other hand, in the conventional method using affine transformation, although the transformation is performed twice, it is necessary to increment both the x and y coordinates of the image to be transformed for each pixel. Therefore, the method according to the present invention has at least N
When N is 4 or more, the speed is high, and by increasing N, the speed can be further increased.
Regarding the image quality of the rotated image, the method of the present invention is equivalent to the method using affine transformation, and is therefore superior to the conventional method using oblique axis transformation.
以上ハードウエアによる一実施例につき説明し
たが、本発明の思想は計算機システム等における
ソフトウエアによつても十分実現可能であり、画
像、図形処理を伴う情報処理システム等において
実施し得る。 Although an embodiment using hardware has been described above, the idea of the present invention can also be fully realized by software in a computer system, etc., and can be implemented in an information processing system that involves image and graphic processing.
以上説明したように、本発明によれば、単純な
座標データの更新で回転変換ができるため、従来
アフイン変換による方法と同等の画質の回転画像
を従来より高速に得ることが可能となる。
As described above, according to the present invention, since rotational transformation can be performed by simply updating coordinate data, it is possible to obtain a rotated image of the same quality as the conventional method using affine transformation at a higher speed than before.
また専用的ハードウエア装置からソフトウエア
に至る幅広い実現形態が可能であり、豊富な分野
での利用効果が期待される。 Furthermore, it can be realized in a wide variety of ways, from dedicated hardware devices to software, and is expected to be useful in a wide variety of fields.
第1図は、本発明の原理を示す説明図、第2図
は、補間の規則を説明する説明図、第3図は、本
発明を実現する装置の実施例の全体構成図、第4
図は、本発明一実施例における画像メモリと画像
の対応を示す説明図、第5図は、画像メモリの構
成図、第6図は、本発明実施例の回転プログラム
の概略フローチヤート、第7図〜第10図は、回
転プログラムの各ステツプの詳細フローチヤート
である。
101…処理部、105…画像メモリ、304
〜307…メモリモジユール、308〜311…
アドレス生成部、312,313…ルーテイング
部、…縦方向斜交軸変換、…縦方向縮小変換、…
横方向拡大変換、…横方向斜交軸変換。
FIG. 1 is an explanatory diagram showing the principle of the present invention, FIG. 2 is an explanatory diagram explaining the rules of interpolation, FIG. 3 is an overall configuration diagram of an embodiment of an apparatus for realizing the present invention, and FIG.
5 is an explanatory diagram showing the correspondence between image memory and images in an embodiment of the present invention, FIG. 5 is a configuration diagram of the image memory, FIG. 6 is a schematic flow chart of a rotation program in an embodiment of the present invention, and FIG. Figures 1 through 10 are detailed flowcharts of each step of the rotation program. 101... Processing unit, 105... Image memory, 304
~307...Memory module, 308~311...
Address generation unit, 312, 313... Routing unit,... Vertical oblique axis conversion,... Vertical reduction conversion,...
Horizontal enlargement conversion, ...horizontal oblique axis conversion.
Claims (1)
画像処理装置により処理し、角度θだけ回転した
画像に変換する画像の回転処理方法において、 上記原画像を直交座標系の一方の軸方向に角度
θの傾斜をもつ中間画像に変換する第1の斜交軸
変換処理ステツプと、 上記中間画像を、直交座標系の一方の軸方向に
cosθ、またはその近似倍率で縮小し、直交座標系
の他方の軸方向に1/cosθ、またはその近似倍率
で拡大した中間画像に変換する拡大縮小処理ステ
ツプと、 上記拡大縮小処理によつて得られた中間画像を
直交座標系の他方の軸方向に角度θの傾斜をもつ
画像に変換する第2の斜交軸変換処理ステツプと
からなり、 上記拡大縮小処理ステツプが上記一方の軸方向
に縮小した画像を得るための縮小処理ステツプと
上記他方の軸方向に拡大した画像を得るための拡
大処理ステツプとに分けて実行され、 上記各処理ステツプが、それぞれの変換処理内
容によつて決まる所定の軸方向に沿つた各読み出
し走査線において、処理対象となる画像データを
所定画素ずつブロツク単位で順次に読み出し、該
ブロツク単位の画像データを、上記メモリの別領
域に、上記回転角度θと各走査線位置とによつて
決まる画素数ずつ各書き込み走査線のアドレス、
または各書き込み走査線内の画素アドレスをシフ
トさせた形で書き移すことによつて、それぞれの
画像変換を行うことを特徴とする画像回転方法。 2 画像データを記憶するための画像メモリと、
上記画像メモリに記憶された画像データを連続し
たメモリアドレスをもつ複数画素からなるブロツ
ク単位でアクセスするデータプロセツサとからな
り、上記画像メモリが、 上記データブロツクのサイズに応じて決まる複
数個のメモリモジユールと、 アクセスすべきデータブロツクの基準アドレス
を記憶するための第1のレジスタと、 上記基準アドレスとデータブロツクとの関係を
示すアクセス方向指示情報を記憶するための第2
のレジスタと、 上記メモリモジユール対応に設けられ、上記第
1および第2のレジスタの内容に応じて、アクセ
スすべき各メモリモジユール内アドレスを生成す
る複数個のアドレス生成手段と、 上記メモリモジユールとデータバスとの間に接
続されたデータ配列手段と からなり、上記データプロセツサが、 画像の回転角度θと実行すべき画像処理の内容
に応じて、データ読み出し対象および書き込み対
象となる画像の縦方向または横方向走査線を決定
し、各走査線内でアクセス対象となるデータブロ
ツクの基準アドレスを求め、該基準アドレスとア
クセス方向の指示情報を上記画像メモリの第1、
第2のレジスタに次々と与えることによつて、上
記画像メモリの1つの画像領域から上記データバ
スにブロツク単位で読み出された画像データを上
記画像メモリの別の画像領域に書き込む画像デー
タ転送制御手段 を有し、上記転送制御手段による画像データのブ
ロツク転送の繰返し動作によつて、画像データを
直交座標系の一方の軸方向に角度θの傾斜をもつ
画像データに変換する第1の斜交軸変換処理と、
画像データを直交座標系の一方の軸方向にcosθ、
またはその近似倍率で縮小する画像縮小処理と、
画像データを直交座標系の他方の軸方向に1/
cosθ、またはその近似倍率で拡大する画像拡大処
理と、拡大縮小処理された画像データを直交座標
系の他方の軸方向に角度θの傾斜をもつ画像デー
タに変換する第2の斜交軸変換処理とが順次に実
行され、上記画像メモリに記憶された原画像が角
度θだけ回転された画像に変換されるようにした
ことを特徴とする画像処理装置。[Claims] 1. An image rotation processing method in which two-dimensional original image data stored in a memory is processed by an image processing device and converted into an image rotated by an angle θ, wherein the original image is converted into an image rotated by an angle θ. a first oblique axis transformation processing step of converting the intermediate image into an intermediate image tilted at an angle θ in one axis direction;
an enlargement/reduction processing step of reducing the image by cosθ or its approximate magnification and converting it into an intermediate image enlarged by 1/cosθ or its approximate magnification in the direction of the other axis of the orthogonal coordinate system; and a second oblique axis transformation processing step for converting the intermediate image into an image tilted at an angle θ in the direction of the other axis of the orthogonal coordinate system, and the scaling processing step converts the intermediate image into an image tilted at an angle θ in the direction of the other axis of the orthogonal coordinate system. The process is divided into a reduction processing step to obtain an image and an enlargement processing step to obtain an image enlarged in the direction of the other axis. In each readout scanning line along the direction, the image data to be processed is sequentially read out in block units by predetermined pixels, and the image data in blocks is stored in a separate area of the memory according to the rotation angle θ and each scanning line. the address of each write scan line by the number of pixels determined by the position,
Alternatively, an image rotation method characterized in that each image conversion is performed by transferring pixel addresses in each writing scanning line in a shifted form. 2 an image memory for storing image data;
and a data processor that accesses the image data stored in the image memory in units of blocks consisting of a plurality of pixels having consecutive memory addresses, and the image memory is composed of a plurality of memories determined according to the size of the data block. a first register for storing a reference address of a data block to be accessed; and a second register for storing access direction instruction information indicating the relationship between the reference address and the data block.
a plurality of address generation means provided corresponding to the memory module and generating addresses in each memory module to be accessed according to the contents of the first and second registers; and a data array means connected between the data bus and the data bus, and the data processor selects the image to be read and written according to the rotation angle θ of the image and the content of the image processing to be performed. The vertical or horizontal scanning line of the image memory is determined, the reference address of the data block to be accessed is determined within each scanning line, and the reference address and access direction instruction information are transferred to the first and second data blocks of the image memory.
Image data transfer control for writing image data read out in blocks from one image area of the image memory onto the data bus to another image area of the image memory by sequentially applying data to a second register. a first oblique angle converting means for converting the image data into image data having an angle θ in one axis direction of the orthogonal coordinate system by repeating the block transfer operation of the image data by the transfer control means; Axis conversion processing,
Cosθ,
or an image reduction process that reduces the image by its approximate magnification;
The image data is 1/1 in the direction of the other axis of the orthogonal coordinate system.
An image enlargement process that enlarges the image by cosθ or its approximate magnification, and a second oblique axis conversion process that converts the enlarged or reduced image data into image data that is tilted at an angle θ in the direction of the other axis of the orthogonal coordinate system. An image processing apparatus characterized in that the above steps are sequentially executed, and the original image stored in the image memory is converted into an image rotated by an angle θ.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP58204827A JPS6097474A (en) | 1983-11-02 | 1983-11-02 | Method and apparatus for rotating picture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP58204827A JPS6097474A (en) | 1983-11-02 | 1983-11-02 | Method and apparatus for rotating picture |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS6097474A JPS6097474A (en) | 1985-05-31 |
JPH0481231B2 true JPH0481231B2 (en) | 1992-12-22 |
Family
ID=16497037
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP58204827A Granted JPS6097474A (en) | 1983-11-02 | 1983-11-02 | Method and apparatus for rotating picture |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS6097474A (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61199175A (en) * | 1985-02-28 | 1986-09-03 | Mitsubishi Electric Corp | System for rotating image by optional angle |
JPH0762794B2 (en) * | 1985-09-13 | 1995-07-05 | 株式会社日立製作所 | Graphic display |
JPS62177675A (en) * | 1986-01-31 | 1987-08-04 | Fujitsu Ltd | Image processing device |
JP2744230B2 (en) * | 1986-04-17 | 1998-04-28 | キヤノン株式会社 | Image processing device |
JPS62245378A (en) * | 1986-04-17 | 1987-10-26 | Canon Inc | Image processor |
JP2744231B2 (en) * | 1986-04-18 | 1998-04-28 | キヤノン株式会社 | Image processing device |
JP3040058B2 (en) * | 1994-11-21 | 2000-05-08 | 株式会社日立製作所 | Graphic display device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5817583A (en) * | 1981-07-21 | 1983-02-01 | Hitachi Ltd | two-dimensional data storage device |
JPS58103063A (en) * | 1981-12-16 | 1983-06-18 | Hitachi Ltd | matrix storage |
-
1983
- 1983-11-02 JP JP58204827A patent/JPS6097474A/en active Granted
Also Published As
Publication number | Publication date |
---|---|
JPS6097474A (en) | 1985-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4618991A (en) | Processing method for the rotation of an image | |
EP0360155A2 (en) | Image transformation method and device | |
US5263135A (en) | Image processing apparatus | |
JPH0481231B2 (en) | ||
US6577776B1 (en) | Transforming video images | |
JP2502274B2 (en) | Image converter | |
JPS6217236B2 (en) | ||
JP4504861B2 (en) | Image processing method and image processing apparatus | |
JPH04329482A (en) | Image rotation processing method and processing device for relevant method | |
JPH0785266A (en) | Image rotation device | |
JPH11205576A (en) | Image processor | |
JPH05127980A (en) | Picture processor | |
JPS62264344A (en) | Address controller | |
JPS6125192B2 (en) | ||
JPH0736772A (en) | High speed bitmap access control device and control method | |
JP2658077B2 (en) | Video special effects device | |
JPH08212357A (en) | Interpolation device, interpolation method, and image generation device | |
JPS6220074A (en) | Image processing method | |
JP2005250996A (en) | Image processor | |
JP2967228B2 (en) | Image data transfer device | |
JPH07129460A (en) | Image processing method and apparatus thereof | |
JP2945028B2 (en) | Image processing designated area information calculation device | |
JPH0833919B2 (en) | Image processing apparatus and method | |
JPH0863595A (en) | Method and device for rotation processing of image | |
JPH07152357A (en) | Data conversion method and device |