JPH03216771A - Method and device for rotating picture at optional angle - Google Patents

Method and device for rotating picture at optional angle

Info

Publication number
JPH03216771A
JPH03216771A JP2013164A JP1316490A JPH03216771A JP H03216771 A JPH03216771 A JP H03216771A JP 2013164 A JP2013164 A JP 2013164A JP 1316490 A JP1316490 A JP 1316490A JP H03216771 A JPH03216771 A JP H03216771A
Authority
JP
Japan
Prior art keywords
axis
row
matrix
block
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2013164A
Other languages
Japanese (ja)
Other versions
JP2695266B2 (en
Inventor
Yutaka Ozaki
豊 尾崎
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.)
Panasonic System Solutions Japan Co Ltd
Original Assignee
Matsushita Graphic Communication Systems Inc
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 Matsushita Graphic Communication Systems Inc filed Critical Matsushita Graphic Communication Systems Inc
Priority to JP2013164A priority Critical patent/JP2695266B2/en
Publication of JPH03216771A publication Critical patent/JPH03216771A/en
Priority to US08/227,088 priority patent/US5412768A/en
Application granted granted Critical
Publication of JP2695266B2 publication Critical patent/JP2695266B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • G06T3/602Block rotation, e.g. by recursive reversing or rotating

Abstract

PURPOSE:To rotate a picture at an optical angle and at a high speed by dividing an original picture into blocks having a size of a prescribed picture element respectively and processing these blocks for each row without processing an optional angle of the picture for each picture element. CONSTITUTION:A reference block generating means 1 is provided together with an X axis directional shift means 2, an X axis directional reduction means 3, a Y axis directional magnification means 4, a rotary block production means 5, and a shift means 6. An original picture is divided into blocks of each prescribed size. Then such operations are carried out on these blocks for each row as the shift, reduction, magnification, replacement of rows, 90-degree rotation, etc. Thus a picture can be quickly rotated at an optional angle with use of a memory of a normal structure.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、文字や図形などの画像データを任意角回転さ
せる画像データの回転方法および装置に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to an image data rotation method and apparatus for rotating image data such as characters and figures by arbitrary angles.

従来の技術 従来、画像の90度回転方法については多くの技術が開
示されているが、任意角の回転方法については次の方法
が用いられている。
BACKGROUND OF THE INVENTION Conventionally, many techniques have been disclosed for rotating an image by 90 degrees, but the following method has been used for rotating an image by an arbitrary angle.

ソース画像(元画像)の1画素をX座標とY座標でSX
I  SYと表現し、回転角をaとし、回転後のディス
トネーション画像(目的画像)の対応するX座標,Y座
標をDx,DYとすると、DxfDYを、 DX = SXCOS a − Sy S IN aD
y ”” Sy S IN a 十Sy COS aの
式により計算し、ディストネーション画像の対応する位
置にビット単位で順次書き込むことが行われていた。
SX one pixel of the source image (original image) with X and Y coordinates
Expressed as ISY, the rotation angle is a, and the corresponding X and Y coordinates of the rotated destination image (target image) are Dx and DY, then DxfDY is DX = SXCOS a - Sy S IN aD
It was calculated using the formula: y ``'' Sy S IN a 10 Sy COS a, and was sequentially written bit by bit in the corresponding position of the destination image.

発明が解決しようとする課題 しかし上記方法によれば、1画素当たり、4回の掛け算
と2回の足し算と、ディストネーション画像の対応する
位置にビット単位で順次書き込むことが必要となる。こ
のため、回転する画像の大きさが大きくなると計算量が
大きさの自乗に比例して増大し、計算時間が長くなると
いう問題点があった。
Problems to be Solved by the Invention However, according to the above method, it is necessary to perform four multiplications and two additions per pixel, and to sequentially write bits at corresponding positions in the destination image. Therefore, as the size of the rotated image increases, the amount of calculation increases in proportion to the square of the size, resulting in a problem that the calculation time becomes longer.

本発明は上述の問題点に鑑みてなされたもので、画像の
任意角を各画素毎に処理することなく、元画像を所定の
画素からなる大きさのブロックに分割し、このブロック
を行単位で処理することにより高速な処理を可能とする
画像の任意角回転方法および装置を提供することを目的
とする。
The present invention was made in view of the above-mentioned problems, and instead of processing arbitrary corners of the image for each pixel, the present invention divides the original image into blocks of a predetermined size and divides the blocks into rows. An object of the present invention is to provide a method and apparatus for rotating an image at an arbitrary angle, which enables high-speed processing.

