[go: up one dir, main page]

JP2695266B2 - Arbitrary image rotation method and device - Google Patents

Arbitrary image rotation method and device

Info

Publication number
JP2695266B2
JP2695266B2 JP2013164A JP1316490A JP2695266B2 JP 2695266 B2 JP2695266 B2 JP 2695266B2 JP 2013164 A JP2013164 A JP 2013164A JP 1316490 A JP1316490 A JP 1316490A JP 2695266 B2 JP2695266 B2 JP 2695266B2
Authority
JP
Japan
Prior art keywords
row
axis
matrix
rotation
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2013164A
Other languages
Japanese (ja)
Other versions
JPH03216771A (en
Inventor
豊 尾崎
Original Assignee
松下電送株式会社
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 松下電送株式会社 filed Critical 松下電送株式会社
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 transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/602Rotation of whole images or parts thereof by block rotation, e.g. by recursive reversal or rotation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、文字や図形などの画像データを任意角回転
させる画像データの回転方法および装置に関する。
BACKGROUND OF THE INVENTION 1. 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 at an arbitrary angle.

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

ソース画像(元画像)の1画素をX座標とY座標で
SX,SYと表現し、回転角をaとし、回転後のディストネ
ーション画像(目的画像)の対応するX座標,Y座標を
DX,DYとすると、DX,DYを、 DX=SXCOSa−SYSINa DY=SYSINa+SYCOSa の式により計算し、ディストネーション画像の対応する
位置にビット単位で順次書き込むことが行われていた。
One pixel of the source image (original image) in X and Y coordinates
Expressed as S X and S Y , the rotation angle is a, and the corresponding X and Y coordinates of the rotated destination image (target image) are
If D X , D Y , D X , D Y is calculated by the formula of D X = S X COSa-S Y SINa D Y = S Y SINa + S Y COSa, and is calculated in bit unit at the corresponding position of the destination image. Writing was done sequentially.

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

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

課題を解決するための手段 上記目的を達成するため、元画像を所定の画素からな
る大きさのブロックに分割し、このブロックについて、
シフト,縮小,拡大,90度回転,ローティト等操作をブ
ロックを構成する行列の行単位で行うようにすればよ
く、本発明の画像の任意角回転方法は、基準座標軸上の
基準点に対し元画像を任意角θ回転し目的画像を作成す
るに際し、前記元画像をN×Nの画素よりなり前記基準
座標軸に対し−θ回転した軸に1辺が平行な正方形より
なる基準ブロックの集合体として表し、前記各基準ブロ
ックの頂点の1つを回転頂点とし、これを中心に前記各
基準ブロックをθ回転して回転ブロックを作成し、この
回転ブロックの前記回転頂点を前記基準点を中心として
θ回転した時生じる前記基準座標軸方向の移動量を△Y,
前記基準座標軸に直角方向の移動量を△Xとし、前記回
転ブロックを前記基準座標軸方向に△Y,前記基準座標軸
に直角方向に△Xそれぞれ平行移動することにより目的
画像を得ることを特徴とするものである。また、前記基
準ブロックより前記回転ブロックを作成するに際し、前
記回転頂点を通り前記基準座標軸に平行な軸を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列の行列の
転置行列を求め、この転置行列の各行につき前記三角形
状にはみ出した部分のビットが行の左端より右端に向か
って並んでいる行についてはその並んでいるはみ出した
ビット数だけ左ローティトを行ってローティト画像を
得、このローティト画像の転置行列を演算し、この転置
行列を前記回転ブロックとするようにするとよい。そし
て、前記転置行列を求めるにあたり、対象とする行列を
N行×N列とし、この行列の変換モード数Mを M=〔log2 N〕 (但し〔 〕は内部の数値が整数のときはその整数を、
小数点以下の数値を含むときは切り上げた整数)によっ
て求め、前記N行を0〜N-1と付番し、変換モードL
(=1〜M)ごとに、A番行とB番行を、 A=k*2L〜k*2L+2L-1−1 B=A+2L-1 k=O〜(N/2L)−1 によって求め、A番行とB番行の行ビット並びをA
(j),B(j)で表し、A′(j),B′(j)を A′(j)=A(j) j=k*2L〜k*2L+2L-1−1 A′(j)=B(j-2L-1) j=k*2L+2L-1〜k*2L+2L−1 B′(j)=B(j) j=k*2L+2L-1〜k*2L+2L−1 B′(j)=A(j+2L-1) j=k*2L〜k*2L+2L-1−1 k=O〜(N/2L)−1 によって求め、A(j)をA′(j)にB(j)をB′
(j)に変換し、Lを1からMまで変化させることによ
りN行×N列の行列を求め、この行列を前記転置行列と
するとよい。また、前記基準ブロックより前記回転ブロ
ックを作成するに際し、前記回転頂点を通り前記基準座
標軸に平行な軸をY軸としこれを直交し前記回転頂点を
通る軸をX軸とし前記基準ブロックを構成する要素のX
軸,Y軸の座標を(x,y)として前記要素のx座標をx−
y*tanθとなるようX軸方向にシフトし、更にX軸方
向にcosθ倍して xcosθ−y*sioθとし、 次に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列の行
列を求め、この行列を前記回転ブロックとするとよい。
また、本発明の画像の任意角回転装置は、元画像を基準
座標軸に対して−θ回転した軸に一辺が平行な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軸方向にシフトして回転ブロックを作成する回
転ブロック作成手段と、前記回転ブロックの前記回転頂
点を、前記元画像を回転する回転中心となる前記基準座
標軸上の基準点を中心としてθ回転する時の前記基準座
標軸方向の移動量と前記基準座標軸に直角方向の移動量
を算出し、前記回転ブロックを移動する移動手段とを備
えたことを特徴とするものである。また、前記回転ブロ
ック作成手段を、前記平行四辺形の前記回転ブロックよ
りはみ出した三角形状部分をX軸に平行な行ビット並び
ごとに読み出し、はみ出した三角形状部がこれに対応し
て前記回転ブロックより凹んだ三角形状部に重なるよう
にこの読み出した行ビット並びと、凹んだ三角形状部の
対応する行ビット並びとの論理和をとって前記回転ブロ
ックの形状に合致した行列を生成する行列生成手段と、
行列の各行について行のローティトを行うローティト手
段と、行列の転置行列を作成する転置行列作成手段とを
備え、前記行列生成手段の出力を前記転置行列作成手段
に入力して転置行列を出力し、この行列を前記ローティ
ト手段で各行について前記三角形状にはみ出した部分の
ビットが行の左端より右端に向かって並んでいる行につ
いてはその並んでいるはみ出したビット数だけ左ローテ
ィトを行い、これにより作成した行列を前記転置行列作
成手段に入力して転置行列を出力し、この行列を前記回
転ブロックの値とするようにするとよい。さらに、前記
転置行列作成手段を、画像データを記憶する画像データ
記憶手段と、N行×N列の画像データの変換モード数M
を M=〔log2 N〕 (但し〔 〕は内部の数値が整数のときはその整数を、
少数点以下の数値を含むときは切り上げた整数)によっ
て求め変換モードL(=1〜M)を出力する変換モード
演算手段と、前記N行を1〜N−1と付番し、前記変換
モードLに応じて前記N行よりA番行とB番行を A=k*2L〜k*2L+2L-1−1 B=A+2L-1 k=O〜(N/2L)−1 により演算し、このA番行とB番行の行ビット並びA
(j),B(j)を選択する行選択手段と、 前記A(j),B(j)を入力し、A′(j),B′(j)
を A′(j)=A(j) j=k*2L〜k*2L+2L-1−1 A′(j)=B(j-2L-1) j=k*2L+2L-1〜k*2L+2L−1 B′(j)=B(j) j=k*2L+2L-1〜k*2L+2L−1 B′(j)=A(j+2L1) j=k*2L〜k*2L+2L-1−1 k=O〜(N/2L)−1 によって演算し、前記画像データのA(j),B(j)を
それぞれA′(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行とし、0行よりN−1行まで求め
てN行×N列の行列を求めこの行列を回転ブロックとす
るようにするとよい。
Means for Solving the Problems In order to achieve the above object, the original image is divided into blocks each having a size of a predetermined pixel, and for this block,
Operations such as shift, reduction, enlargement, rotation by 90 degrees, and rotation may be performed on a row-by-row basis of the matrix forming the block. The arbitrary angle rotation method of the image of the present invention is based on the reference point on the reference coordinate axis. When an image is rotated by an arbitrary angle θ to create a target image, the original image is formed as a set of reference blocks made of N × N pixels and a square having one side parallel to the axis rotated −θ with respect to the reference coordinate axis. One of the vertices of each of the reference blocks is a rotation vertex, and each of the reference blocks is rotated by θ about the rotation vertex to create a rotation block. The rotation vertex of this rotation block is about θ of the reference point. The amount of movement in the direction of the reference coordinate axis that occurs when rotating is ΔY,
It is characterized in that the moving amount in the direction perpendicular to the reference coordinate axis is ΔX, the rotary block is moved in parallel in the direction of the reference coordinate axis by ΔY, and the rotary block is moved in parallel by ΔX in the direction perpendicular to the reference coordinate axis to obtain a target image. It is a thing. Further, when the rotation block is created from the reference block, the axis passing through the rotation vertex and parallel to the reference coordinate axis is defined as the Y axis, and the axis orthogonal to the Y axis is defined as the X axis to configure the reference block. With the x-axis and y-axis coordinates of the element as (x, y), the x-coordinate of the element is shifted in the x-axis direction to become xy * tan θ, and further X
Multiply cosθ in the axial direction to obtain xcosθ-y * sinθ, then multiply the y coordinate by 1 / cosθ in the Y-axis direction to y / cosθ and move to (xcosθ-y * sinθ, y / cosθ) coordinates The reference block is formed in the shape of a parallelogram in which one of the reference blocks has a length equal to the X-axis and Y-axis directions of the rotary block, and the other has a protrusion in the Y-axis direction from the rotary block, and the other has a concave shape. The read row bit sequence and the corresponding row bit sequence of the recessed triangular portion are read out so that the protruding triangular portion overlaps the recessed triangular portion. Is taken as a matrix consisting of N rows × N columns that matches the shape of the rotation block, the transposed matrix of this N rows × N columns matrix is obtained, and each row of this transposed matrix protrudes into the triangular shape. The bits of the part are at the right end of the line For rows lined up toward each other, it is preferable to perform a left rotation by the number of protruding bits in the row to obtain a rotated image, calculate a transpose matrix of this rotated image, and use this transposed matrix as the rotation block. . When obtaining the transposed matrix, the target matrix is set to N rows × N columns, and the number M of conversion modes of this matrix is M = [log 2 N] (where [] is the integer when the internal numerical value is an integer. An integer
When the number after the decimal point is included, it is obtained by rounding up.), The N lines are numbered 0 to N-1, and the conversion mode L
(= 1 to M) for each, the A number rows and B number line, A = k * 2 L ~k * 2 L +2 L-1 -1 B = A + 2 L-1 k = O~ (N / 2 L ) -1 to obtain the row bit sequence of row A and row B as A
(J), expressed in B (j), A '( j), B' (j) the A '(j) = A ( j) j = k * 2 L ~k * 2 L +2 L-1 -1 A '(j) = B ( j-2 L-1) j = k * 2 L +2 L-1 ~k * 2 L +2 L -1 B' (j) = B (j) j = k * 2 L +2 L-1 to k * 2 L +2 L- 1 B '(j) = A (j + 2 L-1 ) j = k * 2 L to k * 2 L +2 L-1 -1 k = O to (N / 2 L ) −1, A (j) is A ′ (j) and B (j) is B ′.
It is preferable that the matrix of N rows × N columns is obtained by converting into (j) and changing L from 1 to M, and this matrix is used as the transposed matrix. Further, when the rotation block is created from the reference block, the axis passing through the rotation vertex and parallel to the reference coordinate axis is defined as the Y axis, and the axis orthogonal to the Y axis is defined as the X axis to configure the reference block. Element X
The x-coordinate of the element is x-
It is shifted in the X-axis direction so that y * tanθ, and then multiplied by cosθ in the X-axis direction to obtain xcosθ−y * sioθ, and then the y coordinate is multiplied by 1 / cosθ in the Y-axis direction to yield y / cosθ as (xcosθ− (y * sin θ, y / cos θ) coordinates so that the reference block has the same length as the X-axis and Y-axis directions of the rotating block and protrudes downward from the rotating block in the Y-axis in a triangular shape, and the upper portion is concave. When a parallelogram is formed, and this triangle is formed by row bits arranged in parallel with the X axis and formed by n rows, each row of the parallelogram formed by n + N rows is numbered 0 to n + N-1. When a mask matrix having n + 1 rows × N columns and having the triangularly recessed range as 0 and the other as 1 is created and the 0th row is obtained, first, the 0th row to the nth row are calculated.
The 0'th row to the n'th row depending on the logical product of the row and the mask matrix.
A row is created, the 1'th row is masked in the 0'th row where the bit is not 0, the masked portion is set to 0 bit, and the masked row and the 0'th row are ORed to obtain the first row. A 0'-corrected row is created, the 2'-th row is masked for the portion of the 0'-corrected row whose bit is not 0, and this masked portion is set to 0 bit. The masked row and the 0'-corrected row are ORed First 1 '
Make a modified line, mask the 3'-th line of the 1'-corrected line where the bit is not 0, and make this masked part 0 bit,
The masked line and the 1'-corrected line are logically ORed to form the 2'-corrected line. In the same manner, the n'-th line is changed to the (n-
2) 'Mask the part where the bit of the modified line is not 0 to make this masked part 0 bit, and take the logical sum of this masked line and the (n-2)' modified line ) ′
If a corrected row is created, this (n-1) '-corrected row is the 0th row, and similarly, N-1 rows are obtained in the same manner to obtain a matrix of N rows x N columns, and this matrix is the rotation block. Good.
Further, the image arbitrary-angle rotation device of the present invention generates a reference block that represents an original image as a set of reference blocks composed of squares of N × N pixels each side of which is parallel to the axis rotated by −θ with respect to the reference coordinate axis. Means for rotating the reference block by θ to create a rotation block, one of the vertices of the reference block, which is the center of rotation, is defined as a rotation vertex, and an axis passing through the rotation vertex and parallel to the reference coordinate axis is defined as a Y-axis. The axis that is orthogonal to this and that passes through the apex is the X axis, the coordinates of the X axis and the Y axis of the elements forming the reference block are x and y, and the x coordinate of the element is xy * tan θ. X to shift in the direction
Axial direction shifting means, X-axis direction reducing means for multiplying the output of the X-axis direction shifting means by cos θ in the X-axis direction, and y coordinate of 1
/ cos θ times the Y-axis direction enlarging means, each column of the matrix forming a parallelogram having two sides parallel to the Y-axis direction formed by the output of the X-axis direction reducing means and the Y-axis direction enlarging means In the Y-axis direction to create a rotation block, and the rotation vertex of the rotation block is rotated by θ around a reference point on the reference coordinate axis that is the rotation center for rotating the original image. And a moving means for moving the rotary block by calculating a moving amount in the reference coordinate axis direction and a moving amount in a direction perpendicular to the reference coordinate axis. Further, the rotating block creating means reads out a triangular portion protruding from the rotating block of the parallelogram for each row bit row parallel to the X axis, and the protruding triangular portion corresponds to the rotating block. Matrix generation for generating a matrix matching the shape of the rotating block by taking the logical sum of the row bit sequence read so as to overlap the more depressed triangular portion and the corresponding row bit sequence of the depressed triangular portion Means and
Rotating means for performing a row rotation for each row of the matrix, and a transposed matrix creating means for creating a transposed matrix of the matrix, the output of the matrix generating means is input to the transposed matrix creating means to output a transposed matrix, This row is rotated by the rotation means for each row, and for the rows in which the bits of the portion protruding in the triangular shape are arranged from the left end of the row toward the right end, the left rotation is performed by the number of protruding bits arranged in the row. It is preferable that the matrix is input to the transposed matrix creating unit to output a transposed matrix, and this matrix is used as the value of the rotation block. Further, the transposed matrix creating means includes an image data storing means for storing image data and a conversion mode number M of N rows × N columns of image data.
M = [log 2 N] (where [] is the integer when the internal numerical value is an integer,
Conversion mode calculation means for outputting a conversion mode L (= 1 to M) obtained by rounding up when there are numerical values below the decimal point, and the above N rows are numbered 1 to N-1 Depending on L, the A-th row and the B-th row from the N-th row are A = k * 2 L to k * 2 L + 2 L-1 -1 B = A + 2 L-1 k = O to (N / 2 L )- The row bit sequence A of row A and row B is calculated by 1
(J) and B (j) are selected, and A (j) and B (j) are input to input A '(j) and B' (j).
The A '(j) = A ( j) j = k * 2 L ~k * 2 L +2 L-1 -1 A' (j) = B (j-2 L-1) j = k * 2 L +2 L-1 ~k * 2 L +2 L -1 B '(j) = B (j) j = k * 2 L +2 L-1 ~k * 2 L +2 L -1 B' (j) = A (j + 2 L1) j = k * 2 L ~k * 2 is calculated by L +2 L1 -1 k = O~ ( N / 2 L) -1, wherein the image data a (j), B a (j), respectively Convert it to A '(j), B' (j), and change this operation to L
And image conversion means for obtaining a matrix of N rows × N columns by changing from 1 to M. Further, as the rotation block creating means, the parallelogram is a parallelogram that is triangular in shape and protrudes downward from the rotation block in the Y-axis direction and is recessed in the upper side. The triangle is a bit array n rows parallel to the X-axis. When formed, each row of the parallelogram formed by n + N rows is numbered 0 to n + N-1, and the range formed by n + 1 rows × N columns is set to 0 and the other one is set to 0. The logical multiplication of the mask matrix and the n + 1th row × Nth column from the kth row to the k + nth row is performed from the k'th row to the (k + th) row.
n) 'row creating masking means, and the (k + 1)' th row is masked at the portion where the bit of the (k-1) 'th corrected row is not 0 to make this masked portion 0 bit, and the masked row Correction line creating means for taking a logical sum of the (k-1) 'th correction line to form a k'th correction line, and for obtaining the kth line, the masking means performs the k'th row to the (k + n) th row. ) ′
A row is obtained, and the (k + n-1) 'th corrected row is sequentially obtained from the k'th corrected row by the corrected row creating means.
1) ′ The corrected row may be the k-th row, and rows 0 to N−1 may be obtained to obtain a matrix of N rows × N columns, and this matrix may be used as a rotation block.

