JP2636225B2 - Image rotation device - Google Patents

Image rotation device

Info

Publication number
JP2636225B2
JP2636225B2 JP62022745A JP2274587A JP2636225B2 JP 2636225 B2 JP2636225 B2 JP 2636225B2 JP 62022745 A JP62022745 A JP 62022745A JP 2274587 A JP2274587 A JP 2274587A JP 2636225 B2 JP2636225 B2 JP 2636225B2
Authority
JP
Japan
Prior art keywords
image
rotation
grid
pixel
point
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
JP62022745A
Other languages
Japanese (ja)
Other versions
JPS63191192A (en
Inventor
哲 高山
成夫 島崎
千香 小野寺
桂 川上
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 Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP62022745A priority Critical patent/JP2636225B2/en
Publication of JPS63191192A publication Critical patent/JPS63191192A/en
Application granted granted Critical
Publication of JP2636225B2 publication Critical patent/JP2636225B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、計算機による画像情報の回転処理を制御す
る画像回転装置に関するものである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image rotation device that controls a rotation process of image information by a computer.

従来の技術 近年、記憶容量の増化に伴い、コード化していない画
像情報を扱う処理が増えつつある。又、スキャナ、複写
機などの解像度が向上し、高速で且つ劣化の少ない画像
処理方式の開発がのぞまれている。以下、第6図を参照
しながら、従来の画像回転処理について説明する。説明
を簡単にするため、まず、一次元画像の回転処理に限定
する。
2. Description of the Related Art In recent years, with an increase in storage capacity, processing for handling image information that is not coded has been increasing. In addition, development of an image processing system with improved resolution of a scanner, a copying machine, and the like, which is fast and has little deterioration is desired. Hereinafter, the conventional image rotation processing will be described with reference to FIG. For simplicity of description, first, the processing is limited to rotation processing of a one-dimensional image.

第6図は、一次元画像の回転の手法を説明するための
もである。第6図のように、x軸y軸を定める格子線の
間隔は、xy方向ともども“1"である。画像は、格子上の
みに存在し、格子点の座標は、整数で表わされるものと
する。直線Lは、回転の中心402を通り、傾きθの直線
である。画像(A){a0、a1、…a6}は、x軸に平行な
原画像、(B){b0、b1、…、b6}は、601を回転の中
心とし、画像(A)を、角θだけ回転させた時、画像
(A)の要素(a0、a1、…a7)の変換された位置を示し
たものである。又、画像(C){c0、c1、…c、
は、位置(B)を格子点上に配置(以下、量子化と称
す)し、得たものである。画像の回転処理とは、画像
(A)を画像(C)に変換する処理のことである(画像
(A)を画像(C)変換する上述の処理は、移動と回転
を行う処理であるが、以下、これを回転と称す)処理手
順を説明する。
FIG. 6 is for explaining a method of rotating a one-dimensional image. As shown in FIG. 6, the interval between grid lines defining the x-axis and the y-axis is "1" in both the xy directions. The image exists only on the grid, and the coordinates of the grid points are represented by integers. The straight line L is a straight line that passes through the center of rotation 402 and has an inclination θ. Image (A) {a 0, a 1, ... a 6} is parallel the original image to the x-axis, (B) {b 0, b 1, ..., b 6} is the center of rotation 601, the image When (A) is rotated by the angle θ, the converted positions of the elements (a 0 , a 1 ,... A 7 ) of the image (A) are shown. Also, image (C) {c 0 , c 1 ,... C, 5 }
Is obtained by arranging the position (B) on a lattice point (hereinafter referred to as quantization). The image rotation process is a process of converting the image (A) into the image (C). (The above process of converting the image (A) into the image (C) is a process of performing movement and rotation. Hereinafter, this will be referred to as rotation).

格子線間隔が“1"であることより、 が、成り立つ。boの座標を(xbo、ybo)とし、biの座標
(xbi、ybi)をもとめると、 となる。従って、boの座標を与えると、残りの点の座標
は、△x、△yを順次加算してゆくことによって求める
ことが可能である。更に、bi(以下、真の位置と称す)
に最も近い格子点をCj(Cxj、Cyi)とし、aiのデータを
Cjに転送することにより、画像(A)の回転結果である
画像(C)が得られる。即ち、 なる処理を行う。(但し、〔d〕は、dを越えない最大
の整数を表わす。又、第5式、第6式で0.5を加えたの
は、真の位置が、最も近い格子点に量子化されるように
するためである。)以上のように回転処理は、真の位置
を算出し、量子化するという。
Since the grid spacing is “1”, Holds. If the coordinates of bo are (x bo , y bo ) and the coordinates of bi are (x bi , y bi ), Becomes Therefore, given the coordinates of bo, the coordinates of the remaining points can be obtained by sequentially adding △ x and △ y. Furthermore, bi (hereinafter referred to as true position)
Let Cj (Cxj, Cyi) be the grid point closest to
By transferring the image to Cj, an image (C) that is the result of rotating the image (A) is obtained. That is, Is performed. (However, [d] represents the largest integer that does not exceed d. The addition of 0.5 in Equations 5 and 6 means that the true position is quantized to the nearest lattice point. As described above, in the rotation processing, the true position is calculated and quantized.

次に、2次元画像の回転を行う場合を、以下に説明す
る。第7図は、2次元画像の回転を説明するためのもの
で、第7図(a)は原画像であり、第7図(b)は同図
(a)の画像を角θだけ回転したときの結果画像を示し
たものである。第7図(a)の第1行目を構成する一次
元画像(11){A0、A1、A2、A3 }を回転した時の真
の位置を(21){a0、a1、a2、a3}結果画像を、(2
1′){A0′、A1′、A2′、A3′}とする。同様に、画
像(12){B0、B1、B2、B3}、(22){b0、b1、b2
b3}、画像(22′){B0′、B1′、B2′、B3′}、画像
(13){C0、C1、C2、C3}、(23){c0、c1、c2
c3}、画像(23′){C0′、C1′、C2′、C3′}を、定
義する。
Next, the case where the two-dimensional image is rotated will be described below. FIG. 7 is for explaining the rotation of the two-dimensional image. FIG. 7 (a) is the original image, and FIG. 7 (b) is the image of FIG. 7 (a) rotated by an angle θ. The result image at the time is shown. The true position when rotating the one-dimensional image (11) {A 0 , A 1 , A 2 , A 3 } constituting the first row of FIG. 7A is (21) {a 0 , a 1, the a 2, a 3} resulting image, (2
1 ′) {A 0 ′, A 1 ′, A 2 ′, A 3 ′}. Similarly, images (12) {B 0 , B 1 , B 2 , B 3 }, (22) {b 0 , b 1 , b 2 ,
b 3}, image (22 ') {B 0' , B 1 ', B 2', B 3 '}, image (13) {C 0, C 1, C 2, C 3}, (23) {c 0, c 1, c 2,
c 3 } and the image (23 ′) {C 0 ′, C 1 ′, C 2 ′, C 3 ′} are defined.

2次元画像の回転処理は、1次元画像の回転処理を複
数回行うことにより可能である。以下、処理手順を説明
する。
The rotation processing of the two-dimensional image can be performed by performing the rotation processing of the one-dimensional image a plurality of times. Hereinafter, the processing procedure will be described.

まず、上述した1次元画像の回転処理手順に基づいて
画像(11)の回転処理を行う。次に、画像(12)の回転
処理を行う。その際に、まず、第7図(a)の第2行第
1列の要素である。B0の真の位置を算出する。その手順
を以下に示す。すなわち、 である。aoの座標を(xao、yao)とし、boの座標
(xbo、ybo)を求めると、 となる。従って、aoの座標を与えると、残り行の第1列
目要素に於ける真の位置の座標は、△x′、△y′を順
次加算してゆくことによって求めることが可能である。
boの真の位置を算出した後、1次元画像の回転処理手順
に沿って順次処理してゆく。この流れを、第8図に示
す。
First, the image (11) is rotated based on the above-described one-dimensional image rotation processing procedure. Next, the image (12) is rotated. In this case, first, the elements in the second row and first column in FIG. 7A are used. And it calculates the true position of the B 0. The procedure is shown below. That is, It is. When the coordinates of ao are (x ao , yao ) and the coordinates of bo ( xbo , ybo ) are obtained, Becomes Therefore, given the coordinates of ao, the coordinates of the true position in the first column element of the remaining rows can be obtained by sequentially adding △ x 'and △ y'.
After calculating the true position of bo, the bo is sequentially processed in accordance with the one-dimensional image rotation processing procedure. This flow is shown in FIG.

第8図は、2次元画像の回転処理を行う際のフローを
示した図である。
FIG. 8 is a diagram showing a flow when performing a rotation process of a two-dimensional image.

801で、初期設定を行う。At 801, initial settings are made.

802で、第i行の回転を行う。At 802, the i-th row is rotated.

803で、すべての行が、終了したかを判断する。At 803, it is determined whether all lines have been completed.

804で、iに1を加える。At 804, 1 is added to i.

805で、次の行の、始点の真の位置を算出する。At 805, the true position of the starting point of the next line is calculated.

(この処理は、特許公開公報59−229669,及び、60−110
080号等に詳細に説明されている。) 第9図は、この方法を用いて、回転処理を行なった結
果を示す図である。回転の中心は0、回転角はθであ
る。・は真の位置、○は真の位置を量子化した結果、即
ち結果画素を示す。(同図は、具体的に横4画素、縦5
画素から成る原画像の回転を示している。) 発明が解決しようとする問題点 ところが、従来の方法では、第9図に示すように1つ
の結果画素に対し、2つの原画素が対応する場合や、結
果画像の領域内に、全く原画素が対応しない格子点があ
るなどの画質劣化の問題があった。
(This processing is described in Patent Publications 59-229669 and 60-110
No. 080 and the like. FIG. 9 is a diagram showing the result of performing a rotation process using this method. The center of rotation is 0, and the rotation angle is θ. Indicates a true position, and ○ indicates a result of quantization of the true position, that is, a result pixel. (The figure specifically shows four pixels horizontally and five pixels vertically.
The rotation of the original image composed of pixels is shown. However, according to the conventional method, as shown in FIG. 9, two original pixels correspond to one result pixel, or there is no original pixel in the area of the result image. However, there is a problem of image quality deterioration such as that there are lattice points that do not correspond.

問題点を解決するための手段 本発明は、間隔1のM本の水平格子線と間隔1のN本
の垂直格子線の交点である格子点上に位置するM行N列
の画素からなる原画像Aを、回転角度θに応じたM′行
N′列(M′=〔M/cosθ+0.5〕、N′=〔N cosθ+
0.5〕,0≦θ<45゜,但し〔α〕はαを越えない最大の
整数)の画素からなる画像Bに変換する画素数変換手段
と、前記画素数変換手段で得た画像Bを構成する各画素
の転送先を算出する転送アドレス算出手段と、前記転送
アドレス算出手段で得た位置に画像Bを構成する各画素
を転送する画素転送手段とを具備し、前記転送アドレス
算出手段が、画像Aに含まれる回転の中心である格子点
g1と同一垂直格子線上に間隔1で存在する格子点gi(i
=1〜M′)に対し、giを通る傾きθの直線liと垂直格
子線との交点ej(j=1〜N′)を、回転の中心g1を通
る傾き−(π/2−θ)の直線Fとliとの交点fiに最も近
い垂直格子線から当該垂直格子線を含め間隔1で存在す
るN′本の垂直格子線上に求め、ejと最も近い格子点cj
を、画像Bの第i行第j列の画素の転送先として算出す
ることにより、上記の目的を達成する。
Means for Solving the Problems The present invention provides an original image comprising M rows and N columns of pixels located on a grid point which is the intersection of M horizontal grid lines at 1 interval and N vertical grid lines at 1 interval. The image A is divided into M ′ rows and N ′ columns (M ′ = [M / cos θ + 0.5], N ′ = [N cos θ +
0.5], 0 ≦ θ <45 ° (where [α] is the maximum integer not exceeding α), and a pixel number conversion means for converting into an image B composed of pixels, and an image B obtained by the pixel number conversion means Transfer address calculating means for calculating a transfer destination of each pixel to be transferred, and pixel transfer means for transferring each pixel constituting the image B to a position obtained by the transfer address calculating means, wherein the transfer address calculating means Grid point that is the center of rotation included in image A
grid points gi (i) existing at the interval 1 on the same vertical grid line as g1
= 1 to M '), the intersection ej (j = 1 to N') of the straight line li of the slope θ passing through gi and the vertical grid line is defined as the slope-(π / 2-θ) passing through the center g1 of rotation. From the vertical grid line closest to the intersection fi of the straight line F and li on the N ′ vertical grid lines existing at an interval of 1 including the vertical grid line, and the grid point cj closest to ej
Is calculated as the transfer destination of the pixel in the i-th row and the j-th column of the image B, thereby achieving the above object.

作用 本発明は上記構成により、転送領域内から1つの画素
に重複して転送する画素や、転送が発生しない画素を無
くし、劣化の少ない回転画像を得ることができる。
Operation According to the present invention, with the above-described configuration, it is possible to eliminate a pixel that is redundantly transferred to one pixel from within the transfer area and a pixel that does not cause transfer, and obtain a rotated image with less deterioration.

実施例 まず、本発明の基本原理について説明する。Embodiment First, the basic principle of the present invention will be described.

本発明の画像回転処理は、原画から回転角θに応じた
縦拡大横縮小画像を算出する画素数変換処理と、傾きθ
の直線に沿って転送先の格子点座標を算出し、画素数変
換画像を格子点に転送する画素転送処理からなる。
The image rotation processing of the present invention includes a pixel number conversion processing for calculating a vertically enlarged horizontal reduced image corresponding to a rotation angle θ from an original image, and a tilt θ
The pixel transfer process calculates the coordinates of the grid point of the transfer destination along the straight line, and transfers the pixel number converted image to the grid point.

説明をはじめる前に、言葉と記号をいくつか定義する
〔α〕は、αを越えない最大の整数を表わす記号であ
る。画像を構成する要素を画素と称し、○で表わす。
又、画素は、格子点上のみに存在するものとし、格子点
の座標は、整数で表わされるものとする。
Before beginning the description, [α], which defines some words and symbols, is a symbol representing the largest integer not exceeding α. Elements constituting an image are referred to as pixels, and are represented by ○.
It is assumed that the pixel exists only on the grid point, and the coordinates of the grid point are represented by integers.

本発明の原理を、第2図を用いて説明する。簡単のた
め、まず一次元画像に限定し説明する。(なお以下、回
転の中心0は格子点上にあり、回転角θは、0≦θ<45
゜を満たすものとする。) まず、格子線の間隔は、水平方向及び垂直方向ともに
“1"である。原画像を{A}(a0、a1、…、a8)、回転
の中心を0として、本発明の方式を用いて{A)を角θ
だけ回転した際の結果画像を{C}(c0、c1、…、
c7)、回転の中心0を通り傾きをθを持つ直線をL、そ
のLと垂直格子線との交点を左から順に、e0、e1、…、
e7とし、垂直交点と称し{E}(e0、e1、…、e7)と表
わす。(上記の条件より、0とe0の座標は一致する。) 本発明の回転処理は、以下のように行うものである。
The principle of the present invention will be described with reference to FIG. For the sake of simplicity, only a one-dimensional image will be described first. (Hereinafter, the rotation center 0 is on the lattice point, and the rotation angle θ is 0 ≦ θ <45.
゜ shall be satisfied. First, the interval between grid lines is “1” in both the horizontal and vertical directions. The original image is defined as {A} (a 0 , a 1 ,..., A 8 ), and the center of rotation is set to 0.
The result image when rotated only by {C} (c 0 , c 1 ,...,
c 7 ), a straight line passing through the center of rotation 0 and having an inclination of L is denoted by L, and the intersection of the L and the vertical grid line is sequentially determined from the left, e 0 , e 1 ,.
and e 7, referred to as vertical intersection {E} (e 0, e 1, ..., e 7) expressed as. (From the above conditions, the coordinates of 0 and e 0 coincide.) The rotation processing of the present invention is performed as follows.

ステップ1 直線Lと、垂直格子線との交点ei(xi、yi)を、算出
する。即ち、eo(xeo、yeo)とすると xi=i+xeo ……(11) yi=i tanθ+yeo ……(12) (但し0≦i、iは整数) の、計算を行う。
And Step 1 linear L, the intersection ei (x i, y i) of the vertical grid lines are calculated. That is, if eo (x eo , y eo ), xi = i + x eo (11) yi = i tan θ + y eo (12) (where 0 ≦ i, i is an integer).

ステップ2 eiに最も近い格子点Ci(xci、yci)を、算出する処理
を行う。
Step 2 A process for calculating a grid point Ci ( xci , yci ) closest to ei is performed.

(*xeo、yeoはともに整数である) の計算を行う。(但し、〔α〕は、αを越えない最大の
整数を表わす。) ステップ3 原画像{A}の画素数Nを、〔N cosθ+0.5〕個に変
換する処理を行う。
(* X eo and y eo are both integers). (However, [α] represents the largest integer not exceeding α.) Step 3 A process of converting the number N of pixels of the original image {A} to [N cos θ + 0.5] is performed.

ステップ4 ステップ3の処理で変換した画像(以下、横縮小画像
と称す){D}(d0、d1、…、d7)の値をステップ2で
算出した格子点群{C}(c0、c1、…、c7)に、順に転
送する処理を行う。
Step 4 The value of the image (hereinafter referred to as a reduced horizontal image) {D} (d 0 , d 1 ,..., D 7 ) converted in the process of Step 3 is calculated by the grid point group {C} (c 0 , c 1 ,..., C 7 ).

以下、具体的な計算過程を示す。 Hereinafter, a specific calculation process will be described.

ei(xei、yei)とei+(xe.i+1、ye.i+1)の
間には、格子線の間隔が1であることより なる関係がある。
Between ei (x ei , y ei ) and ei + 1 (x e.i + 1 , y e.i + 1 ), since the grid line spacing is 1, There is a relationship.

即ち、eo(xeo、yeo)を与えると、x座標に“1"、y
座標にtanθを加えることで、残りの点の座標は、順に
算出することが可能である。又、求めたeiに対し、第
(12)、(13)式の処理を行うことで、横縮小画像の転
送先を求めることができる。以上の処理を行い、1次元
回転画像を得る。
That is, when eo (x eo , y eo ) is given, “1” and y
By adding tan θ to the coordinates, the coordinates of the remaining points can be calculated in order. The transfer destination of the reduced horizontal image can be obtained by performing the processing of equations (12) and (13) on the obtained ei. By performing the above processing, a one-dimensional rotated image is obtained.

次に、第3図を参照して2次元画像の回転について説
明する。第3図は、本発明の2次元画像回転を説明する
ための図である。格子線の間隔は、x方向、y方向とも
に1で、0は回転の中心である。点giは回転の中心0と
同一垂直格子線上に存在する格子点で、上から順にg1
g2、…、g6と表わす。(但し、g1は、回転の中心0と同
一点を示す。)又、垂直liは、格子点giを通る傾きθの
直線である。直線Fは、交子点giを通り、傾き−(π/2
−θ)の直線である。直線liと直線Fとの交点をfiとす
る。本発明の2次元画像の回転処理は、以下のように行
うものである。
Next, rotation of the two-dimensional image will be described with reference to FIG. FIG. 3 is a diagram for explaining two-dimensional image rotation according to the present invention. The interval between the grid lines is 1 in both the x and y directions, and 0 is the center of rotation. The point gi is a grid point existing on the same vertical grid line as the center of rotation 0, and g 1 ,
g 2 , ..., g 6 . (However, g 1 indicates the center 0 and the same point of rotation.) The vertical li is a straight line of slope θ through the grid points gi. The straight line F passes through the intersection point gi and has a slope of − (π / 2
−θ). The intersection of the straight line li and the straight line F is defined as fi. The rotation processing of the two-dimensional image of the present invention is performed as follows.

ステップA 原画像の縦の画素数Mを、〔M/cosθ+0.5〕個に変換
する処理を行う。
Step A A process of converting the number M of vertical pixels of the original image into [M / cos θ + 0.5] is performed.

ステップB ステップAの処理で変換した画像(以下、縦拡大画像
と称す。)の第i行目に対して、上述したステップ1か
らステップ4の処理を行う。但し、回転の中心をgiとす
る。更に、ステップ4の処理を行う際の、最初の転送先
である格子点の座標(以下、転送開始格子点と称す。)
は、点fiに最も近い垂直交点hiを、第(13)、(14)式
によって変換した値とする。
Step B The above-described processing of steps 1 to 4 is performed on the i-th row of the image converted in the processing of step A (hereinafter, referred to as a vertically enlarged image). However, the center of rotation is defined as gi. Furthermore, the coordinates of the first transfer destination grid point (hereinafter, referred to as a transfer start grid point) when performing the processing of step 4 are described.
Is a value obtained by converting the vertical intersection point hi closest to the point fi by the expressions (13) and (14).

上述のステップBの処理を繰り返すことによって、2
次元画像の回転処理を行うことができる。
By repeating the processing of step B described above, 2
Rotation processing of a two-dimensional image can be performed.

以下、第4図を参照して転送開始格子点の算出方法を
示す。第4図は転送開始格子点を算出する方法を説明す
るための図である。
Hereinafter, a method of calculating the transfer start grid point will be described with reference to FIG. FIG. 4 is a diagram for explaining a method of calculating a transfer start grid point.

更に、第4図は、第3図の一部を拡大したものであ
る。
FIG. 4 is a partially enlarged view of FIG.

縦拡大横縮小画像第i行目の転送開始格子点をai(x
ai、yai)とする。点fi-1のx座標をxf.i−1、点fiの
x座標をxf.iとする。格子線の流さは1であるから xf.i−xf.i−1=cosθ・sinθ ……(17) である。点f1のx座標が与えられると、cosθ・sinθ
を、順次加えることにより、点fiのx座標は算出でき
る。即ち xf.i=x0(i-1)cosθ・sinθ ……(18) である。次に、点fiに最も近い垂直格子線のx座標j
は、 j=〔xf.i+0.5〕 ……(19) を満たす。以上より、第i行の回転の中心をgi(xgi、y
gi)とすると、第(12)、(13)式より xai=j+xgi ……(20) yai=〔j tanθ+ygi〕 ……(21) (ただし、xgi、ygiはともに整数である。) となる。
Set the transfer start grid point on the i-th row of the vertically enlarged horizontally reduced image to ai (x
ai , yai ). The x-coordinate of the point f i-1 to x fi-1, the x-coordinate of the point fi and x fi. Streamed grid line is because it is 1 x fi -x fi-1 = cosθ · sinθ ...... (17). When the x-coordinate of the point f 1 is given, cos [theta] · sin [theta
Are sequentially added, the x coordinate of the point fi can be calculated. That is, x fi = x 0 + (i−1) cos θ · sin θ (18) Next, the x coordinate j of the vertical grid line closest to the point fi
Satisfies j = [x fi +0.5] (19) From the above, the center of rotation in the i-th row is defined as gi (x gi , y
gi ), from formulas (12) and (13), x ai = j + x gi ... (20) y ai = [j tanθ + y gi ] (21) (where x gi and y gi are both integers) There is.)

以上、回転角θが、0≦θ<45゜の場合を述べたが、
次に、45゜≦θ<91゜の場合の処理を第5図を参照して
説明する。0は回転の中心、格子線の間隔は水平方向、
垂直方向ともに1である。点gi1(但し、iは、正の整
数である。)は0と同一水平格子線上に存在する格子点
で、左から順にg11、g21、g31、g41、…とする(点g11
は0と同一の格子点上に存在する。)直線liは、gi1
通り、傾きθの直線である。直線Fは、点g11を通り、
傾きθ−π/2の直線である。直線liと直線Fとの格点を
fiとする。点g1j(但し、jは整数である。)は、直線l
1と水平格子点の交点(以下、水平交点と称す。)で、
下から上へ順にg11、g12、g13…とする。点hiは、点fi
に最も近い水平交点とし、以下説明する。
As described above, the case where the rotation angle θ is 0 ≦ θ <45 ° has been described.
Next, processing in the case of 45 ° ≦ θ <91 ° will be described with reference to FIG. 0 is the center of rotation, the spacing between grid lines is horizontal,
It is 1 both in the vertical direction. A point g i1 (where i is a positive integer) is a grid point existing on the same horizontal grid line as 0, and is g 11 , g 21 , g 31 , g 41 ,. g 11
Exists on the same grid point as 0. ) The straight line li is a straight line that passes through g i1 and has an inclination θ. Straight F passes through the point g 11,
This is a straight line having a slope θ−π / 2. The score between the straight line li and the straight line F
fi. A point g 1j (where j is an integer) is a straight line l
At the intersection of 1 and the horizontal grid point (hereinafter referred to as horizontal intersection),
G 11 , g 12 , g 13, ... From the bottom to the top. The point hi is the point fi
The horizontal intersection closest to is described below.

ステップ(イ) 原画像の縦の画素数Mを、 個に変換する処理を行う。Step (a) The number of vertical pixels M of the original image is Perform the process of converting to individual.

ステップ(ロ) 原画像の横の画素数Nを、 個に変換する処理を行う。Step (b) The number of horizontal pixels N of the original image is Perform the process of converting to individual.

ステップ(ハ) 直線liと、水平格子線との交点である水平交点gij
算出する。
Step (c) A horizontal intersection gij which is an intersection between the straight line li and the horizontal grid line is calculated.

ステップ(ニ) ステップ(ハ)で算出した水平交点に最も近い格子点
を算出する。
Step (d) The grid point closest to the horizontal intersection calculated in step (c) is calculated.

ステップ(ホ) ステップ(ニ)の処理で算出した点hiに最も近い格子
点を転送開始格子点とし、ステップ(イ)とステップ
(ロ)の処理で求めが画像の第i行の第1番目の画素か
ら、順にステップ(ニ)の処理で算出した格子点に転送
する。
Step (e) The grid point closest to the point hi calculated in the processing of step (d) is set as the transfer start grid point, and the first grid point of the i-th row of the image is obtained by the processing of steps (a) and (b). Are sequentially transferred to the grid points calculated in step (d).

次に具体的な計算過程を示す。 Next, a specific calculation process will be described.

格子線の間隔は1であるから、点gl1(xg11、yg11
が与えられると、直線l1上の他の水平交点g1j(x1j、y
1j)は、 xg1j=xg11+j cotθ ……(22) yg1j=yg11+j ……(23) から、求められる。更に、点g11と同一水平格子線上に
ある他の点gi1(xgi1、ygi1)は、 xgi1=xg11+i ……(24) ygi1=yg1l ……(25) から、求められる。直線li上にある他の水平交点gij(x
gij、ygij)は、第(22)〜(25)式より、 xgij=xg11+i+j cotθ ……(26) ygijyg11+j ……(27) となる。次に、点fiのyの座標yfiは yfi=y11−i・cosθ・sinθ ……(28) である。故に、点fiに最も近い水平格子線のy座標k
は、 k=〔y11−i・cosθ・sinθ〕 ……(29) を満たす。以上より、第i行目の処理を行う際の転送開
始格子点の座標(xi1、yi1)は、 xi1=xg11+i+k cotθ ……(30) yi1=yg11+k ……(31) である。
Since the grid line interval is 1, the point g l1 (x g11 , y g11 )
When given, other horizontal intersection g 1j on the line l 1 (x 1j, y
1j ) is obtained from x g1j = x g11 + j cot θ (22) y g1j = y g11 + j (23) Further, another point g i1 (x gi1 , y gi1 ) on the same horizontal grid line as the point g 11 is obtained from x gi1 = x g11 + i (24) y gi1 = y g1l (25) Can be Another horizontal intersection g ij (x
gij and y gij ) are given by x gij = x g11 + i + j cot θ (26) y gijyg11 + j (27) from equations (22) to (25). Next, the coordinate y fi of y of the point fi is y fi = y 11 -i · cosθ · sinθ ...... (28). Therefore, the y coordinate k of the horizontal grid line closest to point fi
Satisfies k = [y 11 −i · cos θ · sin θ] (29) From the above, the coordinates (x i1 , y i1 ) of the transfer start grid point at the time of performing the processing on the i-th row are x i1 = x g11 + i + k cot θ (30) y i1 = y g11 + k (31) ).

以上の方法は、他の回転角の場合にも容易に拡張でき
る。
The above method can be easily extended to other rotation angles.

以下、第1図に参照しながら、本発明の一実施例にお
ける画像回転装置の具体的構成について説明する。
Hereinafter, a specific configuration of the image rotation device according to the embodiment of the present invention will be described with reference to FIG.

第1図において、101は原画を格納しておく原画格納
回路、102は原画を回転すべく回転角情報を保持してい
る回転角保持回路、103は回転角保持回路102の情報に基
ずき原画格納回路101から原画情報を読み込んで縦・横
の画素数にその原画情報を変換する画素数変換回路、10
4は回転角保持回路102からの情報に基ずき(X、Y)の
格子点座標(アドレス)を算出する格子点座標算出回
路、105、106は格子点座標算出回路104が算出した格子
点座標(X、Y)をそれぞれ格納するとともに、その格
子点座標算出回路104が次の格子点を算出するにあたり
現在の格子点座標を転送するX及びY座標格納回路、10
7は画素数変換回路103の変換結果を一時格納する一時記
憶回路、108はX及びY座標格納回路105、106が保持し
ている格子点座標(アドレス)に基ずき一時記憶回路10
7の内容を結果画格納回路109の一定の位置(アドレス)
に記憶させる画素転送回路である。
In FIG. 1, 101 is an original image storage circuit for storing an original image, 102 is a rotation angle holding circuit that holds rotation angle information for rotating the original image, and 103 is based on information of the rotation angle holding circuit 102. A pixel number conversion circuit for reading the original image information from the original image storage circuit 101 and converting the original image information into the number of vertical and horizontal pixels;
Reference numeral 4 denotes a grid point coordinate calculation circuit that calculates grid point coordinates (addresses) of (X, Y) based on information from the rotation angle holding circuit 102. Reference numerals 105 and 106 denote grid points calculated by the grid point coordinate calculation circuit 104. An X and Y coordinate storage circuit 10 for storing coordinates (X, Y) and transferring the current grid point coordinates when the grid point coordinate calculation circuit 104 calculates the next grid point;
7, a temporary storage circuit for temporarily storing the conversion result of the pixel number conversion circuit 103; 108, a temporary storage circuit 10 based on grid point coordinates (addresses) held by the X and Y coordinate storage circuits 105, 106;
The content of 7 is stored at a fixed position (address) in the result image storage circuit 109.
Is a pixel transfer circuit to be stored.

上記構成において、以下その動作を簡単に説明する。 The operation of the above configuration will be briefly described below.

まず、画素数変換回路103、原画格納回路101に格納さ
れている原画像を読み込み、回転角保持回路102が保持
する値をもとに、縦・横の画素数を変換する処理を行
い、結果を一時記憶回路107に書き込む。その画素転送
回路108は一時記憶回路107に格納されている画像を1画
素入力し、X座標格納回路105、及びY座標格納回路106
に格納されている値の示す位置に画素を転送し、結果画
格納回路109に書き込む。一方、格子点座標算出回路104
は、回転角保持回路102、X及びY座標格納回路105、10
6の値をもとに、格子点座標を算出し、画素転送回路108
が1画素処理する毎に、X及びY座標格納回路105、106
の格納値を更新する。
First, the pixel number conversion circuit 103 reads the original image stored in the original image storage circuit 101, and performs a process of converting the number of vertical and horizontal pixels based on the value held by the rotation angle holding circuit 102. Is written into the temporary storage circuit 107. The pixel transfer circuit 108 inputs one pixel of the image stored in the temporary storage circuit 107, and stores an X coordinate storage circuit 105 and a Y coordinate storage circuit 106.
Is transferred to the position indicated by the value stored in the result image storage circuit 109. On the other hand, the grid point coordinate calculation circuit 104
Are the rotation angle holding circuit 102, the X and Y coordinate storage circuits 105 and 10,
The grid point coordinates are calculated based on the value of 6, and the pixel transfer circuit 108
X and Y coordinate storage circuits 105 and 106 each time
Update the stored value of.

以上を繰り返することにより、結果画格納回路109に
は、原画格納回路101の内容が、回転角保持回路102に保
持される回転角に応じたものに変換され、記憶されてい
くことになる。
By repeating the above, the contents of the original image storage circuit 101 are converted and stored in the result image storage circuit 109 in accordance with the rotation angle held by the rotation angle holding circuit 102.

発明の効果 以上のように、本発明は間隔1のM本の水平格子線と
間隔1のN本の垂直格子線の交点である格子点上に位置
するM行N列の画素からなる原画像Aを、回転角度θに
応じたM′行N′列(M′=〔M/cosθ+0.5〕、N′=
〔N cosθ+0.5〕,0≦θ<45゜,但し〔α〕はαを越え
ない最大の整数)の画素からなる画像Bに変換する画素
数変換手段と、前記画素数変換手段で得た画像Bを構成
する各画素の転送先を算出する転送アドレス算出手段
と、前記転送アドレス算出手段で得た位置に画像Bを構
成する各画素を転送する画素転送手段とを具備し、前記
転送アドレス算出手段が、画像Aに含まれる回転の中心
である格子点g1と同一垂直格子線上に間隔1で存在する
格子点gi(i=1〜M′)に対し、giを通る傾きθの直
線liと垂直格子線との交点ej(j=1〜N′)を、回転
の中心g1を通る傾き−(π/2−θ)の直線Fとliとの交
点fiに最も近い垂直格子線から当該垂直格子線を含め間
隔1で存在するN′本の垂直格子線上に求め、ejと最も
近い格子点cjを、画像Bの第i行第j列の画素の転送先
として算出することにより、転送領域内から、1つの画
素に重複して転送する画素や、転送が発しない画素を無
くし、劣化の少ない回転画像を得ることができ、その工
業的価値は大なるものがある。
Effect of the Invention As described above, the present invention provides an original image including M rows and N columns of pixels located on a grid point, which is the intersection of M horizontal grid lines with an interval of 1 and N vertical grid lines with an interval of 1. A is represented by M ′ rows and N ′ columns (M ′ = [M / cos θ + 0.5], N ′ =
[N cos θ + 0.5], 0 ≦ θ <45 °, where [α] is the largest integer not exceeding α). Transfer address calculating means for calculating a transfer destination of each pixel constituting the image B; and pixel transfer means for transferring each pixel constituting the image B to a position obtained by the transfer address calculating means. The calculation means calculates a straight line li of a gradient θ passing through gi for a grid point gi (i = 1 to M ′) existing at the interval 1 on the same vertical grid line as the grid point g1 which is the center of rotation included in the image A. From the vertical grid line closest to the intersection fi between the straight line F and the li of the slope-(π / 2-θ) passing through the center g1 of rotation. A grid point cj closest to ej is determined on N ′ vertical grid lines existing at an interval of 1 including the vertical grid line, and the grid point cj on the i-th row By calculating as the transfer destination of the pixel, the pixel which is transferred to one pixel and the pixel which does not transfer is eliminated from the transfer area, and a rotated image with little deterioration can be obtained. There is great value.

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

第1図は本発明の一実施例における画像回転装置の具体
的ブロック結線図、第2図は本発明による1次元画像の
回転を説明する概念図、第3図は本発明による2次元画
像の回転を説明する概念図、第4図は転送開始座標の算
出方法を説明する概念図、第5図は回転角が45゜〜90゜
の場合に於ける本発明の回転処理を説明する概念図、第
6図は従来の1次元画像の回転を説明する概念図、第7
図は従来の2次元画像の回転を説明する概念図、第8図
は従来の回転方法を示すフロー図、第9図は従来の方法
により2次元画像を回転した結果を示す概念図である。 101……原画格納回路、102……回転角保持回路、103…
…画素数変換回路、104……格子点座標算出回路、105…
…X座標格納回路、106……Y座標格納回路、107……一
時記憶回路、108……画素転送回路、109……結果画格納
回路。
FIG. 1 is a specific block diagram of an image rotation device according to an embodiment of the present invention, FIG. 2 is a conceptual diagram illustrating rotation of a one-dimensional image according to the present invention, and FIG. FIG. 4 is a conceptual diagram illustrating a method of calculating transfer start coordinates, and FIG. 5 is a conceptual diagram illustrating a rotation process of the present invention when the rotation angle is 45 ° to 90 °. FIG. 6 is a conceptual diagram illustrating rotation of a conventional one-dimensional image, and FIG.
FIG. 8 is a conceptual diagram illustrating rotation of a conventional two-dimensional image, FIG. 8 is a flowchart illustrating a conventional rotation method, and FIG. 9 is a conceptual diagram illustrating a result of rotating a two-dimensional image by a conventional method. 101: Original image storage circuit, 102: Rotation angle holding circuit, 103:
... Pixel number conversion circuit, 104 ... Grid point coordinate calculation circuit, 105 ...
.. X coordinate storage circuit, 106 Y coordinate storage circuit, 107 temporary storage circuit, 108 pixel transfer circuit, 109 image storage circuit.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 川上 桂 川崎市多摩区東三田3丁目10番1号 松 下技研株式会社内 (56)参考文献 特開 昭63−24370(JP,A) ──────────────────────────────────────────────────続 き Continuation of the front page (72) Inventor Katsura Kawakami 3-10-1, Higashi-Mita, Tama-ku, Kawasaki Matsushita Giken Co., Ltd. (56) References JP-A-63-24370 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】間隔1のM本の水平格子線と間隔1のN本
の垂直格子線の交点である格子点上に位置するM行N列
の画素からなる原画像Aを、回転角度θに応じたM′行
N′列(M′=〔M/cosθ+0.5〕、N′=〔N cosθ+
0.5〕,0≦θ<45゜,但し〔α〕はαを越えない最大の
整数)の画素からなる画像Bに変換する画素数交換手段
と、 前記画素数変換手段で得た画像Bを構成する各画素の転
送先を算出する転送アドレス算出手段と、 前記転送アドレス算出手段で得た位置に画像Bを構成す
る各画素を転送する画素転送手段とを具備し、 前記転送アドレス算出手段が、画像Aに含まれる回転の
中心である格子点g1と同一垂直格子線上に間隔1で存在
する格子点gi(i=1〜M′)に対し、giを通る傾きθ
の直線liと垂直格子線との交点ej(j=1〜N′)を、
回転の中心g1を通る傾き−(π/2−θ)の直線Fとliと
の交点fiに最も近い垂直格子線から当該垂直格子線を含
め間隔1で存在するN′本の垂直格子線上に求め、ejと
最も近い格子点cjを、画像Bの第i行第j列の画素の転
送先として算出することを特徴とする画像回転装置。
1. An original image A consisting of M rows and N columns of pixels located on a grid point which is an intersection of M horizontal grid lines at an interval of 1 and N vertical grid lines at an interval of 1 is represented by a rotation angle θ. M ′ rows and N ′ columns (M ′ = [M / cos θ + 0.5], N ′ = [N cos θ +
0.5], 0 ≦ θ <45 °, where [α] is the largest integer not exceeding α). Pixel number exchange means for converting into an image B composed of pixels, and image B obtained by the pixel number conversion means. Transfer address calculation means for calculating a transfer destination of each pixel to be transferred, and pixel transfer means for transferring each pixel constituting the image B to a position obtained by the transfer address calculation means, wherein the transfer address calculation means comprises: For a grid point gi (i = 1 to M ′) existing at the interval 1 on the same vertical grid line as the grid point g1 which is the center of rotation included in the image A, the inclination θ passing through gi
The intersection ej (j = 1 to N ′) between the straight line li and the vertical grid line of
From the vertical grid line closest to the intersection fi of the straight line F of inclination-(π / 2-θ) passing through the center g1 of rotation and li, on the N ′ vertical grid lines existing at an interval of 1 including the vertical grid line An image rotation device, wherein a grid point cj closest to ej is calculated as a transfer destination of a pixel in the i-th row and the j-th column of the image B.
JP62022745A 1987-02-03 1987-02-03 Image rotation device Expired - Fee Related JP2636225B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62022745A JP2636225B2 (en) 1987-02-03 1987-02-03 Image rotation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62022745A JP2636225B2 (en) 1987-02-03 1987-02-03 Image rotation device

Publications (2)

Publication Number Publication Date
JPS63191192A JPS63191192A (en) 1988-08-08
JP2636225B2 true JP2636225B2 (en) 1997-07-30

Family

ID=12091235

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62022745A Expired - Fee Related JP2636225B2 (en) 1987-02-03 1987-02-03 Image rotation device

Country Status (1)

Country Link
JP (1) JP2636225B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR930007023B1 (en) * 1990-12-31 1993-07-26 삼성전자 주식회사 Method and apparatus for transforming image

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6324370A (en) * 1986-07-16 1988-02-01 Fujitsu Ltd Image data rotating system

Also Published As

Publication number Publication date
JPS63191192A (en) 1988-08-08

Similar Documents

Publication Publication Date Title
JPH0214750B2 (en)
JPS59101969A (en) Method and device for processing data of binary picture pattern
JP2636225B2 (en) Image rotation device
JP2001143062A (en) Rotational conversion of image using block transfer
JPH0481231B2 (en)
JP2502274B2 (en) Image converter
JPS59214376A (en) Picture data processor
JPS61141480A (en) Expanded character processor
JP2706744B2 (en) Image data position distortion correction method
JPH028335B2 (en)
JPH0785266A (en) Image rotating device
JPH0799848B2 (en) Image information recording device
JPH0374071B2 (en)
JP2913635B2 (en) Drawing method in bitmap display system
JPS6336189B2 (en)
JPH0378668B2 (en)
JPH0553350B2 (en)
JP2852257B2 (en) Image data rotation method and apparatus
JPH0668245A (en) Image rotation correction processing method and image rotation correction processor
JPH0481230B2 (en)
JPH0480429B2 (en)
JPS60189579A (en) Processor of picture data
JPH01120679A (en) Pattern transforming method
JP2857260B2 (en) Judgment method of rectangular area
JP2004288198A (en) Expansion/reduction device and method of image data

Legal Events

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