課題を解決するだめの手段 上記目的を達成するため、元画像を所定の画素からなる
大きさのブロックに分割し、このプロンクについて、シ
フト,縮小,拡大,  90度回転,ローティト等操作
をブロックを構成する行列の行単位で行うようにすれば
よく、本発明の画像の任意角回転方法は、基準座標軸上
の基準点に対し元画像を任意角θ回転し目的画像を作成
するに際し、前記元画像をN×Nの画素よりなり前記基
準座標軸に対し−θ回転した軸に1辺が平行な正方形よ
りなる基準ブロックの集合体として表し、前記各基準ブ
ロックの頂点の1つを回転頂点とし、これを中心に前記
各基準ブロックをθ回転して回転ブロックを作成し、こ
の回転ブロックの前記回転頂点を前記基準点を中心とし
てθ回転した時生じる前記基準座標軸方向の移動量を△
Y,前記基準座標軸に直角方向の移動量をΔYとし、前
記回転ブロックを前記基準座標軸方向に△Y,前記基準
座標軸に直角方向にΔXそれぞれ平行移動することによ
り目的画像を得ることを特徴とするものである。また、
前記基準ブロックより前記回転ブロックを作成するに際
し、前記回転頂点を通り前記基準座標軸に平行な軸をY
軸としこれを直交し前記回転頂点を通る軸をX軸とし前
記基準ブロックを構成する要素のX軸,Y軸の座標を(
x,y)として前記要素のX座標を x − y * tanθとなるようX軸方向にシフト
し、更にX軸方向にcosθ倍して x cosθ−y*sinθとし八 次にy座標をY軸方向に1/cosθ倍しy / c+
)sθとして ( x cosθ−y * sinθe y / co
sθ)座標に移動することにより前記基準ブロックを前
記回転ブロックのX軸,Y軸方向の長さと同じでかつY
軸方向に三角形状に前記回転ブロックより一方がはみ出
し、他方が凹んだ平行四辺形に形成し、この三角形状に
はみ出した部分ではX軸に平行な行ビット並びごとに読
み出し、はみ出しだ三角形状部が凹んだ三角形状部に重
なるように、この読み出しだ行ピット並びと凹んだ三角
形状部の対応する行ビット並びとの論理和をとって前記
回転ブロックの形状に合致したN行×N列よりなる行列
とし、このN行×N列の行列の転置行列を求め、この転
置行列の各行につき前記三角形状にはみ出した部分のビ
ットが行の左端より右端に向かって並んでいる行につい
てはその並んでいるはみ出したビット数だけ左ローティ
トを行ってローティト画像を得、このローティト画像の
転置行列を演算し、この転置行列を前記回転ブロックと
するようにするとよい。そして、前記転置行列を求める
にあたシ、対象とする行列をN行×N列とし、この行列
の変換モード数Mを M = ( 1og2 N ) (但し〔 〕は内部の数値が整数のときはその整数を、
少数点以下の数値を含むときは切り上げた整数)によっ
て求め、前記N行を0〜N−1と付番し、変換モードL
(=1〜M)ごとに、A番行とB番行を、 A=k*2〜k$2  +2  −1 B=A+2L−1 k=0〜(N/2L) −1 によって求め、A番行とB番行の行ピット並びをA(j
),  B(j)で表し、−1A′(j), B’(j
)を−1A′(j)=A(j) j=k*2L=kネ2L+ 2L−” − 1−1A′
(j)一B (j−2  ) j=kネ2L+2L−1〜k$2L+2L−1B ’(
j) = B (j) j=kネ2L+ 2L−”〜k$2L+2L−1B ’
(j)−4 ( j + 2L−1)?=k*2 〜k
!2  +2   −1k=0〜(N/2  )−1 によって求め、A(j)を−1A′(j)にB (j)
をB ’ (j)に変換し、Lを1からMまで変化させ
ることによりN行×N列の行列を求め、この行列を前記
転置行列とするとよい。また、前記基準ブロックより前
記回転ブロックを作成するに際し、前記回転頂点を通り
前記基準座標軸に平行な軸をY軸としこれを直交し前記
回転頂点を通る軸をX軸とし前記基準ブロックを構成す
る要素のX軸,Y軸の座標を(x,y)として前記要素
のX座標をx−3’*tanθとなるようX軸方向にシ
フトし、更にX軸方向にcosθ倍して x cosθ−y*sioθとし1 次にy座標をY軸方向に1 / c■sθ倍しy/co
sθとして ( X cOsθ−y*sinθ,y/COSθ)座標
に移動することにより前記基準ブロックを前記回転ブロ
ックのX軸,Y軸方向の長さと同じでかつ前記回転ブロ
ックより三角形状にY軸下方にはみ出し、上方が凹んだ
平行四辺形を形成し、この三角形がX軸に平行な行ビッ
ト並びn行で形成される場合、n+N行で形成される前
記平行四辺形の各行を0〜n + N−1と付番し、n
+1行×N列よりなシ前記三角形状に凹んだ範囲を0,
他を1とするマスク行列を作成し、第0行を求めるに当
たり、まず第0行〜第n行と前記マスク行列との論理積
により第0′行〜第n′行を作成し、第1′行を、第0
′行のビットがOでない部分をマスクしてこのマスク部
分をθピットとし、このマスクした行と第0′行との論
理和をとって第0′修正行を作り、第2′行を第0′修
正行のビットが0でない部分をマスクしてこのマスク部
分を0ビットとし、このマスクした行と第0′修正行と
の論理和をとって第1′修正行を作り、第3′行を第1
′修正行のビットがOでない部分をマスクしてこのマス
ク部分を0ピットとし、このマスクした行と第1′修正
行との論理和をとって第2′修正行を作り、以下同様に
して第n′行を第(n−2)’ 修正行のビットが0で
ない部分をマスクしてこのマスクした部分をθピットと
し、このマスクした行と第(n−2)’修正行との論理
和をとって第(n−1)′修正行を作り、この第(n−
1)’修正行を第0行とし、以下同様にしてN−1行ま
で求めてN行×N列の行列を求め、この行列を前記回転
ブロックとするとよい。また、本発明の画像の任意角回
転装置は、元画像を基準座標軸に対して−θ回転した軸
に一辺が平行なN×Nの画素の正方形よりなる基準ブロ
ックの集合体として表す基準ブロック生成手段と、前記
基準ブロックをθ回転して回転ブロックを作成するに際
し、回転中心となる萌記基準ブロックの頂点の1つを回
転頂点としこの回転頂点を通多前記基準座標軸に平行な
軸をY軸としこれと直交し前記頂点を通る軸をX軸とし
前記基準ブロックを構成する要素のX軸.Y軸の座標を
x、yとし、前記要素のX座標をX一y * tanθ
となるようX軸方向にシフトするX軸方向シフト手段と
、このX軸方向シフト手段の出力をX軸方向にcosθ
倍するX軸方向縮小手段と、y座標をl/cosθ倍す
るY軸方向拡大手段と、前記X軸方向縮小手段と前記Y
軸方向拡大手段の出力により形成されるY軸方向に平行
な2辺を有する平行四辺形を形成する行列の各列をY軸
方向にシフトして回転ブロックを作成する回転プロンク
作成手段と、前記回転ブロックの前記回転頂点を、前記
元画像を回転する回転中心となる前記基準座標軸上の基
準点を中心としてθ回転する時の前記基準座標軸方向の
移動量と前記基準座標軸に直角方向の移動量を算出し、
前記回転ブロックを移動する移動手段とを備えたことを
特徴とするものである。また、前記回転ブロック作成手
段を、前記平行四辺形の前記回転ブロックよりはみ出し
た三角形状部分をX軸に平行な行ビット並びごとに読み
出し、はみ出した三角形状部がこれに対応して前記回転
ブロックより凹んだ三角形状部に重なるようにこの読み
出した行ビット並びと、凹んだ三角形状部の対応する行
ビット並びとの論理和をとって前記回転ブロックの形状
に合致した行列を生成する行列生成手段と、行列の各行
について行のローティトを行うローティト手段と、行列
の転置行列を作成する転置行列作成手段とを備え、前記
行列生成手段の出力を前記転置行列作成手段に入力して
転置行列を出力し、この行列を前記ローティト手段で各
行について前記三角形状にはみ出した部分のビットが行
の左端より右端に向かって並んでいる行についてはその
並んでいるはみ出したビット数だけ左ローティトを行い
、これにより作成した行列を前記転置行列作成手段に入
力して転置行列を出力し、この行列を前記回転ブロック
の値とするようにするとよい。さらに、前記転置行列作
成手段を、画像データを記憶する画像データ記憶手段と
、N行×N列の画像データの変換モード数Mを M=(log2N) (但し〔 〕は内部の数値が整数のときはその整数を、
少数点以下の数値を含むときは切り上げた整数)によっ
て求め変換モードL(=1〜M)を出力する変換モード
演算手段と、前記N行を1〜N−1と付番し、前記変換
モードLに応じて前記N行よりA番行とB番行を A=k本2 〜k$2  +2   −1B=A+2L
−1 k=0〜(N/2L) −1 により演算し、このA番行とB番行の行ビソト並びA(
j),  B(j)を選択する行選択手段と、前記A(
j), B(j)を入力し、−1A′(j), B’(
j)をA ’ (j) = A (j)J=kネ2 〜
kネ2+2   −1 −1A′(j)= B ( j−2L−” )j=k*
2 +2  〜k$2 +2 −1n’(j)一B(j
) J二k申2+2 〜kネ2 +2 −1B’(j)一A
 (j+2L) j=k*2  〜k本2+2   −1k=0〜(N/
2L) −1 によって演算し、前記画像データのA(j), B(j
)をそれぞれ−1A′(j), B’(j)に変換し、
この操作をLを1からMまで変化させることによりN行
×N列の行列を求める画像変換手段とからなるようにす
るとよい。また、前記回転ブロック作成手段として、前
記平行四辺形が前記回転ブロックより三角形状にY軸下
方にはみ出し、上方が凹んだ平行四辺形であυ、この三
角形がX軸に平行なビット並びn行で形成される場合、
n+N行で形成される前記平行四辺形の各行を0−n+
N  1と付番し、n千1行×N列よりなり前記三角形
状に凹んだ範囲を0,他を1とするマスク行列とk行か
らk + n行までのn + 1行×N列との論理積に
より第k′行〜第(k+n)’ 行を作成するマスク手
段と、第(k+1)’行を第(k−1)’修正行のビッ
トが0でない部分をマスクしてこのマスク部分を0ビッ
トとし、このマスクした行と第(k−1)’修正行との
論理和をとって第k′修正行を作る修正行作成手段とを
備え、第k行を求めるにあたシ、前記マスク手段により
第k′行〜第(k+n)’行を求め、前記修正行作成手
段により第k′修正行から順次第(k+n−1)’修正
行を求めこの第(k+n  1)’修正行を第k行とし
、θ行よりN−1行まで求めてN行×N列の行列を求め
この行列を回転ブロックとするようにするとよい。
Means for solving the problem In order to achieve the above objective, the original image is divided into blocks of a predetermined size of pixels, and operations such as shift, reduction, enlargement, 90 degree rotation, rotation, etc. are performed on the blocks. The image rotation method of the present invention may be performed in units of rows of the constituent matrices, and the image rotation method of the present invention rotates the original image by an arbitrary angle θ with respect to the reference point on the reference coordinate axis to create the target image. Representing the image as a collection of reference blocks consisting of N×N pixels and consisting of squares with one side parallel to an axis rotated by −θ with respect to the reference coordinate axis, and one of the vertices of each reference block being a rotation apex, A rotation block is created by rotating each of the reference blocks by θ around this point, and the amount of movement in the reference coordinate axis direction that occurs when the rotation apex of this rotation block is rotated by θ around the reference point is △
The target image is obtained by moving the rotating block in parallel in the direction of the reference coordinate axes by ΔY and in the direction perpendicular to the reference coordinate axes, respectively, with the amount of movement in the direction perpendicular to the reference coordinate axes being ΔY. It is something. Also,
When creating the rotation block from the reference block, an axis passing through the rotation apex and parallel to the reference coordinate axis is defined as Y.
The coordinates of the X-axis and Y-axis of the elements constituting the reference block are (
x, y), shift the X coordinate of the element in the X-axis direction so that it becomes x - y * tan θ, further multiply it by cos θ in the X-axis direction to make x cos θ - y * sin θ, and then change the y-coordinate to the Y-axis. Multiply 1/cosθ in the direction y/c+
)sθ as (x cosθ−y * sinθe y/co
sθ) coordinate so that the reference block is the same as the length of the rotating block in the X-axis and Y-axis directions, and
It is formed into a parallelogram with one side protruding from the rotating block in the axial direction in a triangular shape and the other concave, and in the part that protrudes from the triangular shape, reading is performed for each row bit row parallel to the X axis, and the protruding triangular part The readout row pit arrangement and the corresponding row bit arrangement of the recessed triangular part are logically ORed so that the row bit arrangement overlaps the recessed triangular part, and N rows by N columns that match the shape of the rotating block are obtained. Find the transposed matrix of this N-row by N-column matrix, and for each row of this transposed matrix, if the bits of the part protruding from the triangle are arranged from the left end of the row to the right end, calculate the arrangement. It is preferable that a rotated image is obtained by performing left rotation by the number of protruding bits, a transposed matrix of this rotated image is calculated, and this transposed matrix is used as the rotation block. To obtain the transposed matrix, the target matrix is N rows x N columns, and the number of conversion modes M for this matrix is M = (1og2 N) (where [ ] is when the internal value is an integer) is the integer,
(If it contains a value below the decimal point, round it up to an integer), number the N rows from 0 to N-1, and set the conversion mode L.
For each (=1 to M), find the A and B rows by A=k*2 to k$2 +2 -1 B=A+2L-1 k=0 to (N/2L) -1, and The row pit arrangement of No. row and B row is A(j
), B(j), −1A′(j), B′(j
) to -1A'(j)=A(j) j=k*2L=kne2L+ 2L-" - 1-1A'
(j) 1B (j-2) j=kne2L+2L-1~k$2L+2L-1B'(
j) = B (j) j=kne2L+2L-"~k$2L+2L-1B'
(j)-4 (j + 2L-1)? =k*2 ~k
! 2 +2 -1k=0~(N/2)-1, and convert A(j) to -1A'(j) by B (j)
It is preferable that a matrix of N rows and N columns is obtained by converting B' (j) into B' (j) and changing L from 1 to M, and this matrix is used as the transposed matrix. Further, when creating the rotation block from the reference block, the reference block is constructed by setting an axis passing through the rotation apex and parallel to the reference coordinate axis as the Y axis, and an axis perpendicular to this and passing through the rotation apex as the X axis. Assuming that the X-axis and Y-axis coordinates of the element are (x, y), shift the X-coordinate of the element in the X-axis direction so that it becomes x-3'*tanθ, and further multiply it by cosθ in the X-axis direction to obtain x cosθ- Let y*sioθ be 1. Next, multiply the y coordinate by 1/c■sθ in the Y-axis direction and calculate y/co.
By moving the reference block to the (X cOsθ-y*sinθ, y/COSθ) coordinate as sθ, the reference block is moved to the same length as the rotating block in the X-axis and Y-axis directions, and below the rotating block in a triangular shape on the Y-axis. When a parallelogram is formed that protrudes out and is concave at the top, and this triangle is formed by n rows of row bits arranged parallel to the X axis, each row of the parallelogram formed by n+N rows is defined as 0 to n + Numbered N-1, n
The triangularly concave range of +1 rows and N columns is 0,
To create a mask matrix where the others are 1, and to find the 0th row, first create the 0'th row to n'th row by ANDing the 0th row to the nth row and the mask matrix, and then ' line, 0th
Mask the part where the bit in the ' row is not O, make this masked part a θ pit, take the logical OR of this masked row and the 0' row, create the 0' modified row, and change the 2' row to the 0' row. Mask the part of the 0' correction line where the bits are not 0, make this masked part 0 bits, perform the logical OR of this masked line and the 0' correction line, create the 1' correction line, and create the 3' correction line. row first
Mask the part of the corrected line where the bit is not O, and make this masked part a 0 pit, and create the 2nd corrected line by ORing this masked line with the 1st corrected line, and do the same. The part where the bit of the (n-2)'th corrected line is not 0 is masked in the n'th line, the masked part is used as a θ pit, and the logic between this masked line and the (n-2)'th corrected line is The sum is taken to create the (n-1)'th modified row, and this (n-1)th
1) It is preferable that the correction row is the 0th row, and the subsequent rows up to N-1 are obtained in the same manner to obtain a matrix of N rows and N columns, and this matrix is used as the rotation block. In addition, the image arbitrary angle rotation device of the present invention generates a reference block that represents the original image as a collection of reference blocks each consisting of a square of N×N pixels, one side of which is parallel to the axis rotated by −θ with respect to the reference coordinate axis. When creating a rotating block by rotating the reference block by θ, one of the vertices of the Moeki reference block serving as the center of rotation is set as the rotation apex, and the axis parallel to the reference coordinate axis is set as Y. The axis that is perpendicular to this axis and passes through the apex is the X axis, and the X axis of the elements constituting the reference block. The coordinates of the Y axis are x, y, and the X coordinate of the element is X - y * tanθ
An X-axis direction shift means for shifting in the X-axis direction so that
X-axis direction reduction means for multiplying the y-coordinate by l/cosθ;
rotational pronk creation means for creating a rotational block by shifting in the Y-axis direction each column of a matrix forming a parallelogram having two sides parallel to the Y-axis direction formed by the output of the axial expansion means; The amount of movement in the direction of the reference coordinate axis and the amount of movement in the direction perpendicular to the reference coordinate axis when the rotation apex of the rotation block is rotated by θ around a reference point on the reference coordinate axis that is a rotation center for rotating the original image. Calculate,
The present invention is characterized by comprising a moving means for moving the rotating block. Further, the rotating block creating means reads triangular portions of the parallelogram that protrude from the rotating block for each row bit arrangement parallel to the X axis, and the protruding triangular portions correspond to the rotating blocks. Matrix generation for generating a matrix that matches the shape of the rotating block by ORing the read row bit arrangement so as to overlap the more concave triangular part and the corresponding row bit arrangement of the concave triangular part. means, a rotation means for performing row rotation for each row of the matrix, and a transposed matrix creation means for creating a transposed matrix of the matrix, the output of the matrix creation means being input to the transposed matrix creation means to create the transposed matrix. output this matrix, and perform left rotation of this matrix by the rotating means for each row in which the bits of the triangularly protruding portion are arranged from the left end to the right end of the row by the number of the arranged protruding bits; It is preferable that the matrix thus created is input to the transposed matrix creating means to output a transposed matrix, and this matrix is used as the value of the rotation block. Furthermore, the transposed matrix creation means is an image data storage means for storing image data, and the number M of conversion modes for image data of N rows by N columns is M=(log2N) (wherein [ ] is an integer value). When, the integer is
a conversion mode calculation means for calculating the conversion mode L (=1 to M) by rounding up the integer when it includes a value below the decimal point; and numbering the N rows as 1 to N-1, According to L, from the N row to the A and B rows A=k 2 ~k$2 +2 -1B=A+2L
-1 k=0~(N/2L) -1 Calculate the row bisotto arrangement of the A and B rows A(
j), B(j);
j), B(j), -1A'(j), B'(
j) as A' (j) = A (j) J=kne2 ~
kne2+2-1-1A'(j)=B(j-2L-")j=k*
2 +2 ~k$2 +2 -1n'(j)-B(j
) J2k2+2 ~kne2 +2 -1B'(j)1A
(j+2L) j=k*2 ~k pieces 2+2 -1k=0~(N/
2L) −1, and A(j), B(j
) into -1A'(j) and B'(j), respectively,
It is preferable to perform this operation by changing L from 1 to M to obtain a matrix of N rows by N columns. In addition, as the rotating block creating means, the parallelogram protrudes below the rotating block in a triangular shape on the Y axis, and is a parallelogram with a concave upper part υ, and this triangle is arranged in n rows of bits parallel to the X axis. If formed by
Each row of the parallelogram formed by n+N rows is 0-n+
A mask matrix numbered N1 and consisting of n1,11 rows and N columns, with the triangular concave range set to 0 and the rest set to 1, and a mask matrix numbered from k rows to k + n rows, consisting of n + 1 rows and N columns. and a masking means for creating the k'th to (k+n)'th rows by ANDing with The mask part is set to 0 bits and the masked line is ORed with the (k-1)'th modified line to create the k'th modified line. Then, the masking means calculates the k'th line to the (k+n)'th line, and the corrected line creating means sequentially calculates the (k+n-1)'th corrected line from the k'th corrected line. )' It is preferable to set the correction row as the k-th row, to obtain the N-1 rows from the θ row, to obtain a matrix of N rows and N columns, and to use this matrix as a rotation block.