作用 まず本発明の基本的な考え方を第1図を用いて説明す
る。
Operation First, the basic idea of the present invention will be described with reference to FIG.

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

まず、元画像100を基準ブロック104の集合体として表
す。基準ブロック104は、NxNの画素からなる正方形のブ
ロックであり、その正方形の一辺は基準座標軸101を−
θ回転した場合の軸に平行とする。
First, the original image 100 is represented as a set of reference blocks 104. The reference block 104 is a square block made up of N × N pixels, and one side of the square corresponds to the reference coordinate axis 101.
It is parallel to the axis when rotated by θ.

次に各基準ブロック104をその頂点の1つを回転頂点1
06として、これを中心にθ回転し、回転ブロック105を
作成する。
Then rotate each reference block 104 one of its vertices
As 06, the rotation block 105 is created by making a θ rotation around this.

次に元画像100上の回転ブロック105の回転頂点106を
基準点102を中心としてθ回転した時に生じる基準座標
軸101方向の移動量△Y、基準座標軸101に直角方向の移
動量△×を算出し、回転ブロック105を基準座標軸101方
向に△Y、基準座標軸101に直角方向に△×、それぞれ
平行移動する。
Next, the amount of movement ΔY in the direction of the reference coordinate axis 101 and the amount of movement Δx in the direction orthogonal to the reference coordinate axis 101, which occur when the rotation vertex 106 of the rotation block 105 on the original image 100 is rotated by θ around the reference point 102, are calculated. The rotary block 105 is moved in parallel by ΔY in the direction of the reference coordinate axis 101 and by ΔX in the direction perpendicular to the reference coordinate axis 101.