作用 まず本発明の基本的な考え方を第1図を用いて説明する
Operation First, the basic concept of the present invention will be explained using FIG.

元画像100を基準座標軸101上の基準点102のま
わりに任意角θ回転して破線で示す目的画像103を得
るものとする。
It is assumed that the original image 100 is rotated by an arbitrary angle θ around the reference point 102 on the reference coordinate axis 101 to obtain the target image 103 shown by the broken line.

まず、元画像100を、基準座標軸101を−θ回転し
た軸に一辺が平行な正方形でN×Nの画素からなる基準
ブロック104の集合体として表す。
First, the original image 100 is represented as a collection of reference blocks 104 each having a square shape with one side parallel to an axis obtained by rotating the reference coordinate axis 101 by -θ and consisting of N×N pixels.

次に各基準ブロック104をその頂点の1つを回転頂点
106として、これを中心にθ回転し、回転ブロック1
05を作成する。
Next, each reference block 104 is rotated by θ around one of its vertices as the rotation apex 106, and the rotation block 1
Create 05.

次にこの回転ブロック105の回転頂点106を基準点
102を中心としてθ回転した時生じる基準座標軸10
1方向の移動量△Y,基準座標軸101に直角方向の移
動量△Xを算出し、回転ブロック105を基準座標軸1
01方向に△Y,基準座標軸101に直角方向に△X1
それぞれ平行移動する。
Next, the reference coordinate axis 10 generated when the rotation apex 106 of this rotation block 105 is rotated by θ around the reference point 102
The amount of movement △Y in one direction and the amount of movement △X perpendicular to the reference coordinate axis 101 are calculated, and the rotating block 105 is moved to the reference coordinate axis 1.
△Y in the 01 direction, △X1 in the direction perpendicular to the reference coordinate axis 101
Each moves in parallel.

このようにすると回転頂点106は点107に移動する
。このように各基準ブロック104が移動した集合体が
破線で示す目的画像103を構成するので元画像100
を任意角θ回転することができる。次に基準ブロック1
04を回転して回転ブロック105を作成する方法につ
いて第2図〜第7図を用いて説明する。
In this way, the rotation apex 106 moves to the point 107. The aggregate of each of the reference blocks 104 moved in this way constitutes the target image 103 shown by the broken line, so the original image 100
can be rotated by any angle θ. Next, reference block 1
04 to create the rotating block 105 will be explained using FIGS. 2 to 7.

第2図において、正方形の基準ブロック104内のすべ
ての点を、正方形の1辺である直線01Kl上の点をX
軸に平行に移動(シフト)シて直線0+  K2上に移
すように移動する。
In FIG. 2, all points in the square reference block 104 are
Move (shift) parallel to the axis and move onto the straight line 0+K2.

回転角をθ,基準ブロック104内の任意の点の座標X
+ yy移動後の座標をX,YとするとX,Y=x−y
*TANθ,y 以上の変換を実施すると基準ブロック104は第3図に
示す平行四辺形Aとなる。
The rotation angle is θ, and the coordinates of any point in the reference block 104 are
+ If the coordinates after moving yy are X, Y, then X, Y = x-y
*TANθ,y After performing the above transformation, the reference block 104 becomes a parallelogram A shown in FIG.

次に第3図において平行四辺形Aの1辺m1が回転ブロ
ック105の1辺m2と重なるように平行四辺形A内の
各点をX軸方向に圧縮する。これにより各点の座標X,
Yは、 X,Y= (x  y*’rANθ>COSθ,yx*
cosθ−yネSINθ,y 以上の変換を実行すると平行四辺形Aは第4図に示す平
行四辺形Bに変形する。
Next, in FIG. 3, each point in the parallelogram A is compressed in the X-axis direction so that one side m1 of the parallelogram A overlaps one side m2 of the rotating block 105. As a result, the coordinates of each point
Y is X, Y= (x y*'rANθ>COSθ,yx*
cosθ−y−SINθ,y When the above transformation is performed, parallelogram A is transformed into parallelogram B shown in FIG.

次に第4図において平行四辺形BoP点がQ点と重なる
ように平行四辺形Bt−Y軸方向に拡大する。これによ
り各点の座標X,Yは、 X,Y=x*COSθ−y*SINθ,3’/COSθ
以上の変換を実行すると平行四辺形Bは第5図に示す平
行四辺形Cに変形する。
Next, in FIG. 4, the parallelogram is enlarged in the Bt-Y axis direction so that the parallelogram BoP point overlaps the Q point. As a result, the coordinates X, Y of each point are: X, Y=x*COSθ−y*SINθ,3'/COSθ
When the above conversion is executed, parallelogram B is transformed into parallelogram C shown in FIG.

第5図において、b点がC点,f点がg点に重なるよう
に平行四辺形C内のすべての点をY軸方向に移動(シフ
ト)すると回転ブロック105の位置に回転が完了する
In FIG. 5, when all points within the parallelogram C are moved (shifted) in the Y-axis direction so that point b overlaps point C and point f overlaps point g, rotation is completed to the position of rotation block 105.

各点の座標X,Yは、 X=x*COSθ一y*SINθ Y=y*/COSo十(XネCOSθ−y*SINθ)
*TANθ =x*SINθ+y*cosθ となり、これは従来の技術の項で説明した式と一致する
The coordinates X and Y of each point are:
*TANθ=x*SINθ+y*cosθ, which agrees with the formula explained in the prior art section.

ところで、通常のメモリの構造はX軸方向つまシ行方向
のビット並びはワード単位などで一緒に読み込んだシ書
き込んだシすることができるが、Y軸方向つまり列方向
のビット並びは、1ビットづつでないと読み出し、書き
込みができない。特別なメモリ構造を採用すれば列方向
も複数ビット単位の処理ができるがそのようにすると回
路構成が大きく複雑になる。このようなメモリの特性か
ら考えると第5図に示す平行四辺形Cの作成までは、シ
フトと拡大,縮小処理なので通常のメモリで行単位での
ビット処理が可能であるが、平行四辺形CをY軸に平行
にシフトして回転ブロック105に合致される処理は1
ビット処理となシ、迅速な処理ができない。そこで本発
明は、通常のメモリを用いてこの平行四辺形CをY軸に
平行にシフトする方法を次に示すように2通りの方法で
実施する。
By the way, in the structure of a normal memory, the bit arrangement in the X-axis direction and the row direction can be read and written together in word units, but the bit arrangement in the Y-axis direction, that is, in the column direction, is one bit. Otherwise, reading and writing cannot be performed. If a special memory structure is adopted, it is possible to perform processing in units of multiple bits in the column direction, but the circuit configuration becomes large and complicated. Considering these characteristics of memory, until the parallelogram C shown in Figure 5 is created, it is possible to perform bit processing on a line-by-line basis with ordinary memory because it is a shift, enlargement, and reduction process. The process of shifting parallel to the Y axis and matching with the rotation block 105 is 1
Due to bit processing, quick processing is not possible. Therefore, in the present invention, two methods are used to shift the parallelogram C in parallel to the Y axis using an ordinary memory, as shown below.

まず一方の方法を第6図を用いて説明する。First, one method will be explained using FIG. 6.

第6図においてステップ1は第5図の状態と同じである
。平行四辺形Cの三角形abcを上方の三角形部に移動
する。移動は行単位で行いO行を0′行へ2行を2′行
へと移動すると、三角形abeは上部に移システップ2
に示すように正方形の行列となる。次にステップ20行
列の転置行列をとったのがステップ3である。ステップ
3において三角形の部分は図示した位置に移動する。次
に左ローティトシフトを行い三角形abcの部分をすべ
て右側にくるようにするとステップ4が得られる。この
ステップ4の行列の転置行列をとるとステップ5に示す
状態となる。この時の三角形部は図示するようにbの位
置がステップIのCの位置に移動している。
In FIG. 6, step 1 is the same as the state in FIG. Move triangle abc of parallelogram C to the upper triangle. The movement is done row by row, moving row O to row 0' and row 2 to row 2', triangle abe moves to the top.Step 2
It becomes a square matrix as shown in . Next, in step 3, the transposed matrix of the step 20 matrix was obtained. In step 3, the triangular part is moved to the position shown. Next, perform a left rotation shift so that all the parts of triangle abc are on the right side, and step 4 is obtained. When the transposed matrix of the matrix in step 4 is taken, the state shown in step 5 is obtained. At this time, the position b of the triangular part has moved to the position C in step I as shown in the figure.

つまシすべての図形がY軸方向に平行移動した図形とな
シ、回転ブロック105が得られたことになる。
A rotation block 105 is obtained in which all the shapes are translated in parallel in the Y-axis direction.

他の方法を第7図を用いて説明する。Another method will be explained using FIG.

本方法は平行四辺形Cの行列を正方形の行列にする処理
を表すもので、k行をA×××よりABCDの行に変換
する方法を示したものである。
This method represents a process of converting a parallelogram C matrix into a square matrix, and shows a method of converting k rows from AXX to ABCD rows.

ステップ1において、三角形部の大きさより定まるマス
ク1をk行よりマスク1の大きさにより決まる行までか
け右端の行列を得る。ステンプ2では、マスク2を(k
+1)’ 行にかぶせ右端の行を得る。ステップ3でk
′行とステップ2で得た行との論理和をとシ右端の行を
得る。ステップ4でマスク3を(k+2)’行にかぶせ
右端の行を得、ステップ5でこの行とステノプ3で得た
行との論理和をとり右端の行を得る。ステップ6でマス
ク4を(k+3)’行にかぶせ右端の行を得、ステップ
7てこの行とステップ5で得た行との論理和をとり、求
める行ABCDを得る。このような処理を各行について
行うことにより、平行四辺形CをY軸に平行移動したと
同じ結果が得られ回転ブロック105が得られる。
In step 1, mask 1 determined by the size of the triangular portion is applied from row k to the row determined by the size of mask 1 to obtain the right-most matrix. In step 2, mask 2 is set to (k
+1)' Overlap the line to get the rightmost line. k in step 3
' row and the row obtained in step 2 are logically summed to obtain the rightmost row. In step 4, mask 3 is applied to row (k+2)' to obtain the rightmost row, and in step 5, this row is ORed with the row obtained by step 3 to obtain the rightmost row. In step 6, the rightmost row is obtained by covering the (k+3)' row with mask 4, and in step 7, the logical sum of the lever row and the row obtained in step 5 is taken to obtain the desired row ABCD. By performing such processing for each row, the same result as when the parallelogram C is translated in parallel to the Y axis is obtained, and the rotation block 105 is obtained.

実施例 以下本発明の一実施例を第1図〜第16図を用いて説明
する。
EXAMPLE An example of the present invention will be described below with reference to FIGS. 1 to 16.

第8図は本発明の実施例の構成を示すブロック図である
FIG. 8 is a block diagram showing the configuration of an embodiment of the present invention.

基準ブロック生成手段1は元画像100を第1図で説明
したように基準座標軸101に対して−θ(ここでθと
は元画像100をθ回転して目的画像103を作成する
場合の回転角)回転した軸に一辺が平行なN×Nの画素
からなる基準ブロック104の集合として構成するよう
、この構成要素たる基準ブロック104を生成する手段
である。X軸方向シフト手段2は、第1図で説明したよ
うに基準ブロック104の頂点の1つを回転頂点106
とし、この回転頂点106を通り基準座標軸101に平
行な軸をY軸とし、これを直交し、回転頂点106を通
る軸をX軸とし、基準ブロック104を構成する要素の
X軸,Y軸の座標をxe’lとし、第2図で説明したよ
うに基準ブロック104の1辺である直線01−Kl上
の点をX軸に平行に移動してY軸上の直線01−K2に
移すよう、基準ブロック104内のすべての点を移動し
第3図に示す平行四辺形Aを作成する手段である。この
とき基準ブロック104内の点X+yはX, Yで表さ
れ X,Y=x*TANθ,yとなる。
The reference block generation means 1 rotates the original image 100 by -θ with respect to the reference coordinate axis 101 as explained in FIG. ) This is means for generating reference blocks 104, which are constituent elements, so as to be configured as a set of reference blocks 104 each consisting of N×N pixels with one side parallel to the rotated axis. As explained in FIG.
The axis passing through this rotation apex 106 and parallel to the reference coordinate axis 101 is the Y axis, and the axis perpendicular to this and passing through the rotation apex 106 is the X axis. Let the coordinates be xe'l, and as explained in Fig. 2, move the point on the straight line 01-Kl, which is one side of the reference block 104, parallel to the X-axis and move it to the straight line 01-K2 on the Y-axis. , is means for moving all points within the reference block 104 to create a parallelogram A shown in FIG. At this time, the point X+y in the reference block 104 is represented by X, Y, and X, Y=x*TANθ,y.

X軸方向縮小手段3は第3図で示した平行四辺形Aを第
4図で示す平行四辺形BになるようX軸方向に縮小する
手段である。
The X-axis direction reduction means 3 is a means for reducing the parallelogram A shown in FIG. 3 into the parallelogram B shown in FIG. 4 in the X-axis direction.

これにより縮小後の座標X,Yは、 X.Y=x*COSθ−y*SINθ,yとなる。As a result, the coordinates X, Y after reduction are X. Y=x*COSθ−y*SINθ,y.

このX軸方向への縮小の具体例を第9図に示す。A specific example of this reduction in the X-axis direction is shown in FIG.

第9図において、ソーヌデータは縮小前の行データであ
り、縮小率が2/3であるとすると、縮小処理後データ
に示すようにソースデータの9ビットのうち3ビットを
間引いた6ビットの行データとなる。
In Figure 9, the Saone data is the row data before reduction, and if the reduction rate is 2/3, then as shown in the data after reduction processing, 6 bits are obtained by thinning out 3 bits out of the 9 bits of the source data. This becomes row data.

Y軸方向拡大手段4は、第4図の平行四辺形BをY軸方
向に拡大し第5図に示す平行四辺形Cにする手段である
。これにより拡大後の座標X,YはX,Y=x*COS
θ−y*SINθ,y/COSθとなる。
The Y-axis direction enlarging means 4 is a means for enlarging the parallelogram B shown in FIG. 4 in the Y-axis direction to form a parallelogram C shown in FIG. As a result, the coordinates X, Y after enlargement are X, Y = x * COS
θ-y*SINθ, y/COSθ.

第lO図はY軸方向への拡大処理の具体例を示す。FIG. 10 shows a specific example of enlargement processing in the Y-axis direction.

第10図において、ソースデータは拡大前の各行を示し
、拡大率を1.5倍とすると、ンースデータの4行に0
ラインと2ラインを追加して、6行のデータとし拡大処
理後データに示すようにしたものである。
In Figure 10, the source data shows each row before enlargement, and if the enlargement rate is 1.5 times, 4 rows of source data have 0
By adding this line and 2 lines, we have 6 lines of data as shown in the enlarged data.

回転ブロック作成手段5は第5図で示した平行四辺形C
を形成する行列の各列をY軸方向にシフトして第1図に
示す回転ブロック105を作成する手段であシ、詳細は
後述する。
The rotation block creating means 5 is a parallelogram C shown in FIG.
The rotation block 105 shown in FIG. 1 is created by shifting each column of the matrix forming the .

移動手段6は、第1図に示すように回転ブロック105
0回転頂点106を、元画像100を回転する回転中心
となる基準点102を中心としてθ回転する時の基準座
標軸101方向の移動量ΔY,基準座標軸101に直角
方向の移動量ΔXを算出し、各回転ブロック105を移
動する手段で、これにより元画像100はθ回転され目
的画像103となる。次に回転ブロック生成手段5の詳
細について説明する。
The moving means 6 includes a rotating block 105 as shown in FIG.
Calculate the amount of movement ΔY in the direction of the reference coordinate axis 101 and the amount of movement ΔX in the direction perpendicular to the reference coordinate axis 101 when the zero-rotation vertex 106 is rotated by θ around the reference point 102, which is the rotation center for rotating the original image 100, This is means for moving each rotation block 105, whereby the original image 100 is rotated by θ and becomes the target image 103. Next, details of the rotating block generating means 5 will be explained.

本発明では回転ブロック生成手段5について2つの方法
の技術を開示する。まず第1の方法を第11図〜第13
図を用いて説明する。
The present invention discloses two techniques for the rotating block generating means 5. First, the first method is shown in Figures 11 to 13.
This will be explained using figures.

第11図は回転ブロック生成手段5の構成を示すブロッ
ク図で、行列生成手段51は第5図で示したように平行
四辺形Cの回転ブロック105よりはみ出した三角形状
部分abcをX軸に平行な行ビット並びごとに読み出し
、回転ブロック105より凹んだ三角形状部分efgに
重なるよう、この読み出した行ビット並びを凹んだ三角
形状部に書き込む手段である。第12図(a). (b
)はこの具体例を表したものでこれについて説明する。
FIG. 11 is a block diagram showing the configuration of the rotation block generation means 5. As shown in FIG. This is means for reading each row bit arrangement and writing the read row bit arrangement in a recessed triangular portion so as to overlap the recessed triangular portion efg from the rotation block 105. Figure 12(a). (b
) represents this specific example, which will be explained below.

(a)図は平行四辺形Cを表す行列である。下線のつい
たビットがはみ出した三角形を構成するビットである。
(a) The figure shows a matrix representing a parallelogram C. The underlined bits are the bits that make up the protruding triangle.

(a)図の行列に対して次の操作を行う。(a) Perform the following operations on the matrix shown in the figure.

■ アンダーラインを付加された第8行の行データ( 
震一互坦−6L竺一旺)を読み出す。次にこの行データ
を書き込むべき場所のデータ第0行(0001    
        )を読み出し、この2つの行データの
論理和をとシ第0行に書き込む。
■ Line data of the 8th line with underline added (
Read out the ``Shinichi Mutualtan - 6L Jikuichiwang''. Next, the data row 0 (0001
) and write the logical sum of these two row data in the 0th row.

■ 次に第9行データ(         74 75
呈)を読み出し、この行データを書き込むべき第1行の
データ(1o  11 02 03       )を
読み出し、この2つの行データの論理和をとシ第1行に
書き込む。
■ Next, the 9th row data (74 75
The first row data (1o 11 02 03 ) into which this row data should be written is read out, and the logical sum of these two row data is written in the first row.

■ 第io行データ(            工IO
を読み出し、この行データを書き込べき第2行のデータ
(20  21  12  13  04  05  
   )を読み出し、この2つの行データの論理和をと
9第2行に書き込む。
■ io-th row data (engineering IO
and write the second row data (20 21 12 13 04 05
) is read and the logical sum of these two row data is written in the second row.

以上の処理によ原b)図の行列ができる。The above processing creates the matrix shown in the original figure b).

次に転置行列作成手段52によ,? (b)図の転置行
列を作成すると(c)図のようになる。転置行列の作成
については第13図を用いて後述する。次に(c)図に
おいて下線のついたビットを有する行について、ローテ
ィト手段53により、下線の付いたビットがすべて右側
にゆくまで左ローティトを行う。この結果(ω図が得ら
れる。この処理は次の手順で行われる。(e)図Kおい
て、 ■ 第2行のデータ(一η02 12 22 32 4
2 5262)を読み出す。下線のついたビットの数で
ある1ビットだけ左ローティトを行いこの結果(021
2 22 32 42 52 62ヱυを元の第2行に
書き込む。
Next, by the transposed matrix creation means 52, ? When the transposed matrix in figure (b) is created, it becomes as shown in figure (c). Creation of the transposed matrix will be described later using FIG. 13. Next, with respect to the row having the underlined bits in the figure (c), the rotation means 53 performs left rotation until all the underlined bits move to the right side. As a result, the ω diagram is obtained. This process is performed in the following steps.
2 5262). Rotate left by 1 bit, which is the number of underlined bits, and the result is (021
Write 2 22 32 42 52 62ヱυ in the original second line.

■ 第3行のデータ(ユ03 13 23 33 34
 4353  63)を読み出し、1ビット左ローテイ
トし、その結果(03 13 23 33 43 53
 63 73)を元の第3行に書き込む。
■ Third row data (U03 13 23 33 34
4353 63), rotate left by 1 bit, and the result is (03 13 23 33 43 53
63 73) on the original third line.

以下第4行〜第6行まで同様に行う。The same process is repeated from the 4th line to the 6th line.

■ 第7行のデータ(且恒−77 07 17 27 
3747)を読み出し下線のついだビット数である3ビ
ット左ローティトしその結果(07 17 27 37
47 57 67 77 )を第7行に書き込む。
■ Data on the 7th line (and Heng-77 07 17 27
3747) and left-rotate 3 bits, which is the number of underlined bits, and the result is (07 17 27 37
47 57 67 77) on the 7th line.

次に(d)図の行列を再び転置行列作成手段52で転置
行列とすると(e)図が得られる。この(e)図に示す
行列が(a)図をY軸方向に各列毎にシフトして得られ
る行列であシ、回転ブロック105を表している。
Next, when the matrix in figure (d) is again transformed into a transposed matrix by the transposed matrix creation means 52, figure (e) is obtained. The matrix shown in Figure (e) is a matrix obtained by shifting Figure (a) column by column in the Y-axis direction, and represents the rotation block 105.

次に13図を用いて転置行列を作成する方法について説
明する。
Next, a method for creating a transposed matrix will be explained using FIG.

画像データ記憶手段521は画像データを記憶する。変
換モード演算千段522は画像データ記憶千段521に
N行×N列の画像データが記憶されている場合、この変
換モード数Mを次の式で算出する。
Image data storage means 521 stores image data. The conversion mode calculation 1,000 stages 522 calculates the conversion mode number M using the following formula when image data of N rows by N columns is stored in the image data storage 521.

M = ( logz N ) 但し〔 〕は内部の数値が整数のときはその整数を、少
数点以下の数値を含むときは切り上げた整数を表す。変
換モード数Mを求めた後、変換モードLの値を1からM
まで出力する。
M = (logz N) However, [ ] represents the integer when the internal value is an integer, and represents the integer rounded up when it includes a value below the decimal point. After determining the number of conversion modes M, change the value of conversion mode L from 1 to M.
Output up to.

行選択手段523は変換モード演算手段522の出力す
る変換モードLの値に応じて、前記N行×N列の行番を
0〜N−1と付番するとして、N行の中からA番行とB
番行とを次の式により定める。
The row selection means 523 selects the A number from among the N rows, assuming that the row numbers of the N rows×N columns are numbered from 0 to N-1 according to the value of the conversion mode L output from the conversion mode calculation means 522. row and B
The bank line is determined by the following formula.

A=k本2 〜k*2  +2   −1B=A+2L −1k=0〜(N/2)−1 このA番行とB番行のビット並びをA(j), B(j
)(ここでj=o〜N−1)を選択する。
A=k lines 2 ~k*2 +2 -1B=A+2L -1k=0~(N/2)-1 The bit arrangement of the A-th row and B-th row is A(j), B(j
) (where j=o to N-1).

画像変換手段524はこのA(j). B(j)を入力
し、A′(j),  B’(j)を次の式で求める。
The image conversion means 524 converts this A(j). Input B(j) and find A'(j) and B'(j) using the following formula.

A ′(j) = A (j) L     L−1 j=k寧2 〜k率2+2   −I −1A′(j)=B (j−2   )L     L
−I         L     Lj=kネ2 +
2  〜k$2  +21 B’(j)=B(j) j=k*2 千2  〜k本2+2 B’(j)=A (j+2   ) 1 j=k$2〜k$2 +2  −1 k=0〜(N/2)−1 そして、画像データA(j),  B(j)をそれぞれ
A ’ (j),B’(j)に変換する。この操作を変
換モードLを1からMtで変化させて行うことによりN
行×N列の行列が求まる。この行列が転置行列である。
A'(j) = A (j) L L-1 j=kning2 ~k rate 2+2 -I -1A'(j)=B (j-2) L L
−I L Lj=kne2 +
2 ~k$2 +21 B'(j)=B(j) j=k*2 1,0002 ~k pieces2+2 B'(j)=A (j+2) 1 j=k$2~k$2 +2 -1 k=0 to (N/2)-1 Then, image data A(j) and B(j) are converted to A'(j) and B'(j), respectively. By performing this operation while changing the conversion mode L from 1 to Mt, N
A matrix with rows and N columns is found. This matrix is the transposed matrix.

なお、転置行列を求める方法は多くの技術が公開されて
いるので、これらの方法を用いてもよい。
Note that many techniques for obtaining the transposed matrix have been published, and these methods may also be used.

次に回転ブロック生成手段5の第2方法について第14
図〜第16図を用いて説明する。
Next, regarding the second method of the rotating block generating means 5, the fourteenth
This will be explained using FIGS.

第14図は回転プロンク生成手段5を構成するフロック
図である。マスク十段54は、第5図に示した平行四辺
形Cが三角形状にY軸下方にはみ出している部分abc
がX軸に平行な行ビット並びでn行で形成され、回転ブ
ロック105がN行×N列で形成される場合、n+N行
で形成される平行四辺形Cの各行を0 − n + N
 − 1と付番し、n + 1行×N列よりなり三角形
abcの部分を0,他を1とするマスク行列を作成し、
平行四辺形COk行からk+n行までのn+1行×N列
との論理積により第k′行〜第(k+n)’行を作成す
る。これを第15図の具体例で説明する。第15図のス
テソプ1において、左端の行列は、第5図の平行四辺形
Cを表している。回転ブロック105は8行×8列の行
列であシ三角形部abcは3行×8列の行列である。故
にマスク行列は中央のマスク1に示すように4行×8列
のようになる。そして、このマスク1を、平行四辺形C
の第3行〜第7行に対して適用したのがステップ1であ
り、右端に示すように三角形部分に相幽するところが0
となる4行×8列の行列が得られる。修正行作成千段5
5はマスク千段54によって得られた第(k+1)’を
、第(k−1)’修正行(これは第k′行に等しい)の
ビットが0でない部分をマスクして、このマスクした部
分を0ビットとし、このマスクした行と第1−1)’ 
修正行との論理和をとって第k′修正行を算出し、これ
を用いて順次第(k+n−1)’修正行を求め、この第
(k+n−1)’修正行をk行とし、0行よりN−1行
まで求めてN行×N列の行列を求める。この行列が回転
ブロック105となる。
FIG. 14 is a block diagram configuring the rotary prong generation means 5. The mask 54 has a portion abc in which the parallelogram C shown in FIG. 5 protrudes below the Y axis in a triangular shape.
is formed of n rows with row bits arranged parallel to the
- Create a mask matrix numbered 1, consisting of n+1 rows and N columns, with triangle abc as 0 and the rest as 1,
The k'-th to (k+n)'-th rows are created by ANDing the (n+1 rows by N columns) from the parallelogram COk row to the k+n row. This will be explained using a specific example shown in FIG. In step 1 in FIG. 15, the leftmost matrix represents the parallelogram C in FIG. The rotation block 105 is a matrix with 8 rows and 8 columns, and the triangular part abc is a matrix with 3 rows and 8 columns. Therefore, the mask matrix has 4 rows and 8 columns as shown in Mask 1 in the center. Then, this mask 1 is transformed into a parallelogram C
Step 1 was applied to the 3rd to 7th rows of
A matrix of 4 rows and 8 columns is obtained. Edit line creation 1000 steps 5
5 masked the (k+1)'th obtained by the 1,000th mask stage 54 by masking the part where the bit of the (k-1)'th modified row (this is equal to the k'th row) is not 0. The part is set to 0 bits, and this masked line and the 1st-1)'
Calculate the k'-th modified row by calculating the logical sum with the modified row, use this to sequentially find (k+n-1)' modified rows, set this (k+n-1)'-th modified row as k row, Find rows from 0 to N-1 to obtain a matrix of N rows and N columns. This matrix becomes the rotation block 105.

次に、これを第15図、第16図により具体的に説明す
る。
Next, this will be explained in detail with reference to FIGS. 15 and 16.

第15図のステノプ2において、マスク2は第(3−1
)′修正行、っまシステノプ1の右端行列の第3′行の
ビントが0でない部分を0とし他を1としたマスクであ
り、これを第4′行にマスクした結果が右端に示す行列
となる。ステップ3において、第(3−1)’ 修正行
とステップ2において得られた行との論理和を求め、得
られた行が第3′修正行である。ステップ4では第3′
修正行のビットが0でない部分を01他を1とするマス
ク3で第5′行をマスクしこれによって得られた行をス
テップ5で第3′修正行と論理和をとると第4′修正行
が得られる。そしてステノプ6で第4′修正行のビット
が0でない部分を01他を1とするマスク4で第6′行
をマスクし、これによって得られた行をステノプ7で第
4′修正行と論理和をとると第5′修正行が得られる。
In the stenop 2 shown in FIG. 15, the mask 2 is
)' correction row, it is a mask in which the bits of the 3'th row of the rightmost matrix of Systemop 1 are set to 0 and the others to 1, and the result of masking this to the 4'th row is the matrix shown at the right end. becomes. In step 3, the logical sum of the (3-1)'th corrected line and the line obtained in step 2 is calculated, and the obtained line is the 3'th corrected line. In step 4, the 3'
The 5'th line is masked with mask 3, which sets the non-0 bits of the corrected line to 01 and the others to 1, and the resulting line is ORed with the 3'th corrected line in step 5 to obtain the 4th corrected line. line is obtained. Then, in step 6, the 6'th line is masked with mask 4, which sets the part where the bit of the 4'th modified line is not 0 to 01, and the other bits are set to 1, and the line obtained by this is logically used as the 4'th modified line in step 7. By adding the sum, the 5'th modified row is obtained.

この第5′修正行をステップ1に示す第3行とする。こ
のような操作をステップ1の0−N−1行まで行うこと
により、ステップ8に示す8行×8列の行列が得られ、
この行列が回転ブロック105である。
Let this 5'th modified line be the third line shown in step 1. By performing such operations up to the 0-N-1 rows in step 1, the 8 rows x 8 columns matrix shown in step 8 is obtained.
This matrix is the rotation block 105.

なお、回転ブロック生成千段5として、第1の方法を用
いるか第2の方法を用いるかの判断基準として、1度に
回転するビント数が少ない場合や、回転角θが小さい場
合は第2の方法の方が高速に実行でき、他の場合は第1
の方法を用bた方が高速に実行できる。
As a criterion for determining whether to use the first method or the second method for the rotation block generation stage 5, if the number of bits rotated at one time is small or the rotation angle θ is small, the second method is used. method can be executed faster, and in other cases the first method
It is faster to use method b.

発明の効果 以上の説明から明らかなように、本発明は元画像を所定
の大きさのブロックに分割し、このブロックについてシ
フト,縮小,拡大,行の入れ換え,90度回転,ローテ
ィトなど、行単位しての操作を行うことにより、通常の
構造のメモリを用いて、画像の任意角回転を迅速に行う
ことができる。
Effects of the Invention As is clear from the above explanation, the present invention divides an original image into blocks of a predetermined size, and performs operations such as shifting, reducing, enlarging, swapping lines, rotating 90 degrees, rotating, etc. on a line-by-line basis for each block. By performing this operation, it is possible to quickly rotate an image to any angle using a memory with a normal structure.

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

第1図は本発明の原理を示す図、第2図はX軸方向シフ
ト手段の説明図、第3図はX軸方向縮小手段の説明図、
第4図はY軸方向拡大手段の説明図、第5図は第2〜第
4図に示す手段で処理した結果を示す図、第6図は平行
四辺形をY軸方向にシフトして正方形とする第1の方法
を示す図、第7図は平行四辺形をY軸方向にシフトして
正方形とする第2の方法を示す図、第8図は本発明の実
施例の構成を示すブロック図、第9図はX軸方向縮小手
段によるX軸方向の縮小の具体例を示す図、第lO図は
Y軸方向拡大手段によるY軸方向の拡大の具体例を示す
図、第11図は回転ブロック作成手段の第1の装置を示
すブロック図、第12図は第11図に示す装置の動作例
を示す図、第13図は第11図の転置行列作成手段の詳
細を示すブロック図、第14図は回転ブロック生成手段
の第2の装置を示すブロック図、第15図、第16図は
第14図に示す装置の動作例を示す図である。 1・・・基準ブロック生成手段、2・・・X軸方向シフ
ト手段、3・・・X軸方向縮小手段、4・・・Y軸方向
拡大手段、5・・・回転ブロック作成手段、51・・・
行列生成手段、52・・・転置行列作成手段、521・
・・画像データ記憶手段、522・一・変換モード演算
手段、523・・・行選択手段、524・・・画像変換
手段、553・・・ローティト手段、54・・・マスク
手段、55・・・修正行作成手段、6・・・移動手段。
FIG. 1 is a diagram showing the principle of the present invention, FIG. 2 is an explanatory diagram of the X-axis direction shifting means, and FIG. 3 is an explanatory diagram of the X-axis direction reduction means,
Fig. 4 is an explanatory diagram of the Y-axis direction enlarging means, Fig. 5 is a diagram showing the results of processing by the means shown in Figs. 2 to 4, and Fig. 6 is a square by shifting the parallelogram in the Y-axis direction. FIG. 7 is a diagram showing the second method of shifting a parallelogram in the Y-axis direction to make it a square. FIG. 8 is a block diagram showing the configuration of an embodiment of the present invention. 9 is a diagram showing a specific example of reduction in the X-axis direction by the X-axis direction reduction means, FIG. 12 is a block diagram showing an example of the operation of the device shown in FIG. 11; FIG. 13 is a block diagram showing details of the transposed matrix creating means in FIG. 11; FIG. 14 is a block diagram showing a second device of the rotating block generating means, and FIGS. 15 and 16 are diagrams showing an example of the operation of the device shown in FIG. 14. DESCRIPTION OF SYMBOLS 1... Reference block generation means, 2... X-axis direction shift means, 3... X-axis direction reduction means, 4... Y-axis direction enlargement means, 5... Rotation block creation means, 51.・・・
Matrix generation means, 52...Transposed matrix generation means, 521.
...Image data storage means, 522.1.Conversion mode calculation means, 523.. Row selection means, 524.. Image conversion means, 553.. Rotating means, 54.. Masking means, 55.. Correction line creation means, 6...Movement means.

Claims (8)

【特許請求の範囲】[Claims] (1)基準座標軸上の基準点に対し元画像を任意角θ回
転し目的画像を作成するに際し、前記元画像をN×Nの
画素よりなり前記基準座標軸に対し−θ回転した軸に1
辺が平行な正方形よりなる基準ブロックの集合体として
表し、前記各基準ブロックの頂点の1つを回転頂点とし
、これを中心に前記各基準ブロックをθ回転して回転ブ
ロックを作成し、この回転ブロックの前記回転頂点を前
記基準点を中心としてθ回転した時生じる前記基準座標
軸方向の移動量をΔY、前記基準座標軸に直角方向の移
動量をΔYとし、前記回転ブロックを前記基準座標軸方
向にΔY、前記基準座標軸に直角方向にΔXそれぞれ平
行移動することにより目的画像を得ることを特徴とする
画像の任意角回転方法。
(1) When creating a target image by rotating the original image by an arbitrary angle θ with respect to the reference point on the reference coordinate axis, the original image is rotated by -θ with respect to the reference coordinate axis, which is made up of N×N pixels.
It is represented as a collection of reference blocks consisting of squares with parallel sides, one of the vertices of each reference block is set as a rotation apex, each reference block is rotated by θ around this apex to create a rotation block, and this rotation The amount of movement in the direction of the reference coordinate axis that occurs when the rotation apex of the block is rotated by θ around the reference point is ΔY, the amount of movement in the direction perpendicular to the reference coordinate axis is ΔY, and the rotating block is rotated by ΔY in the direction of the reference coordinate axis. , an arbitrary angle rotation method for an image, characterized in that a target image is obtained by performing parallel translation by ΔX in a direction perpendicular to the reference coordinate axis.
(2)前記基準ブロックより前記回転ブロックを作成す
るに際し、前記回転頂点を通り前記基準座標軸に平行な
軸をY軸としこれを直交し前記回転頂点を通る軸をX軸
とし前記基準ブロックを構成する要素のX軸、Y軸の座
標を(x、y)として前記要素のx座標を x−y*tanθとなるようX軸方向にシフトし、更に
X軸方向にcosθ倍して xcosθ−y*sinθとし、 次にy座標をY軸方向に1/cosθ倍し y/cosθとして (xcosθ−y*sinθ、y/cosθ)座標に移
動することにより前記基準ブロックを前記回転ブロック
のX軸、Y軸方向の長さと同じでかつY軸方向に三角形
状に前記回転ブロックより一方がはみ出し、他方が凹ん
だ平行四辺形に形成し、この三角形状にはみ出した部分
ではX軸に平行な行ビット並びごとに読み出し、はみ出
した三角形状部が凹んだ三角形状部に重なるように、こ
の読み出した行ビット並びと凹んだ三角形状部の対応す
る行ビット並びとの論理和をとって前記回転ブロックの
形状に合致したN行×N列よりなる行列とし、このN行
×N列の行列の転置行列を求め、この転置行列の各行に
つき前記三角形状にはみ出した部分のビットが行の左端
より右端に向かって並んでいる行についてはその並んで
いるはみ出したビット数だけ左ローティトを行ってロー
ティト画像を得、このローティト画像の転置行列を演算
し、この転置行列を前記回転ブロックとすることを特徴
とする請求項1記載の画像の任意角回転方法。
(2) When creating the rotation block from the reference block, the axis passing through the rotation apex and parallel to the reference coordinate axis is the Y axis, and the axis perpendicular to this and passing through the rotation apex is the X axis, and the reference block is constructed. The coordinates of the X-axis and Y-axis of the element are (x, y), and the x-coordinate of the element is shifted in the X-axis direction so that it becomes x-y*tanθ, and then multiplied by cosθ in the X-axis direction to obtain xcosθ-y. *sin θ, and then multiply the y coordinate by 1/cos θ in the Y-axis direction to y/cos θ and move the reference block to the (xcos θ - y*sin θ, y/cos θ) coordinate, thereby changing the reference block to the X axis of the rotating block, It is formed into a parallelogram with one side protruding from the rotary block and the other side being concave in a triangular shape in the Y-axis direction and having the same length in the Y-axis direction, and the row bits parallel to the X-axis are formed in the triangular protruding part. Each row is read out, and the read row bit array is logically ORed with the row bit array corresponding to the concave triangular part so that the protruding triangular part overlaps the concave triangular part. A matrix of N rows and N columns that matches the shape is obtained, and the transposed matrix of this N rows and N columns is calculated, and for each row of this transposed matrix, the bits protruding from the triangular shape are shifted from the left end of the row to the right end. For rows lined up facing each other, left rotation is performed by the number of protruding bits in the line to obtain a rotated image, a transposed matrix of this rotated image is calculated, and this transposed matrix is used as the rotation block. 2. The method of rotating an image at an arbitrary angle according to claim 1.
(3)前記転置行列を求めるにあたり、対象とする行列
をN行×N列とし、この行列の変換モード数Mを M=〔log_2N〕 (但し〔〕は内部の数値が整数のときはその整数を、少
数点以下の数値を含むときは切り上げた整数)によって
求め、前記N行を0〜N−1と付番し、変換モードL(
=1〜M)ごとに、A番行とB番行を、 A=k*2^L〜k*2^L+2^L^−^1−1B=
A+2^L^−^1 k=0〜(N/2^L)−1 によって求め、A番行とB番行の行ビット並びをA(j
)、B(j)で表し、A′(j)、B′(j)をA′(
j)=A(j) j=k*2^L〜k*2^L+2^L^−^1−1A′
(j)=B(j−2^L^−^1) j=k*2^L+2^L^−^1〜k*2^L+2^L
−1B′(j)=B(j) j=k*2^L+2^L^−^1〜k*2^L+2^L
−1B′(j)=A(j+2^L^−^1) j=k*2^L〜k*2^L+2^L^−^1−1k=
0〜(N/2^L)−1 によって求め、A(j)をA′(j)にB(j)をB′
(j)に変換し、Lを1からMまで変化させることによ
りN行×N列の行列を求め、この行列を前記転置行列と
することを特徴とする請求項2記載の画像の任意角回転
方法。
(3) When calculating the transposed matrix, the target matrix is N rows x N columns, and the number of conversion modes M for this matrix is M = [log_2N] (where [ ] is an integer when the internal value is an integer) is rounded up to an integer when it includes a value below the decimal point), numbered the N rows from 0 to N-1, and set the conversion mode L (
=1~M), row A and row B, A=k*2^L~k*2^L+2^L^-^1-1B=
A+2^L^-^1 k=0~(N/2^L)-1, and the row bit arrangement of the A and B rows is A(j
), B(j), and A′(j), B′(j) as A′(
j)=A(j) j=k*2^L~k*2^L+2^L^-^1-1A'
(j)=B(j-2^L^-^1) j=k*2^L+2^L^-^1~k*2^L+2^L
-1B'(j)=B(j) j=k*2^L+2^L^-^1~k*2^L+2^L
-1B'(j)=A(j+2^L^-^1) j=k*2^L~k*2^L+2^L^-^1-1k=
0~(N/2^L)-1, and convert A(j) to A'(j) and B(j) to B'
(j) and changing L from 1 to M to obtain a matrix of N rows and N columns, and use this matrix as the transposed matrix. Method.
(4)前記基準ブロックより前記回転ブロックを作成す
るに際し、前記回転頂点を通り前記基準座標軸に平行な
軸をY軸としこれを直交し前記回転頂点を通る軸をX軸
とし前記基準ブロックを構成する要素のX軸、Y軸の座
標を(x、y)として前記要素のx座標を x−y*tanθとなるようX軸方向にシフトし、更に
X軸方向にcosθ倍して xcosθ−y*sinθとし、 次にy座標をY軸方向に1/cosθ倍し y/cosθとして (xcosθ−y*sinθ、y/cosθ)座標に移
動することにより前記基準ブロックを前記回転ブロック
のX軸、Y軸方向の長さと同じでかつ前記回転ブロック
より三角形状にY軸下方にはみ出し、上方が凹んだ平行
四辺形を形成し、この三角形がX軸に平行な行ビット並
びn行で形成される場合、n+N行で形成される前記平
行四辺形の各行を0〜n+N−1と付番し、n+1行×
N列よりなり前記三角形状に凹んだ範囲を0、他を1と
するマスク行列を作成し、第0行を求めるに当たり、ま
ず第0行〜第n行と前記マスク行列との論理積により第
0′行〜第n′行を作成し、第1′行を、第0′行のビ
ットが0でない部分をマスクしてこのマスク部分を0ビ
ットとし、このマスクした行と第0′行との論理和をと
って第0′修正行を作り、第2′行を第0′修正行のビ
ットが0でない部分をマスクしてこのマスク部分を0ビ
ットとし、このマスクした行と第0′修正行との論理和
をとって第1′修正行を作り、第3′行を第1′修正行
のビットが0でない部分をマスクしてこのマスク部分を
0ビットとし、このマスクした行と第1′修正行との論
理和をとって第2′修正行を作り、以下同様にして第n
′行を第(n−2)′修正行のビットが0でない部分を
マスクしてこのマスクした部分を0ビットとし、このマ
スクした行と第(n−2)′修正行との論理和をとって
第(n−1)′修正行を作り、この第(n−1)′修正
行を第0行とし、以下同様にしてN−1行まで求めてN
行×N列の行列を求め、この行列を前記回転ブロックと
することを特徴とする請求項1記載の画像の任意角回転
方法。
(4) When creating the rotation block from the reference block, an axis passing through the rotation apex and parallel to the reference coordinate axis is the Y axis, and an axis perpendicular to this and passing through the rotation apex is the X axis, and the reference block is constructed. The coordinates of the X-axis and Y-axis of the element are (x, y), and the x-coordinate of the element is shifted in the X-axis direction so that it becomes x-y*tanθ, and then multiplied by cosθ in the X-axis direction to obtain xcosθ-y. *sin θ, and then multiply the y coordinate by 1/cos θ in the Y-axis direction to y/cos θ and move the reference block to the (xcos θ - y*sin θ, y/cos θ) coordinate, thereby changing the reference block to the X axis of the rotating block, The length is the same as the length in the Y-axis direction, and it protrudes below the Y-axis in a triangular shape from the rotating block, forming a parallelogram with a concave upper part, and this triangle is formed by n rows of row bits arranged parallel to the X-axis. In this case, each row of the parallelogram formed by n+N rows is numbered 0 to n+N-1, and n+1 rows×
Create a mask matrix consisting of N columns with the triangular concave range set to 0 and the rest set to 1, and to find the 0th row, first calculate the 0th row by logical product of the 0th to nth rows and the mask matrix. Create 0'th line to n'th line, mask the part where the bit of 0'th line is not 0 in the 1'th line, set this masked part to 0 bit, and set this masked line and 0'th line. The 0'th modified row is created by taking the logical OR of the 0'th modified row, the 2'th row is used to mask the part where the bits of the 0'th modified row are not 0, this masked part is set to 0 bits, and this masked row and the 0'th modified row are The 1st corrected line is created by performing a logical OR with the corrected line, and the 3rd line is used to mask the part where the bits of the 1st corrected line are not 0, making this masked part 0 bits, and this masked line and The 2nd correction line is created by performing a logical OR with the 1st correction line, and the nth correction line is created in the same manner.
Mask the non-zero bits of the (n-2)'th modified row in the 'row', set this masked part to 0 bits, and perform the logical sum of this masked row and the (n-2)'th modified row. Create the (n-1)'th corrected line, set this (n-1)'th corrected line as the 0th line, and do the same to find up to the N-1th line to get N
2. The method of rotating an image at an arbitrary angle according to claim 1, wherein a matrix of rows and N columns is determined and this matrix is used as the rotation block.
(5)元画像を基準座標軸に対して−θ回転した軸に一
辺が平行なN×Nの画素の正方形よりなる基準ブロック
の集合体として表す基準ブロック生成手段と、前記基準
ブロックをθ回転して回転ブロックを作成するに際し、
回転中心となる前記基準ブロックの頂点の1つを回転頂
点としこの回転頂点を通り前記基準座標軸に平行な軸を
Y軸としこれと直交し前記頂点を通る軸をX軸とし前記
基準ブロックを構成する要素のX軸、Y軸の座標をx、
yとし、前記要素のx座標をx−y*tanθとなるよ
うX軸方向にシフトするX軸方向シフト手段と、このX
軸方向シフト手段の出力をX軸方向にcosθ倍するX
軸方向縮小手段と、y座標を1/cosθ倍するY軸方
向拡大手段と、前記x軸方向縮小手段と前記Y軸方向拡
大手段の出力により形成されるY軸方向に平行な2辺を
有する平行四辺形を形成する行列の各列をY軸方向にシ
フトして回転ブロックを作成する回転ブロック作成手段
と、前記回転ブロックの前記回転頂点を、前記元画像を
回転する回転中心となる前記基準座標軸上の基準点を中
心としてθ回転する時の前記基準座標軸方向の移動量と
前記基準座標軸に直角方向の移動量を算出し、前記回転
ブロックを移動する移動手段とを備えたことを特徴とす
る画像の任意角回転装置。
(5) a reference block generating means for representing an original image as a collection of reference blocks consisting of a square of N×N pixels with one side parallel to an axis rotated by -θ with respect to a reference coordinate axis; When creating a rotating block,
The reference block is configured such that one of the apexes of the reference block serving as the center of rotation is a rotation apex, an axis passing through this rotation apex and parallel to the reference coordinate axis is the Y axis, and an axis perpendicular thereto and passing through the apex is the X axis. The coordinates of the X-axis and Y-axis of the element to be x,
y, and an X-axis direction shifting means for shifting the x-coordinate of the element in the X-axis direction so that
X that multiplies the output of the axial shift means by cosθ in the X-axis direction
It has an axial reduction means, a Y-axis enlargement means for multiplying the y-coordinate by 1/cosθ, and two sides parallel to the Y-axis direction formed by the outputs of the x-axis reduction means and the Y-axis enlargement means. rotation block creation means for creating a rotation block by shifting each column of a matrix forming a parallelogram in the Y-axis direction; and the reference, which makes the rotation apex of the rotation block a rotation center for rotating the original image. The rotary block is characterized by comprising a moving unit that calculates the amount of movement in the direction of the reference coordinate axis and the amount of movement in the direction perpendicular to the reference coordinate axis when rotating by θ around a reference point on the coordinate axes, and moves the rotating block. An arbitrary angle rotation device for images.
(6)前記回転ブロック作成手段が、前記平行四辺形の
前記回転ブロックよりはみ出した三角形状部分をX軸に
平行な行ビット並びごとに読み出し、はみ出した三角形
状部がこれに対応して前記回転ブロックより凹んだ三角
形状部に重なるようにこの読み出した行ビット並びと、
凹んだ三角形状部の対応する行ビット並びとの論理和を
とって前記回転ブロックの形状に合致した行列を生成す
る行列生成手段と、行列の各行について行のローティト
を行うローティト手段と、行列の転置行列を作成する転
置行列作成手段とを備え、前記行列生成手段の出力を前
記転置行列作成手段に入力して転置行列を出力し、この
行列を前記ローティト手段で各行について前記三角形状
にはみ出した部分のビットが行の左端より右端に向かっ
て並んでいる行についてはその並んでいるはみ出したビ
ット数だけ左ローティトを行い、これにより作成した行
列を前記転置行列作成手段に入力して転置行列を出力し
、この行列を前記回転ブロックの値とすることを特徴と
する請求項5記載の画像の任意角回転装置。
(6) The rotation block creation means reads triangular portions of the parallelogram that protrude from the rotation block for each row bit arrangement parallel to the X axis, and the protruding triangular portions are rotated accordingly. This read row bit arrangement so as to overlap the triangular part concave from the block,
matrix generating means for generating a matrix matching the shape of the rotation block by performing a logical OR with the corresponding row bit arrangement of the concave triangular part; a rotating means for rotating each row of the matrix; and a transposed matrix creating means for creating a transposed matrix, the output of the matrix generating means is input to the transposed matrix creating means to output a transposed matrix, and this matrix is protruded into the triangular shape for each row by the rotating means. For rows in which the bits of the part are arranged from the left end to the right end of the row, left rotation is performed by the number of bits that are arranged outside the row, and the matrix thus created is input to the transposed matrix creation means to generate a transposed matrix. 6. The apparatus for rotating an image at an arbitrary angle according to claim 5, wherein the rotation block is outputted and this matrix is used as the value of the rotation block.
(7)前記転置行列作成手段が、画像データを記憶する
画像データ記憶手段と、N行×N列の画像データの変換
モード数Mを M=〔log_2N〕 (但し〔〕は内部の数値が整数のときはその整数を、少
数点以下の数値を含むときは切り上げた整数)によって
求め変換モードL(=1〜M)を出力する変換モード演
算手段と、前記N行を1〜N−1と付番し、前記変換モ
ードLに応じて前記N行よりA番行とB番行を A=k*2^L〜k*2^L+2^L^−^1−1B=
A+2^L^−^1 k=0〜(N/2^L)−1 により演算し、このA番行とB番行の行ビット並びA(
j)、B(j)を選択する行選択手段と、前記A(j)
、B(j)を入力し、A′(j)、B′(j)をA′(
j)=A(j) j=k*2^L〜k*2^L+2^L^−^1−1A′
(j)=B(j−2^L^−^1) j=k*2^L+2^L^−^1〜k*2^L+2^L
−1B′(j)=B(j) j=k*2^L+2^L^−^1k*2^L+2^L−
1B′(j)=A(j+2^L^−^1) j=k*2^L〜k*2^L+2^L^−^1−1k=
0〜(N/2^L)−1 によって演算し、前記画像データのA(j)、B(j)
をそれぞれA′(j)、B′(j)に変換し、この操作
をLを1からMまで変化させることによりN行×N列の
行列を求める画像変換手段とからなることを特徴とする
請求項6記載の画像の任意角回転装置。
(7) The transposed matrix creation means stores the image data, and the number of conversion modes M for image data in N rows and N columns is set to M=[log_2N] (wherein [ ] is an integer) a conversion mode calculating means for calculating the integer by rounding up the integer when it includes a value below the decimal point and outputting the conversion mode L (=1 to M), and converting the N rows to 1 to N-1. A=k*2^L~k*2^L+2^L^-^1-1B=
A+2^L^-^1 k=0~(N/2^L)-1 is calculated, and the row bit arrangement A(
j), a row selection means for selecting B(j), and said A(j)
, B(j), and convert A'(j) and B'(j) to A'(
j)=A(j) j=k*2^L~k*2^L+2^L^-^1-1A'
(j)=B(j-2^L^-^1) j=k*2^L+2^L^-^1~k*2^L+2^L
-1B'(j)=B(j) j=k*2^L+2^L^-^1k*2^L+2^L-
1B'(j)=A(j+2^L^-^1) j=k*2^L~k*2^L+2^L^-^1-1k=
0~(N/2^L)-1, A(j), B(j) of the image data
to A'(j) and B'(j), respectively, and calculates a matrix of N rows by N columns by performing this operation by changing L from 1 to M. An arbitrary angle rotation device for images according to claim 6.
(8)前記回転ブロック作成手段として、前記平行四辺
形が前記回転ブロックより三角形状にY軸下方にはみ出
し、上方が凹んだ平行四辺形であり、この三角形がX軸
に平行なビット並びn行で形成される場合、n+N行で
形成される前記平行四辺形の各行を0〜n+N−1と付
番し、n+1行×N列よりなり前記三角形状に凹んだ範
囲を0、他を1とするマスク行列とk行からk+n行ま
でのn+1行×N列との論理積により第k′行〜第(k
+n)′行を作成するマスク手段と、第(k+1)′行
を第(k−1)′修正行のビットが0でない部分をマス
クしてこのマスク部分を0ビットとし、このマスクした
行と第(k−1)′修正行との論理和をとって第k′修
正行を作る修正行作成手段とを備え、第k行を求めるに
あたり、前記マスク手段により第k′行〜第(k+n)
′行を求め、前記修正行作成手段により第k′修正行か
ら順次第(k+n−1)′修正行を求めこの第(k+n
−1)′修正行を第k行とし、0行よりN−1行まで求
めてN行×N列の行列を求めこの行列を回転ブロックと
することを特徴とする請求項5記載の画像の任意角回転
装置。
(8) As the rotating block creating means, the parallelogram is a parallelogram that protrudes below the Y axis in a triangular shape from the rotating block and has a concave upper part, and this triangle is arranged in n rows of bits parallel to the X axis. When the parallelogram is formed by n+N rows, each row of the parallelogram is numbered 0 to n+N-1, and the triangularly concave range consisting of n+1 rows and N columns is numbered 0, and the others are numbered 1. By ANDing the mask matrix and the n+1 rows by N columns from row k to k+n, the
+n)' line, and (k+1)'th line, masking the part where the bit of the (k-1)'th modified line is not 0, making this masked part 0 bit, and masking the (k+1)'th line with the masked line. a corrected line creating means for creating a k'th corrected line by taking a logical sum with the (k-1)'th corrected line, and in obtaining the kth line, the masking means )
' line is obtained, and the corrected line creating means sequentially calculates the (k+n-1)' corrected line from the k'th corrected line.
-1)' The image according to claim 5, wherein the correction row is the k-th row, and the rows from 0 to N-1 are obtained to obtain a matrix of N rows and N columns, and this matrix is used as a rotation block. Arbitrary angle rotation device.
JP2013164A 1990-01-22 1990-01-22 Arbitrary image rotation method and device Expired - Fee Related JP2695266B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2013164A JP2695266B2 (en) 1990-01-22 1990-01-22 Arbitrary image rotation method and device
US08/227,088 US5412768A (en) 1990-01-22 1994-04-13 Method and apparatus for rotating an image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013164A JP2695266B2 (en) 1990-01-22 1990-01-22 Arbitrary image rotation method and device