このようにすると回転頂点106は、目的画像103上の点
107に移動する。このようにして、元画像100上の各基準
ブロック104がすべて移動した結果、破線で示す目的画
像103を構成することになるので、元画像100を任意角θ
回転することができる。次に基準ブロック104を回転し
て回転ブロック105を作成する方法について第2図〜第
7図を用いて説明する。
In this way, the rotation vertex 106 becomes a point on the target image 103.
Move to 107. In this way, as a result of moving all the reference blocks 104 on the original image 100, the target image 103 shown by the broken line is formed, so that the original image 100 is rotated by the arbitrary angle θ.
Can rotate. Next, a method of rotating the reference block 104 to create the rotation block 105 will be described with reference to FIGS. 2 to 7.

第2図おいて、正方形の基準ブロック104内のすべて
の点を、正方形の1辺である直線O1‐K1上の点をX軸に
平行に移動(シフト)して直線O1‐K2上に移すように移
動する。
Keep Figure 2, all points of the square of the reference block 104, moving a point on the straight line O 1 -K1 is one side of the square parallel to the X axis (shift) linearly O 1 -K2 to top To move to.

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

次に第3図において平行四辺形Aの1辺m1が回転ブロ
ック105の1辺m2と重なるように平行四辺形A内の各点
をX軸方向に圧縮する。これにより各点の座標X,Yは、 X,Y=(x−y*TANθ)COSθ,y=x*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 with one side m2 of the rotary block 105. As a result, the coordinates X, Y of each point are X, Y = (x−y * TANθ) COSθ, y = x * COSθ−y * SIN
When the conversion above θ, y is executed, the parallelogram A is transformed into the parallelogram B shown in FIG.

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

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

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

ところで、通常のメモリの構造はX軸方向つまり行方向
のビット並びはワード単位などで一緒に読み込んだり書
き込んだりすることができるが、Y軸方向つまり列方向
のビット並びは、1ビットづつでないと読み出し、書き
込みができない。特別なメモリ構造を採用すれば列方向
も複数ビット単位の処理ができるがそのようにすると回
路構成が大きく複雑になる。このようなメモリの特性か
ら考えると第5図に示す平行四辺形Cの作成までは、シ
フトと拡大,縮小処理なので通常のメモリで行単位での
ビット処理が可能であるが、平行四辺形CをY軸に平行
にシフトして回転ブロック105に合致される処理は1ビ
ット処理となり、迅速な処理ができない。そこで本発明
は、通常のメモリを用いてこの平行四辺形CをY軸に平
行にシフトする方法を次に示すように2通りの方法で実
施する。
By the way, in the normal memory structure, the bit sequence in the X-axis direction, that is, the row direction can be read or written together in word units, but the bit sequence in the Y-axis direction, that is, the column direction must be 1 bit at a time. Cannot read or write. If a special memory structure is adopted, it is possible to perform processing in units of a plurality of bits in the column direction, but if this is done, the circuit configuration becomes large and complicated. Considering the characteristics of such a memory, since the shift and enlargement / reduction processing can be performed up to the creation of the parallelogram C shown in FIG. 5, bit processing can be performed in a row unit in a normal memory. Is shifted in parallel to the Y-axis and matched with the rotation block 105 is a 1-bit process, and rapid processing cannot be performed. Therefore, the present invention implements the method of shifting the parallelogram C in parallel with the Y-axis by using two methods as follows, using an ordinary memory.

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

第6図においてステップ1は第5図の状態と同じであ
る。平行四辺形Cの三角形abcを上方の三角形部に移動
する。移動は行単位で行い0行を0′行へ2行を2′行
へと移動すると、三角形abcは上部に移りステップ2に
示すように正方形の行列となる。次にステップ2の行列
の転置行列をとったのがステップ3である。ステップ3
において三角形の部分は図示した位置に移動する。次に
左ローティトシフトを行い三角形abcの部分をすべて右
側にくるようにするとステップ4が得られる。このステ
ップ4の行列の転置行列をとるとステップ5に示す状態
となる。この時の三角形部は図示するようにbの位置が
ステップ1のcの位置に移動している。
In FIG. 6, step 1 is the same as the state shown in FIG. The triangle abc of the parallelogram C is moved to the upper triangle part. The movement is performed row by row, and when row 0 is moved to row 0'and row 2 is moved to row 2 ', triangle abc moves to the upper part and becomes a square matrix as shown in step 2. Next, step 3 is the transposed matrix of the matrix of step 2. Step 3
In, the triangular portion moves to the position shown. Next, a left rotate shift is performed so that all the triangles 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 of b in the triangular portion has moved to the position of c in step 1 as shown in the figure.

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

他の方法を第7図を用いて説明する。 Another method will be described with reference to FIG.

本方法は平行四辺形Cの行列を正方形の行列にする処
理を表すもので、k行をA×××よりABCDの行に変換す
る方法を示したものである。
This method represents a process for converting a matrix of parallelogram C into a square matrix, and shows a method of converting k rows from Axxx 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, the mask 1 determined by the size of the triangular portion is multiplied from k rows to the row determined by the size of the mask 1 to obtain the rightmost matrix. In step 2, the mask 2 is covered on the (k + 1) 'th row to obtain the rightmost row. In step 3, the k'row and the row obtained in step 2 are ORed to obtain the rightmost row. In step 4, the mask 3 is overlaid on the (k + 2) 'row to obtain the rightmost row, and in step 5, the logical sum of this row and the row obtained in step 3 is obtained to obtain the rightmost row. In step 6, the mask 4 is placed on the (k + 3) ′ row to obtain the rightmost row, and in step 7, this row and the row obtained in step 5 are ORed,
Get the desired row ABCD. By performing such processing for each row, the same result as when the parallelogram C is translated in the Y axis is obtained, and the rotation block 105 is obtained.

実施例 以下本発明の一実施例を第1図〜第16図を用いて説明
する。
Embodiment An embodiment 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 the 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軸の座標をx,yとし、第2
図で説明したように基準ブロック104の1辺である直線O
1‐K1上の点をX軸に平行に移動してY軸上の直線O1‐K
2に移すよう、基準ブロック104内のすべての点を移動し
第3図に示す平行四辺形Aを作成する手段である。この
とき基準ブロック104内の点x,yはX,Yで表され X,Y=x*TANθ,yとなる。
The reference block generation means 1 causes the original image 100 to be −θ with respect to the reference coordinate axis 101 as described in FIG. 1 (where θ is the rotation angle when the original image 100 is rotated by θ to create the target image 103). ) This is a means for generating the reference block 104 which is the component so that the reference block 104 is configured as a set of N × N pixels each side of which is parallel to the rotated axis. The X-axis direction shifting means 2 sets one of the vertices of the reference block 104 as the rotation vertex 106 as described with reference to FIG.
An axis passing through 106 and parallel to the reference coordinate axis 101 is defined as a Y-axis, an axis orthogonal to the Y-axis is defined as an axis passing through the rotation vertex 106, and the X-axis and Y-axis coordinates of the elements forming the reference block 104 are defined as x and y. And the second
As described in the figure, the straight line O which is one side of the reference block 104
1 on the Y-axis by moving in parallel a point on the X axis -K1 linear O 1 -K
This is a means for moving all the points in the reference block 104 so as to move to 2, and creating the parallelogram A shown in FIG. At this time, the points x and y in the reference block 104 are represented by X and Y, and X, Y = x * TAN θ, y.

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

これにより縮小後の座標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図に示す。第9図
において、ソースデータは縮小前の行データであり、縮
小率が2/3であるとすると、縮小処理後データに示すよ
うにソースデータの9ビットのうち3ビットを間引いた
6ビットの行データとなる。
A concrete example of the reduction in the X-axis direction is shown in FIG. In FIG. 9, if the source data is the row data before reduction and the reduction ratio is 2/3, as shown in the data after the reduction processing, 3 bits of 9 bits of the source data are thinned out to 6 bits. It becomes line 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 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 expansion are X, Y = x * COSθ-y * SINθ, y / COSθ.

第10図はY軸方向への拡大処理の具体例を示す。第10図
において、ソースデータは拡大前の各行を示し、拡大率
を1.5倍とすると、ソースデータの4行に0ラインと2
ラインを追加して、6行のデータとし拡大処理後データ
に示すようにしたものである。
FIG. 10 shows a specific example of enlargement processing in the Y-axis direction. In Fig. 10, the source data shows each line before enlargement, and if the enlargement ratio is 1.5 times, 0 lines and 2 lines are provided in 4 lines of the source data.
Lines are added to form 6 lines of data as shown in the data after the enlargement processing.

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

移動手段6は、第1図に示すように回転ブロック105
の回転頂点106を、元画像100を回転する回転中心となる
基準点102を中心としてθ回転する時の基準座標軸101方
向の移動量△Y,基準座標軸101に直角方向の移動量△X
を算出し、各回転ブロック105を移動する手段で、これ
により元画像100はθ回転され目的画像103となる。次に
回転ブロック生成手段5の詳細について説明する。本発
明では回転ブロック生成手段5について2つの方法の技
術を開示する。まず第1の方法を第11図〜第13図を用い
て説明する。
As shown in FIG. 1, the moving means 6 includes a rotating block 105.
Of the rotation vertex 106 of the original image 100 about the reference point 102, which is the center of rotation of the original image 100, in the reference coordinate axis 101 direction ΔY, in the direction orthogonal to the reference coordinate axis 101 ΔX
Is calculated and the rotation block 105 is moved, whereby the original image 100 is rotated by θ to become the target image 103. Next, details of the rotation block generation means 5 will be described. The present invention discloses two method technologies for the rotation block generation means 5. First, the first method will be described with reference to FIGS. 11 to 13.

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

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

(a)図の行列に対して次の操作を行う。 The following operation is performed on the matrix shown in FIG.

アンダーラインを付加された第8行の行データ(
72 73 64 65 56 57)を読み出す。次にこの行デー
タを書き込むべき場所のデータ第0行(00 01 )を
読み出し、この2つの行データの論理和をとり第0行に
書き込む。
8th line data with underline added (
72 73 64 65 56 57 ) is read. Next, the data 0th row (00 01) at the place where this row data is to be written is read, and the logical sum of these two row data is taken and written in the 0th row.

次に第9行データ( 74 75 6667)を読み出し、
この行データを書き込むべき第1行のデータ(10 11 02
03 )を読み出し、この2つの行データの論理和を
とり第1行に書き込む。
Next, read the 9th row data ( 74 75 6667 ),
The data of the first line (10 11 02
03) is read and the logical sum of these two row data is taken and written in the first row.

第10行データ( 76 77)を読み出し、この行デー
タを書き込べき第2行のデータ(20 21 12 13 04 05
)を読み出し、この2つの行データの論理和をとり第
2行に書き込む。
Read the 10th row data ( 76 77 ) and write this row data to the 2nd row data (20 21 12 13 04 05
) Is read out and the logical sum of these two row data is taken and written in the second row.

以上の処理により(b)図の行列ができる。 By the above processing, the matrix shown in FIG.

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

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

以下第4行〜第6行まで同様に行う。 The same applies to the 4th to 6th rows.

第7行のデータ(57 67 77 07 17 27 37 47)を読
み出し下線のついたビット数である3ビット左ローティ
トしその結果(07 17 27 37 47 57 67 77)を第7行
に書き込む。
The data of the 7th row ( 57 67 77 07 17 27 37 47) is read out, and the number of underlined bits is 3-bit left rotate, and the result (07 17 27 37 47 57 67 77 ) is written to the 7th row.

次に(d)図の行列を再び転置行列作成手段52で転置
行列とすると(e)図が得られる。この(e)図に示す
行列が(a)図をY軸方向に各列毎にシフトして得られ
る行列であり、回転ブロック105を表している。次に13
図を用いて転置行列を作成する方法について説明する。
Next, when the transposed matrix is made into the transposed matrix again by the transposed matrix creation means 52, the transposed matrix shown in FIG. The matrix shown in FIG. 6E is a matrix obtained by shifting the structure of FIG. 7A in the Y-axis direction for each column, and represents the rotation block 105. Next 13
A method of creating a transposed matrix will be described with reference to the drawings.

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

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

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

A=k*2L〜k*2L+2L-1−1 B=A+2L-1 k=O〜(N/2L)−1 このA番行とB番行のビット並びをA(j),B(j)
(ここでj=0〜N−1)を選択する。
A = k * 2 L ~k * 2 L +2 L-1 -1 B = A + 2 L-1 k = O~ (N / 2 L) -1 bit sequence of the A number of rows and B Ban row A (j ), B (j)
(Where j = 0 to N-1) is selected.

画像変換手段524はこのA(j),B(j)を入力し、
A′(j),B′(j)を次の式で求める。
The image conversion means 524 inputs these A (j) and B (j),
A '(j) and B' (j) are calculated by the following formula.

A′(j)=A(j) j=k*2L〜k*2L+2L-1−1 A′(j)=B(j−2L-1) j=k*2L+2L-1〜k*2L+2L−1 B′(j)=B(j) j=k*2L+2L-1〜k*2L+2L−1 B′(j)=A(j+2L-1) j=k*2L〜k*2L+2L-1−1 k=O〜(N/2L)−1 そして、画像データA(j),B(j)をそれぞれA′
(j),B′(j)に変換する。この操作を変換モードL
を1からMまで変化させて行うことによりN行×N列の
行列が求まる。この行列が転置行列である。
A '(j) = A ( j) j = k * 2 L ~k * 2 L +2 L-1 -1 A' (j) = B (j-2 L-1) j = k * 2 L +2 L -1 to k * 2 L +2 L -1 B '(j) = B (j) j = k * 2 L +2 L-1 to k * 2 L +2 L -1 B' (j) = A (j + 2 L -1) j = k * 2 L ~k * 2 L +2 L-1 -1 k = O~ (N / 2 L) -1 Then, the image data a (j), B (j ) , respectively a '
(J), B '(j). This operation is conversion mode L
By changing from 1 to M, a matrix of N rows × N columns can be obtained. This matrix is the transposed matrix.

なお、転置行列を求める方法は多くの技術が公開され
ているので、これらの方法を用いてもよい。次に回転ブ
ロック生成手段5の第2方法について第14図〜第16図を
用いて説明する。
Many techniques have been published for obtaining the transposed matrix, and thus these methods may be used. Next, the second method of the rotation block generating means 5 will be described with reference to FIGS. 14 to 16.

第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と
するマスク行列を作成し、平行四辺形Cのk行から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列の行列が得られる。
修正行作成手段55はマスク手段54によって得られた第
(k+1)′を、第(k−1)′修正行(これは第k′
行に等しい)のビットが0でない部分をマスクして、こ
のマスクした部分を0ビットとし、このマスクした行と
第(k−1)′修正行との論理和をとって第k′修正行
を算出し、これを用いて順次第(k+n−1)′修正行
を求め、この第(k+n−1)′修正行をk行とし、0
行よりN−1行まで求めてN行×N列の行列を求める。
この行列が回転ブロック105となる。
FIG. 14 is a block diagram of the rotation block generating means 5. In the mask means 54, a portion abc in which the parallelogram C shown in FIG.
When the rotation block 105 is formed of N rows and N columns in a row bit arrangement parallel to the axis, each row of the parallelogram C formed of n + N rows is numbered 0 to n + N-1. Then
Create a mask matrix consisting of n + 1 rows x N columns, where the triangle abc part is 0 and the others are 1, and from the k rows of the parallelogram C to k +
The k'th row through the logical product of n + 1 rows × N columns up to n rows
Create the (k + n) 'th row. This will be described with reference to the specific example of FIG. In step 1 of FIG. 15, the leftmost matrix represents the parallelogram C of FIG. Rotating block
Reference numeral 105 is a matrix of 8 rows × 8 columns, and the triangular part abc is a matrix of 3 rows × 8 columns. Therefore, the mask matrix has 4 rows × 8 columns as shown in the mask 1 at the center. And this mask 1
Is applied to the 3rd to 7th rows of the parallelogram C in step 1, and a matrix of 4 rows × 8 columns is obtained in which 0 corresponds to the triangular portion as shown at the right end. .
The corrected row creating means 55 sets the (k + 1) 'th row obtained by the masking means 54 to the (k-1)' th corrected row (this is the kth'th row).
(Equal to row) masks the portion where the bit is not 0, sets this masked portion to 0 bit, and takes the logical sum of this masked row and the (k-1) 'th corrected row to the k'th corrected row Is calculated, and using this, the (k + n-1) '-corrected row is sequentially obtained, and this (k + n-1)'-corrected row is defined as k row, and 0
From the row to the (N-1) th row, a matrix of N rows x N columns is obtained.
This matrix becomes the rotation block 105.

次に、これを第15図、第16図により具体的に説明す
る。
Next, this will be specifically described 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でない部分を0、他を1とするマス
ク3で第5′行をマスクしこれによって得られた行をス
テップ5で第3′修正行と論理和をとると第4′修正行
が得られる。そしてステップ6で第4′修正行のビット
が0でない部分を0、他を1とするマスク4で第6′行
をマスクし、これによって得られた行をステップ7で第
4′修正行と論理和をとると第5′修正行が得られる。
この第5′修正行をステップ1に示す第3行とする。こ
のような操作をステップ1の0〜N−1行まで行うこと
により、ステップ8に示す8行×8列の行列が得られ、
この行列が回転ブロック105である。
In step 2 of FIG. 15, the mask 2 is set to the (3-
1) 'is a corrected row, that is, a mask in which the non-zero bit in the 3'th row of the rightmost matrix of step 1 is 0 and the others are 1, and the result of masking this to the 4'th row is the matrix shown at the rightmost. Becomes In step 3, the logical sum of the (3-1) '-corrected row and the row obtained in step 2 is obtained, and the obtained row is the 3'-corrected row. In step 4, 3 '
The 5'th row is masked by the mask 3 in which the bit of the corrected row is not 0 and the other is 1, and the row thus obtained is ORed with the 3'corrected row in step 5 to obtain the 4 ' You will get the modified row. Then, in step 6, the 6'th row is masked by the mask 4 in which the portion of the 4'-corrected row whose bit is not 0 is 0 and the others are 1, and the row thus obtained is changed to the 4'-corrected row in step 7. If the logical sum is taken, the 5'corrected line is obtained.
This 5'-corrected row is the third row shown in step 1. By performing such an operation from 0 to N−1 rows of step 1, the matrix of 8 rows × 8 columns shown in step 8 is obtained,
This matrix is the rotation block 105.

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

発明の効果 以上の説明から明らかなように、本発明は元画像を所
定の大きさのブロックに分割し、このブロックについて
シフト,縮小,拡大,行の入れ換え,90度回転,ローテ
ィトなど、行単位しての操作を行うことにより、通常の
構造のメモリを用いて、画像の任意角回転を迅速に行う
ことができる。
EFFECTS OF THE INVENTION As is apparent from the above description, the present invention divides an original image into blocks of a predetermined size, and shifts, reduces, enlarges, replaces lines, rotates 90 degrees, rotates, etc., in units of lines for each block. By performing the above operation, it is possible to rapidly rotate the image at an arbitrary angle using a memory having a normal structure.

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

第1図は本発明の原理を示す図、第2図はX軸方向シフ
ト手段の説明図、第3図はX軸方向縮小手段の説明図、
第4図はY軸方向拡大手段の説明図、第5図は第2〜第
4図に示す手段で処理した結果を示す図、第6図は平行
四辺形をY軸方向にシフトして正方形とする第1の方法
を示す図、第7図は平行四辺形をY軸方向にシフトして
正方形とする第2の方法を示す図、第8図は本発明の実
施例の構成を示すブロック図、第9図はX軸方向縮小手
段によるX軸方向の縮小の具体例を示す図、第10図は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 X-axis direction shifting means, and FIG. 3 is an explanatory diagram of X-axis direction reducing means.
FIG. 4 is an explanatory view of Y-axis direction enlarging means, FIG. 5 is a view showing a result of processing by means shown in FIGS. 2 to 4, and FIG. 6 is a square obtained by shifting a parallelogram in the Y-axis direction. Showing the first method, FIG. 7 shows the second method of shifting the parallelogram in the Y-axis direction to form a square, and FIG. 8 is a block diagram showing the configuration of the embodiment of the present invention. FIG. 9 is a diagram showing a concrete example of reduction in the X-axis direction by the X-axis direction reduction means, and FIG. 10 is Y
The figure which shows the specific example of the expansion of the Y-axis direction by the axial expansion means, FIG. 11 is a block diagram which shows the 1st apparatus of a rotation block preparation means, FIG. 12 shows the operation example of the apparatus shown in FIG. FIG. 13 is a block diagram showing the details of the transposed matrix creating means of FIG. 11, FIG. 14 is a block diagram showing a second device of the rotating block creating means, and FIGS. 15 and 16 are FIG. FIG. 6 is a diagram showing an operation example of the apparatus shown in FIG. 1 ... Reference block generating means, 2 ... X axis direction shifting means, 3 ... X axis direction reducing means, 4 ... Y axis direction expanding means, 5 ... Rotation block creating means, 51 ... Matrix creating means, 52 ... Transposed matrix creating means, 521 ... Image data storing means, 522 ... Conversion mode calculating means, 523 ... Row selecting means, 524 ... Image converting means, 553 ... Rotating means, 54
…… Mask means, 55 …… Corrected line creation means, 6 …… Movement means.

Claims (8)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】元画像が格納されるメモリと、前記元画像
の回転後の目的画像に対応する位置を計算する演算手段
と、この演算手段により求められた目的画像を前記メモ
リへ書き込む書き込み手段とを備え、元画像の1つの頂
点を基準点とし、この基準点に垂直な軸を基準座標軸と
し、元画像を基準座標軸に対して−θ回転した軸に一辺
が平行なN×Nの画素の正方形よりなる基準ブロックの
集合体として表し、前記各基準ブロックの頂点の1つを
回転頂点とし、この回転頂点を中心として基準ブロック
をθ回転して回転ブロックを作成し、この回転ブロック
の回転頂点を前記基準点を中心としてθ回転した時に生
じる前記基準座標軸方向および前記基準座標軸に直角方
向の移動量分、前記回転ブロックを前記基準座標軸方向
および前記基準座標軸に直角方向にそれぞれ平行移動す
ることにより任意角θ回転された画像を得ることを特徴
とする画像の任意角回転方法。
1. A memory for storing an original image, a calculating means for calculating a position of the original image corresponding to a rotated target image, and a writing means for writing the target image obtained by the calculating means in the memory. And having one vertex of the original image as a reference point, an axis perpendicular to the reference point as a reference coordinate axis, and N × N pixels each side of which is parallel to the axis obtained by rotating the original image by −θ with respect to the reference coordinate axis. Is represented as an aggregate of reference blocks each having a square shape, one of the vertices of each of the reference blocks is a rotation vertex, and the reference block is rotated by θ about the rotation vertex to create a rotation block, and the rotation of the rotation block is performed. The rotation block is rotated in the reference coordinate axis direction and the reference coordinates by the amount of movement in the reference coordinate axis direction and the direction perpendicular to the reference coordinate axis, which occurs when the apex is rotated about the reference point by θ. Any angle spinning method for the image, characterized in that to obtain a rotated image any angle θ by which to translate each perpendicular direction.
【請求項2】前記基準ブロックをθ回転させた前記回転
ブロックを作成するに際し、前記回転頂点を通り前記基
準座標軸に平行な軸をY軸とし、これを直交し前記回転
頂点を通る軸をX軸とし前記基準ブロックを構成する要
素のX軸、Y軸の座標を(x、y)として前記要素のx
座標を x−y*tanθとなるようX軸方向にシフトし、 更にX軸方向にcosθ倍して xcosθ−y*sinθとし、 次にy座標をY軸方向にY/cosθ倍し y/cosθとして (xcosθ−y*sinθ,y/cosθ)座標に移動することに
より、前記基準ブロックを前記回転ブロックのX軸、Y
軸方向の長さと同じでかつY軸方向に三角形状が前記回
転ブロックより一方がはみ出し、他方がへこんだ平行四
辺形を形成し、この三角形状にはみ出した部分ではX軸
に平行な行ビット並びごとに読み出し、はみ出した三角
形状部がへこんだ三角形状部に重なるように、この読み
出した行ビット並びとへこんだ三角形状部の対応する行
ビット並びとの論理和をとって前記回転ブロックの形状
に合致したN行×N列よりなる行列とし、このN行×N
列の行列の転置行列を求め、この転置行列の各行につき
前記三角形状にはみ出した部分のビットが行の左端より
右端に向かって並んでいる行についてはその並んでいる
はみ出したビット数だけ左ローティトを行ってローティ
ト画像を得、このローティト画像の転置行列を演算し、
この転置行列を前記回転ブロックとすることを特徴とす
る前記請求項1記載の画像の任意角回転方法。
2. When creating the rotation block in which the reference block is rotated by θ, an axis passing through the rotation vertex and parallel to the reference coordinate axis is defined as a Y axis, and an axis orthogonal to the Y axis and passing through the rotation vertex is X. The x-axis and y-axis coordinates of the element that constitutes the reference block as an axis are (x, y) and the x of the element is
Coordinates are shifted in the X-axis direction so that they are xy * tanθ, and then multiplied by cosθ in the X-axis direction to obtain xcosθ-y * sinθ, and then y-coordinates are multiplied by Y / cosθ in the Y-axis direction to y / cosθ. By moving to the (xcos θ−y * sin θ, y / cos θ) coordinate, the reference block is moved to the X-axis, Y
A row of bits that has the same length as the axial direction and has a triangular shape in the Y-axis direction that forms a parallelogram with one protruding from the rotating block and the other indented and parallel to the X-axis in the protruding portion Shape of the rotating block by taking the logical sum of the read row bit sequence and the corresponding row bit sequence of the depressed triangular portion so that the protruding triangular portion overlaps the depressed triangular portion. A matrix consisting of N rows × N columns matching
The transposed matrix of the matrix of columns is obtained, and for each row of the transposed matrix, the bits of the part protruding in the triangular shape are arranged from the left end of the row toward the right end, and for the rows, the left rotation is equal to the number of protruding bits. To obtain the rotated image, calculate the transposed matrix of this rotated image,
The arbitrary-angle rotation method for an image according to claim 1, wherein the transposed matrix is used as the rotation block.
【請求項3】前記転置行列を求めるにあたり、対象とす
る行列をN行×N列とし、この行列の変換モード数Mを M=〔log2 N〕 (但し〔 〕は内部の数値が整数のときはその整数を、
小数点以下の数値を含むときは切り上げた整数)によっ
て求め、前記N行を0〜N−1と付番し、変換モードL
(=1〜M)ごとに、A番行とB番行を、 A=k*2L〜K*2L+2L-1−1 B=A+2L-1 k=0〜(N/2L)−1 によって求め、A番行とB番行の行ビット並びをA
(j)、B(j)で表し、A′(j)、B′(j)を A′(j)=A(j) j=k*2L〜K*2L+2L-1−1 A′(j)=B(j−2L-1) j=k*2L+2L-1〜K*2L+2L−1 B′(j)=B(j) j=k*2L+2L-1〜K*2L+2L−1 B′(j)=A(j+2L-1) j=k*2L〜K*2L+2L-1−1 k=0〜(N/2L)−1 によって求め、A(j)をA′(j)にB(j)をB′
(j)に変換し、Lを1からMまで変化させることによ
りN行×N列の行列を求め、この行列を前記転置行列と
することを特徴とする前記請求項2記載の画像の任意角
回転方法。
3. When obtaining the transposed matrix, the target matrix is N rows × N columns, and the number M of conversion modes of this matrix is M = [log 2 N] (where [] is an integer whose integer is an integer. When that integer,
When the number after the decimal point is included, it is obtained by rounding up.), The N rows are numbered 0 to N-1, and the conversion mode L
For every (= 1 to M), the A-th row and the B-th row are A = k * 2 L to K * 2 L + 2 L-1 -1 B = A + 2 L-1 k = 0 to (N / 2 L ) -1 to obtain the row bit sequence of row A and row B as A
(J), expressed in B (j), A '( j), B' (j) the A '(j) = A ( j) j = k * 2 L ~K * 2 L +2 L-1 -1 A '(j) = B (j-2 L-1 ) j = k * 2 L + 2 L-1 to K * 2 L + 2 L- 1 B' (j) = B (j) j = k * 2 L +2 L-1 to K * 2 L +2 L -1 B '(j) = A (j + 2 L-1 ) j = k * 2 L to K * 2 L +2 L-1 -1 k = 0 to (N / 2 L ) −1, A (j) is A ′ (j) and B (j) is B ′.
3. An arbitrary angle of an image according to claim 2, wherein a matrix of N rows × N columns is obtained by converting into (j) and changing L from 1 to M, and this matrix is used as the transposed matrix. Rotation 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′行を作成し、第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 vertex and parallel to the reference coordinate axis is defined as a Y axis, and an axis orthogonal to the Y axis is defined as an X axis and the reference is defined as the reference axis. The X axis of the elements that make up the block,
With the coordinate of the Y axis as (x, y), the x coordinate of the element is shifted in the X axis direction so as to be xy * tanθ, and further multiplied by cosθ in the X axis direction to obtain xcosθ−y * sinθ. By multiplying the y-coordinate by 1 / cosθ in the Y-axis direction and moving it to (xcosθ-y * sinθ, y / cosθ) coordinates as y / cosθ, the reference block is set to the X-axis and Y-axis lengths of the rotary block. When the triangle is formed in the same shape and protrudes downward from the rotation block in the Y-axis downward, and indents the upper side in a parallelogram, and when this triangle is formed by row bits arranged in parallel to the X-axis and formed by n rows, it is formed by n + N rows. Each of the rows of the parallelogram is numbered as 0 to n + N−1, and a mask matrix having n + 1 rows × N columns as the triangular depression range is set to 0 and the other is set to 1, and the 0th row is created. First, the 0'th row is obtained by the logical product of the 0th row to the nth row and the mask matrix.
The n'th row is created, and the n'th row is masked at the non-zero bit of the (n-2) '-corrected row to make the masked portion 0 bit, and the masked row and the (n- 2) 'The corrected line is ORed to make the (n-1)' corrected line,
The (n-1) 'th corrected row is set to the 0th row, and similarly, up to N-1 rows are obtained in the same manner to obtain a matrix of N rows x N columns, and this matrix is used as the rotation block. The method for rotating an arbitrary angle of an image according to claim 1.
【請求項5】元画像が格納されるメモリと、前記元画像
の回転後の目的画像に対応する位置を計算する演算手段
と、この演算手段により求められた目的画像を前記メモ
リへ書き込む書き込み手段と、元画像の1つの頂点を基
準点とし、この基準点に垂直な軸を基準座標軸とし、元
画像を基準座標軸に対して−θ回転した軸に一辺が平行
な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 memory for storing an original image, a calculating means for calculating a position of the original image corresponding to the rotated target image, and a writing means for writing the target image obtained by the calculating means in the memory. And one vertex of the original image as a reference point, an axis perpendicular to this reference point as a reference coordinate axis, and a square of N × N pixels with one side parallel to the axis rotated −θ with respect to the reference image coordinate axis. A reference block generating means represented as an aggregate of reference blocks, and when one of the vertices of the reference block, which is the center of rotation, is used as a rotation vertex when the reference block is rotated by θ to create a rotation block,
An axis passing through this rotation vertex and parallel to the reference coordinate axis is defined as a Y-axis, an axis orthogonal to this and passing through the vertex is defined as an X-axis, and coordinates of X-axis and Y-axis of elements constituting the reference block are defined as x and y. , X-axis direction shift means for shifting the x-coordinate of the element in the X-axis direction to be xy * tan θ, X-axis direction reduction means for multiplying the output of the X-axis direction shift means by cos θ in the X-axis direction, y Y-axis direction enlarging means for multiplying the coordinates by 1 / cos θ, and a matrix forming a parallelogram having two sides parallel to the Y-axis direction formed by the outputs of the x-axis direction reducing means and the Y-axis direction enlarging means. A rotation block creating means for creating a rotation block by shifting each column in the Y-axis direction, and the rotation vertex of the rotation block is centered on a reference point on the reference coordinate axis which is a rotation center for rotating the original image. As the θ coordinate of the reference coordinate axis direction Momentum and calculates the amount of movement perpendicular to the reference coordinate axes, any angle spinning device of an image, characterized in that a moving means for moving the rotating block.
【請求項6】前記回転ブロック作成手段が、前記平行四
辺形の前記回転ブロックよりはみ出した三角形状部分を
X軸に平行な行ビット並びごとに読み出し、はみ出した
三角形状部がへこんだ三角形状部に重なるように、この
読み出した行ビット並びとへこんだ三角形状部の対応す
る行ビット並びとの論理和をとって前記回転ブロックの
形状に合致した行列を作成する行列生成手段と、行列の
各行について行のローティトを行うローティト手段と、
行列の転置行列を作成する転置行列作成手段とを備え、
前記行列生成手段の出力を前記転置行列作成手段に入力
して転置行列を出力し、この行列を前記ローティト手段
で各行について前記三角形状にはみ出した部分のビット
が行の左端より右端に向かって並んでいる行については
その並んでいるはみ出したビット数だけ左ローティトを
行い、これにより作成した行列を前記転置行列作成手段
に入力して転置行列を出力し、この行列を前記回転ブロ
ックの値とすることを特徴とする前記請求項5記載の画
像の任意角回転装置。
6. The rotating block creating means reads out a triangular portion protruding from the rotating block of the parallelogram for each row bit array parallel to the X axis, and the protruding triangular portion is depressed. So that the row bit sequence read out and the corresponding row bit sequence of the recessed triangular portion are ORed to create a matrix matching the shape of the rotation block, and each row of the matrix About Rotate Means to Rotate Rows About
And a transposed matrix creating means for creating a transposed matrix of a matrix,
The output of the matrix generation means is input to the transposed matrix generation means to output a transposed matrix, and the bits of the portion of the matrix protruding in the triangular shape for each row by the rotation means are arranged from the left end to the right end of the row. With respect to the rows that are lined up, the left rotation is performed by the number of the protruding bits, and the matrix thus created is input to the transposed matrix creating means to output the transposed matrix, and this matrix is used as the value of the rotation block. The apparatus for rotating an arbitrary angle of an image according to claim 5, wherein:
【請求項7】前記転置行列作成手段が、画像データを記
憶する画像データ記憶手段と、N行×N列の画像データ
の変換モード数Mを M=〔log2 N〕 (但し〔 〕は内部の数値が整数のときはその整数を、
小数点以下の数値を含むときは切り上 げた整数)によって求め、変換モードL(=1〜M)を
出力する変換モード演算手段と、前記N行を1〜N−1
と付番し、前記変換モードLに応じて前記N行よりA番
行とB番行を、 A=k*2L〜K*2L+2L-1−1 B=A+2L-1 k=0〜(N/2L)−1 により演算し、このA番行とB番行の行ビット並びA
(j)、B(j)を選択する行選択手段と、前記A
(j)、B(j)を入力し、A′(j)、B′(j)を A′(j)=A(j) j=k*2L〜K*2L+2L-1−1 A′(j)=B(j−2L-1) j=k*2L+2L-1〜K*2L+2L−1 B′(j)=B(j) j=k*2L+2L-1〜K*2L+2L−1 B′(j)=A(j+2L-1) j=k*2L〜K*2L+2L-1−1 k=0〜(N/2L)−1 によって演算し、前記画像データのA(j)をA′
(j)に、B(j)をB′(j)に変換し、この操作を
Lを1からMまで変化させることによりN行×N列の行
列を求める画像変換手段とからなることを特徴とする前
記請求項6記載の画像の任意角回転装置。
7. The transposed matrix creating means sets an image data storage means for storing image data and a conversion mode number M of N rows × N columns of image data as M = [log 2 N] (where [] is internal If the numerical value of is an integer,
When a numerical value below the decimal point is included, it is obtained by rounding up the integer) and the conversion mode calculation means for outputting the conversion mode L (= 1 to M) and the N rows are 1 to N-1.
Numbered Mounting the A number rows and B number row than said N rows in accordance with the conversion mode L, A = k * 2 L ~K * 2 L +2 L-1 -1 B = A + 2 L-1 k = 0~ (N / 2 L) -1 by calculating the row bit sequence a of the a-th row and B-number row
(J), a row selection means for selecting B (j), and A
(J) and B (j) are input, and A ′ (j) and B ′ (j) are A ′ (j) = A (j) j = k * 2 L to K * 2 L +2 L-1 − 1 A '(j) = B (j-2 L-1 ) j = k * 2 L + 2 L-1 to K * 2 L + 2 L- 1 B' (j) = B (j) j = k * 2 L + 2 L-1 to K * 2 L + 2 L- 1 B '(j) = A (j + 2 L-1 ) j = k * 2 L to K * 2 L + 2 L-1 -1 k = 0 to (N / 2 L ) -1 to calculate A (j) of the image data into A '
(J) is an image conversion means for converting B (j) into B '(j), and changing this operation from L to 1 to M to obtain a matrix of N rows x N columns. The arbitrary angle rotation device for an image according to claim 6, wherein.
【請求項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. The rotating block forming means is a parallelogram in which the parallelogram is triangular from the rotating block and protrudes downward from the Y-axis in a downward direction of the Y-axis, and the upper side is indented, and the triangle is a bit array parallel to the X-axis. When formed by n rows, n
Each row of the parallelogram formed by + N rows is represented by 0 to n + N
-1 and a mask matrix having n + 1 rows × N columns, which is 0 in the range indented in the triangular shape and 1 in the other, and a logical product of n + 1 rows × N columns from k rows to k + n rows k '
A mask means for creating a row to the (k + n) 'th row;
The +1) 'th row is masked for the portion where the bit of the (k-1)' th corrected row is not 0, and this masked portion is set to 0 bit, and the masked row and the (k-1) 'th corrected row are ORed. And a correction row creating means for creating a k'th correction row, and when determining the kth row, the mask means determines the k'th row to the (k + n) 'row, and the correction row creating means determines the first row. From the K'corrected line, the (k + n-1) 'th corrected line is sequentially obtained,
This (k + n-1) 'modified row is the k-th row, and N is calculated from the 0th row.
6. The apparatus for rotating an arbitrary angle of an image according to claim 5, wherein a matrix of N rows × N columns is obtained by obtaining up to −1 row, and this matrix is used as a rotation block.
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 JPH03216771A (en) 1991-09-24
JP2695266B2 true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08287218A (en) * 1995-04-10 1996-11-01 Sharp Corp Image composing device
US7376286B2 (en) * 2002-09-18 2008-05-20 Nxp B.V. Block-based rotation of arbitrary-shaped images
AU2002357630A1 (en) * 2002-12-20 2004-07-14 Jicoux Datasystems, Inc. Image converter, image converting method, and program

Also Published As

Publication number Publication date
JPH03216771A (en) 1991-09-24

Similar Documents

Publication Publication Date Title
KR100193584B1 (en) Character Generation System and Character Generation Method
US5412768A (en) Method and apparatus for rotating an image
JPS60239796A (en) Circuit and apparatus for altering data in display memory
Hundt et al. Program for Plotting and Analyzing Crystal Structures
JPH0810462B2 (en) Image processing device
JP2695266B2 (en) Arbitrary image rotation method and device
JPH0640259B2 (en) Data processing device
JPS6158037B2 (en)
JPH0289132A (en) Logical address generation system
JPH0887596A (en) Method for high-speed 180×-rotation and inversion of image
JP2578102B2 (en) Bit pattern enlargement control method
JP3092154B2 (en) Digital drawing equipment
JPS6350714B2 (en)
JPS6022878A (en) Interpolation method of digital picture signal
JP2605609B2 (en) Dot display processing device
JPH0863595A (en) Method and device for rotation processing of image
JP2565489B2 (en) Character pattern generator
JPS63143646A (en) Extended index addressing system
JPS6095482A (en) Image rotation processing method
JPS6055837B2 (en) graphic display device
JPS62157089A (en) How to create vector characters
JPH05205070A (en) Graphic plotting method
JPH03116322A (en) Matrix transforming device
JPH0362096A (en) Method for storing development data of stroke character
JPH0395687A (en) Picture reducing device

Legal Events

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