Publications (2)

Publication Number Publication Date
JPH03216771A true JPH03216771A (en) 1991-09-24
JP2695266B2 JP2695266B2 (en) 1997-12-24

Family

ID=11825534

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013164A Expired - Fee Related JP2695266B2 (en) 1990-01-22 1990-01-22 Arbitrary image rotation method and device

Country Status (1)

Country Link
JP (1) JP2695266B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5838837A (en) * 1995-04-10 1998-11-17 Sharp Kabushiki Kaisha Image synthesizing device
WO2004057530A1 (en) * 2002-12-20 2004-07-08 Jicoux Datasystems, Inc. Image converter, image converting method, and program
JP2005539323A (en) * 2002-09-18 2005-12-22 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Arbitrary shape image block rotation

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5838837A (en) * 1995-04-10 1998-11-17 Sharp Kabushiki Kaisha Image synthesizing device
JP2005539323A (en) * 2002-09-18 2005-12-22 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Arbitrary shape image block rotation
WO2004057530A1 (en) * 2002-12-20 2004-07-08 Jicoux Datasystems, Inc. Image converter, image converting method, and program

Also Published As

Publication number Publication date
JP2695266B2 (en) 1997-12-24

Similar Documents

Publication Publication Date Title
US5412768A (en) Method and apparatus for rotating an image
JPS60239796A (en) Circuit and apparatus for altering data in display memory
JPS59101969A (en) Method and device for processing data of binary picture pattern
JPH03216771A (en) Method and device for rotating picture at optional angle
JPS6158037B2 (en)
JPH0887596A (en) Method for high-speed 180×-rotation and inversion of image
JPS6217236B2 (en)
JP2899838B2 (en) Storage device
KR0167834B1 (en) Method & apparatus for multi-screen effect
JPH07110859A (en) Picture processing method and its device
JPH11312238A (en) Image data transfer device
JP2791014B2 (en) Character processor
JP2553726B2 (en) Method and apparatus for rotating image by 90 degrees
JP3057208B2 (en) Method and apparatus for drawing rotationally symmetric figures
JP2605609B2 (en) Dot display processing device
JPS62533B2 (en)
JPH04329482A (en) Image rotation processing method and processing device for relevant method
JP2803235B2 (en) Digital image processing method
JP2548286B2 (en) Image data processor
JP2512252B2 (en) Image scaling device
JP2658864B2 (en) Character processor
JPH0573693A (en) Outline paint out system
JPH01287784A (en) Image processor
JPH06274610A (en) Arbitrary angle rotation processing method
JPS61151783A (en) Method and device for affine transformation processing of picture

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees