JPH0668245A - Image rotation correction processing method and image rotation correction processor - Google Patents

Image rotation correction processing method and image rotation correction processor

Info

Publication number
JPH0668245A
JPH0668245A JP4219426A JP21942692A JPH0668245A JP H0668245 A JPH0668245 A JP H0668245A JP 4219426 A JP4219426 A JP 4219426A JP 21942692 A JP21942692 A JP 21942692A JP H0668245 A JPH0668245 A JP H0668245A
Authority
JP
Japan
Prior art keywords
image
rotation correction
rotation
inclination
correction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4219426A
Other languages
Japanese (ja)
Inventor
Mitsunari Todoroki
晃成 轟
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP4219426A priority Critical patent/JPH0668245A/en
Publication of JPH0668245A publication Critical patent/JPH0668245A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a rotation correction device rotating an original image in an optimum direction by performing the rotation correction for an image inputted in its inclined state. CONSTITUTION:When the inclination of an image is detected in an inclination detection circuit 40, the rotation correction is realized and a corrected image is outputted by imparting proper rotation correction amount to a rotation correction circuit 50 by the inclination detection circuit 40 and a control input device 70. Therefore, because the rotation of the image is decomposed into the parallel moving in horizontal/vertical directions and the rotation correction is realized by only a bit shift and a logical calculation, an effect capable of remarkably improving processing speed is given.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、スキャナなどの画像入
力装置により読み込まれた画像を、ディスプレイ上に表
示する場合、また、文字認識等における前処理として、
文書および画像を任意の方向に回転する画像回転処理方
法及び装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is to display an image read by an image input device such as a scanner on a display, and as a preprocessing for character recognition and the like.
The present invention relates to an image rotation processing method and apparatus for rotating a document and an image in arbitrary directions.

【0002】[0002]

【従来の技術】文書および画像をスキャナなどの入力装
置により読み込んだ画像をディスプレイ上に表示したと
き、入力装置の規格や原画像の紙面のサイズなどの制約
のため画像が横向きや下向きに表示される場合がある。
また、ハンディスキャナにより画像を入力する場合やコ
ピー後の画像を入力する場合には、画像が傾いて読み込
まれる場合がある。ソフトファクシミリまたはデスクト
ップパブリッシィングにこのような画像を利用すると
き、最も読み易い方向に回転補正をする必要がある。ま
た、文書画像などの文字認識を実現する場合、前処理と
して文書画像の回転補正を用いることで、認識率の向上
が見込める。そのため、画像の回転補正は非常に重要な
処理となる。従来から、画像の回転法として二次元アフ
イン変換が有名である。この手法は、図2(a)に示す
ように、図形の平行移動と角度θの回転移動をする二次
元線形変換である。ここでは簡単のため長方形P1,P2
P3,P4を座標原点にX,Yそれぞれの方向にl,mだけ
平行移動し、原点を中心に角度θだけ回転すること示し
ている。式(1)(2)に原座標P(x,y)を変換座標Q
(X”,Y”)に二次元アフイン変換の変換行列TPR
示す。
2. Description of the Related Art When a document or an image read by an input device such as a scanner is displayed on a display, the image is displayed sideways or downward due to restrictions such as the standard of the input device and the size of the paper surface of the original image. There is a case.
Further, when an image is input by a handy scanner or an image after copying is input, the image may be read with an inclination. When using such an image for soft facsimile or desktop publishing, it is necessary to perform rotation correction in the direction that is most readable. Further, in the case of realizing character recognition of a document image or the like, it is expected that the recognition rate can be improved by using the rotation correction of the document image as preprocessing. Therefore, image rotation correction is a very important process. Conventionally, two-dimensional affine transformation is famous as an image rotation method. As shown in FIG. 2A, this method is a two-dimensional linear transformation in which a figure is translated and a figure is rotated by an angle θ. Here, for simplicity, rectangles P 1 , P 2 ,
It is shown that P 3 and P 4 are translated to the coordinate origin by l and m in the X and Y directions, respectively, and are rotated about the origin by an angle θ. The original coordinates P (x, y) are converted to the coordinates Q in the equations (1) and (2)
The transformation matrix T PR of the two-dimensional affine transformation is shown in (X ″, Y ″).

【0003】[0003]

【数1】 [Equation 1]

【0004】[0004]

【数2】 [Equation 2]

【0005】ところで、A4サイズの二値画像の画素数
は横1728×縦2376ドット(200dpi)であり、これらの各
画素に対し、上記のアフイン変換を施した場合、処理量
は膨大なものとなる。sinθ、cosθの演算等を含むため
浮動小数点の演算が必要となる。そのため、ソフトウェ
アで実現するためには高速なCPUを必要とし、ハード
ウェアで実現するためには、複雑な構成を必要とし現実
的でない。
By the way, the number of pixels of an A4 size binary image is 1728 horizontal × 2376 vertical dots (200 dpi), and when the above-mentioned Affine conversion is applied to each of these pixels, the processing amount is enormous. Become. Floating point arithmetic is required because it includes sin θ and cos θ arithmetic. Therefore, a high-speed CPU is required to realize it with software, and a complicated configuration is required to realize it with hardware, which is not realistic.

【0006】本発明は上記の問題点を解消することを課
題になされたもので、画像の傾き補正を高速に実現し、
また、CPUの負担を軽減することのできる画像回転補
正処理方法および装置を得ることを目的とする。
The present invention has been made to solve the above-mentioned problems, and realizes image inclination correction at high speed,
Another object of the present invention is to obtain an image rotation correction processing method and apparatus that can reduce the load on the CPU.

【0007】[0007]

【発明が解決しようとする課題】イメージスキャナなど
により読み込まれた入力画像がディスプレイ上で、傾い
て表示された場合や文書画像の認識処理における前処理
として傾き補正を行う場合に、任意の角度θに画像を高
速に回転する必要がある。A4用紙1枚を構成する画素
数は約500kバイトであり、従来の画像回転補正装置
は、これを各ビットごと処理するため非常に多くの演算
量となり、処理時間が増大する問題点を有していた。ま
た、二次元アフイン変換を忠実に実行することは浮動小
数の演算が必要となり画像回転補正を高速に処理するこ
とが困難となる。そこで、各画像をビット単位の処理で
なくバイト単位で処理でき、さらに、ビットシフトとビ
ットの論理演算のみで処理できる回転補正処理方法およ
び装置を実現することを目的とする。
When an input image read by an image scanner or the like is displayed on the display with a tilt, or when tilt correction is performed as preprocessing in the recognition processing of a document image, an arbitrary angle θ is set. It is necessary to rotate the image at high speed. The number of pixels constituting one A4 sheet is about 500 kbytes, and the conventional image rotation correction device processes each bit, which results in an extremely large amount of calculation and a problem that the processing time increases. Was there. Further, faithfully executing the two-dimensional Affine transformation requires floating point arithmetic, which makes it difficult to process the image rotation correction at high speed. Therefore, an object of the present invention is to realize a rotation correction processing method and apparatus capable of processing each image in units of bytes instead of processing in units of bits and further processing only by bit shift and logical operation of bits.

【0008】[0008]

【課題を解決するための手段】本発明の画像回転補正装
置は、入力画像が傾いて入力されたとき、傾き量に応じ
て傾きを補正する画像回転補正処理方法において、読み
込まれた原画像を二値化する二値化手段と、二値化した
画像を表示する画像出力手段と、読み込まれた画像の傾
き量を検出する傾き検出手段と、傾き補正をアフイン変
換により行う回転補正手段と、外部入力装置から傾き補
正量を入力する制御入力手段と、傾き検出手段と回転補
正手段を制御する制御手段とを備えたことを特徴とする
画像回転補正処理方法である。
According to an image rotation correction apparatus of the present invention, when an input image is input with an inclination, an original image read in an image rotation correction processing method for correcting the inclination according to the amount of inclination is used. Binarizing means for binarizing, image output means for displaying a binarized image, inclination detecting means for detecting the amount of inclination of the read image, rotation correcting means for performing inclination correction by Affine transformation, An image rotation correction processing method comprising: a control input unit for inputting a tilt correction amount from an external input device; and a control unit for controlling the tilt detection unit and the rotation correction unit.

【0009】回転補正回路は、X軸の平行移動とY軸の
平行移動により回転補正を実行することにより、回転補
正をバイト単位で処理するため、入力された画像の各画
素に対するビットシフトと論理演算のみでアフイン変換
を実行し、傾きを補正することを特徴とする。
The rotation correction circuit processes the rotation correction in byte units by executing the rotation correction by the parallel movement of the X axis and the parallel movement of the Y axis. Therefore, the bit shift and the logic for each pixel of the input image are performed. The feature is that the affine transformation is executed only by calculation to correct the inclination.

【0010】[0010]

【作用】本発明によれば、画像が傾いて入力された場合
に傾き量の判定検出を行い、検出された補正量にしたが
い回転補正する。本発明の傾き補正手段は、入力画像の
各画素に対しビットシフトと論理演算のみで回転量を補
正するため、演算量を大幅に減少できる。また、演算処
理がバイト単位で行えるため高速に演算可能となる。
According to the present invention, when the image is input with a tilt, the tilt amount is determined and detected, and the rotation is corrected according to the detected correction amount. Since the inclination correction means of the present invention corrects the rotation amount for each pixel of the input image only by bit shift and logical operation, the operation amount can be greatly reduced. In addition, since the arithmetic processing can be performed in byte units, high speed arithmetic can be performed.

【0011】[0011]

【実施例】図1は本発明の一実施例による画像回転補正
装置の全体構成を示すブロック図である。
FIG. 1 is a block diagram showing the overall configuration of an image rotation correction device according to an embodiment of the present invention.

【0012】イメージスキャナなどのデ−タ入力装置に
より読み込まれた画像データを、二値化回路10により
画像に二値化処理を施した後、ディスプレイなどの画像
出力装置20により画像を表示すると共に、30の画像
メモリに出力する。40の傾き検出回路により画像の傾
きを検出し傾き量を出力する。傾き検出回路40の構成
として、特に文書画像に対しては画像の領域分割を利用
する方法や文書全体を任意の角度方向で上から下まで走
査し、走査線上で白黒の画素値の反転回数を数え、これ
を統計処理することにより文書画像の傾きを検出する方
法(石谷、”文書画像の傾き検出に関する一手法”、1
992年春期信学全大、D-570)など提案されている。
また、制御入力装置70により画像の回転補正量を任意
に入力できる。回転補正回路50において傾き検出回路
40および制御入力装置70により得られた補正量を回
転補正回路50に入力することにより画像を回転する。
回転補正された新しい対象画像を画像メモリ30と画像
出力装置20に再度出力する。さらに、傾き検出回路4
0において再度傾き量θを求め、傾き量が傾き許容量ep
cに対しepc>θを満たすとき回転補正処理を終了する。
ここで、傾き許容量epcは全体のシステム構成による
が、epc<0.5[deg]にする事が望ましい。
Image data read by a data input device such as an image scanner is binarized by a binarization circuit 10 and then displayed by an image output device 20 such as a display. , 30 image memories. The tilt detection circuit 40 detects the tilt of the image and outputs the tilt amount. As the configuration of the inclination detection circuit 40, particularly for a document image, a method of utilizing image area division or scanning the entire document from top to bottom in an arbitrary angular direction to determine the number of inversions of black and white pixel values on a scanning line is performed. A method of counting and statistically processing the inclination of a document image (Ishitani, "One method for detecting the inclination of a document image", 1
Proposals have been made such as the Spring 1992 Faculty of Science, D-570).
Further, the rotation input amount of the image can be arbitrarily input by the control input device 70. The rotation correction circuit 50 rotates the image by inputting the correction amounts obtained by the inclination detection circuit 40 and the control input device 70 to the rotation correction circuit 50.
The new target image whose rotation has been corrected is output again to the image memory 30 and the image output device 20. Furthermore, the tilt detection circuit 4
At 0, the tilt amount θ is calculated again, and the tilt amount is determined by the tilt allowable amount ep
When epc> θ for c, the rotation correction process ends.
Here, the allowable tilt amount epc depends on the entire system configuration, but it is desirable that epc <0.5 [deg].

【0013】次に、上記の各構成要素について以下に詳
述する。
Next, each of the above components will be described in detail below.

【0014】二値化回路10は階調表示された自然画
像、カラー静止画像を画像の階調や輝度値にしたがいし
きい値処理等を施すことにより二値化する。また、入力
画像デ−タが二値画像の場合、二値化回路10を除去す
ることができる。
The binarization circuit 10 binarizes a gradation-displayed natural image or a color still image by performing threshold processing according to the gradation or luminance value of the image. When the input image data is a binary image, the binarization circuit 10 can be eliminated.

【0015】傾き検出回路40は入力画像に対し、原画
像からの傾きを検出する。特に文書画像の文字認識の処
理をする場合には、入力デ−タの統計的性質を利用する
ことにより傾き量を検出する方法が提案されている。傾
き検出回路40はこれらの傾き検出法を利用することも
可能であるが、デスクトップパブリッシング等でイメー
ジデ−タを扱う場合、また、ソフトファクシミリで画像
をディスプレイに表示する場合には、画像の傾きをディ
スプレイにより視覚的に確認できる。したがって、画像
の傾き量自動検出手段は必ずしも必要ではない。そこ
で、以下の手法により画像の傾き補正を簡単に実現す
る。
The inclination detection circuit 40 detects the inclination of the input image from the original image. In particular, in the case of character recognition processing of a document image, a method of detecting the amount of inclination by utilizing the statistical property of input data has been proposed. Although the inclination detection circuit 40 can use these inclination detection methods, when the image data is handled by desktop publishing or the like, or when the image is displayed on the display by soft facsimile, the inclination of the image is detected. Can be visually confirmed on the display. Therefore, the image tilt amount automatic detection means is not always necessary. Therefore, the inclination correction of the image is easily realized by the following method.

【0016】画像を液晶等のディスプレイに表示すると
き、たとえばパーソナルコンピュータでは640×40
0ドットのようにディスプレイごと特定の解像度を有す
る。通常ディスプレイの解像度はスキャナなどの画像入
力装置に対し低い解像度である。したがって、画像の回
転補正を行う場合、ドットピッチの制約により任意の精
度で画像を回転することは不可能である。図3にドット
数と画像の傾きの関係を示す。回転度数は図3に示すよ
うに角度θを示すkの値となる。kが大きいほど回転角
θは小さくなる。回転度数とtanθ、θ、cosθの関係は
表のようになる。画像の回転補正において1/256=
0.22[deg]であれば、回転精度は十分であると
考えられる。また、傾き検出回路40において統計的手
法を用いた傾き自動検出法では平均0.2[deg]程
度の誤差は生じる。人間の視覚特性に対しても、この程
度の誤差は許容範囲であると考えられる。
When displaying an image on a display such as a liquid crystal display, for example, 640 × 40 in a personal computer.
Each display has a specific resolution like 0 dots. Normally, the resolution of the display is lower than that of an image input device such as a scanner. Therefore, when the image rotation correction is performed, it is impossible to rotate the image with arbitrary accuracy due to the restriction of the dot pitch. FIG. 3 shows the relationship between the number of dots and the inclination of the image. The rotation frequency is a value of k indicating the angle θ as shown in FIG. The rotation angle θ decreases as k increases. The relationship between the rotation frequency and tan θ, θ, cos θ is shown in the table. 1/256 = in image rotation correction
If it is 0.22 [deg], it is considered that the rotation accuracy is sufficient. Further, in the tilt detection circuit 40, an error of about 0.2 [deg] on average occurs in the tilt automatic detection method using the statistical method. Even for human visual characteristics, such an error is considered to be within an allowable range.

【0017】ソフトファクシミリ等の画像をディスプレ
イ上で処理する装置において、マンマシンインタフェー
スを通し利用者が、制御入力部70を操作することによ
り回転制御信号を入力し、回転補正を実現するシステム
構成が一般的である。制御入力部70として、キーボー
ド、マウス、ペン入力タブレットなどを用いる場合、図
3の任意の角度θを選択し、制御入力部70により回転
制御量を入力することができる。角度θの選び方により
表示画像を任意の角度に回転できる。角度θの選び方を
例1にしたがって説明する。
In an apparatus for processing an image on a display such as a soft facsimile, a user operates a control input section 70 through a man-machine interface to input a rotation control signal to realize a rotation correction. It is common. When a keyboard, a mouse, a pen input tablet, or the like is used as the control input unit 70, an arbitrary angle θ in FIG. 3 can be selected and the rotation control amount can be input by the control input unit 70. The display image can be rotated at an arbitrary angle depending on how to select the angle θ. A method of selecting the angle θ will be described according to Example 1.

【0018】例1 原画像に対し表示画像が時計回りに
15.4[deg]傾いているとき、これを補正する角
度θを選ぶ。
Example 1 When the display image is inclined 15.4 [deg] clockwise with respect to the original image, the angle θ for correcting this is selected.

【0019】(傾き項の正、反はそれぞれ時計方向、反
時計方向の傾きズレ量を示す。) 補正手順[I] 補正回数 1回目 2回目 3回目 回転度数 k=2 k=5 k=7 回転方向 反時計 反時計 時計 角度θ[deg] 14.0 1.8 0.45 傾き [deg] 正1.4 反0.4 正0.05 補正手順[II] 補正回数 1回目 2回目 3回目 回転度数 k=2 k=6 k=7 回転方向 反時計 反時計 反時計 角度θ[deg] 14.0 0.89 0.45 傾き [deg] 正1.4 正0.51 正0.06 補正手順[III] 補正回数 1回目 2回目 3回目 4回目 5回目 6回目 回転度数 k=4 k=4 k=4 k=4 k=7 k=7 回転方向 反時計 反時計 反時計 反時計 反時計 反時計 角度θ[deg] 3.6 3.6 3.6 3.6 0.45 0.45 傾き [deg] 正11.8 正8.2 正4.6 正1.0 正0.55 正0.10 上記補正手順に示すように任意の角度の回転を回転度数
kを選ぶことで実現できる。さらに、補正手順[II
I]では回転度数をk=4または7に固定し、どちらかを選
択するのみで任意の角度の回転を実現できる。この場合
補正誤差は0.22[deg]以内である。この例に示すように
回転方向と回転量をある程度固定した場合も任意量の回
転が可能であり、また、マンマシンインタフェースを考
えた場合選択項目が少なくできる点が利点となる。
(Positive and counterclockwise inclinations indicate the amounts of inclination deviations in the clockwise and counterclockwise directions.) Correction procedure [I] Number of corrections 1st time 2nd time 3rd time Rotational frequency k = 2 k = 5 k = 7 Rotation direction Counterclockwise Counterclockwise angle Angle θ [deg] 14.0 1.8 0.45 Tilt [deg] Positive 1.4 Anti 0.4 Positive 0.05 Correction procedure [II] Number of corrections 1st 2nd 3rd rotation k = 2 k = 6 k = 7 rotations Direction Counterclockwise Counterclockwise Counterclockwise Angle θ [deg] 14.0 0.89 0.45 Tilt [deg] Positive 1.4 Positive 0.51 Positive 0.06 Correction procedure [III] Number of corrections 1st 2nd 3rd 4th 5th 6th rotation k = 4 k = 4 k = 4 k = 4 k = 7 k = 7 Rotation direction Counterclockwise Counterclockwise Counterclockwise Counterclockwise Counterclockwise Counterclockwise Angle θ [deg] 3.6 3.6 3.6 3.6 0.45 0.45 Tilt [deg] Positive 11.8 Positive 8.2 Positive 4.6 Positive 1.0 Positive 0.55 Positive 0.10 As shown in the above correction procedure, rotation of an arbitrary angle can be realized by selecting the rotation frequency k. Furthermore, the correction procedure [II
In [I], the rotation frequency can be fixed to k = 4 or 7, and only one of them can be selected to realize rotation at an arbitrary angle. In this case, the correction error is within 0.22 [deg]. As shown in this example, even when the rotation direction and the rotation amount are fixed to some extent, it is possible to rotate an arbitrary amount, and when considering the man-machine interface, it is advantageous that the selection items can be reduced.

【0020】図1の回転補正回路50において、簡単か
つ高速に回転補正するために、以下の方針を定める。
In the rotation correction circuit 50 shown in FIG. 1, the following policy is set in order to perform rotation correction easily and at high speed.

【0021】1.計算処理を軽減するため、浮動小数点
の演算は行わない。
1. Floating point arithmetic is not performed to reduce the calculation processing.

【0022】2.正確な移動位置を計算してもディスプ
レイの画素数の制約のため計算した位置に移動できな
い。そのため正確に移動位置を算出する必要がない。
2. Even if the accurate moving position is calculated, it cannot move to the calculated position due to the limitation of the number of pixels of the display. Therefore, it is not necessary to accurately calculate the moving position.

【0023】(回転精度に関しては、θ=0.25[d
eg]で十分) 3.回転は垂直方向と水平方向の二度の平行移動で実現
できる。
(Regarding the rotation accuracy, θ = 0.25 [d
eg] is sufficient) 3. Rotation can be achieved by two parallel translations in the vertical and horizontal directions.

【0024】4.浮動小数点の演算を避けるために、変
換画像が原画像に対して完全には射影出来ない。
4. In order to avoid floating point arithmetic, the transformed image cannot be perfectly projected onto the original image.

【0025】回転補正回路50の実現法として、本発明
の回転補正回路を詳述する。まず、原点Oを中心に回転
するアフイン変換を式(3)に示す。
As a method of realizing the rotation correction circuit 50, the rotation correction circuit of the present invention will be described in detail. First, the affine transformation that rotates about the origin O is shown in equation (3).

【0026】[0026]

【数3】 [Equation 3]

【0027】この関係を図2(b)に示す。式(3)を
変形すると以下のようになる。
This relationship is shown in FIG. When the formula (3) is modified, it becomes as follows.

【0028】[0028]

【数4】 [Equation 4]

【0029】[0029]

【数5】 [Equation 5]

【0030】X方向、Y方向の移動量としてu,vを定
義する。
U and v are defined as the amounts of movement in the X and Y directions.

【0031】[0031]

【数6】 [Equation 6]

【0032】[0032]

【数7】 [Equation 7]

【0033】ここで、図3の表から回転度数kが3以上
である場合、cosθ≒1であるので式(6)(7)は以
下のようになる。
Here, from the table of FIG. 3, when the rotation frequency k is 3 or more, cos θ≈1, and therefore equations (6) and (7) are as follows.

【0034】[0034]

【数8】 [Equation 8]

【0035】[0035]

【数9】 [Equation 9]

【0036】ただし、INT(X)は小数値を実数値に
する関数(小数点以下切捨て)画像の傾き補正量がそれ
ほど大きくない場合、cosθ=1と近似できるので式
(8)(9)に示すように変形できる。tanθ=2-kであ
るので移動量u,vはビットシフトのみで表現できる。
However, INT (X) is a function for converting a decimal value to a real value (truncated below the decimal point). If the amount of tilt correction of an image is not so large, cos θ can be approximated to 1 and therefore is shown in equations (8) and (9). Can be transformed into Since tan θ = 2- k , the movement amounts u and v can be expressed only by bit shift.

【0037】方針3で述べたように回転は、水平方向、
垂直方向の二度の平行移動で表現できる。元画素の位
置、垂直方向移動後の位置、水平方向移動後の位置をそ
れぞれQ(Xj,Yj)、Q'(X'j,Y'j)、Q"(X"j,Y"j)とす
る。
As described in Policy 3, the rotation is in the horizontal direction,
It can be expressed by two parallel translations in the vertical direction. The position of the original pixel, the position after the vertical movement, and the position after the horizontal movement are Q (X j , Y j ), Q '(X' j , Y ' j ), and Q "(X" j , Y ", respectively. j ).

【0038】[0038]

【数10】 [Equation 10]

【0039】Q”は回転移動した変換画素値となる。こ
こで、u(Y)は元画素の位置Q(X,Y)の関数となる。これ
を移動vをした後のY’の関数とするために次に示す変
換を行う。
Q ″ is a converted pixel value that is rotated and moved. Here, u (Y) is a function of the position Q (X, Y) of the original pixel. This is a function of Y ′ after moving v. The following conversion is performed to

【0040】[0040]

【数11】 [Equation 11]

【0041】上述した方針とこの簡易回転補正手段を用
いた画像の回転手順を図4、図5に示す。
FIGS. 4 and 5 show the above-described policy and the image rotation procedure using this simple rotation correction means.

【0042】図4(a)は原画像である。これをθ=-1
4.4[deg]、tanθ=-1/4の回転を示す。図4(b)に垂
直方向平行移動を示す。座標P(Xo,Yo)を原点として、
tanθ=-1/4(符号は対象画素の位置により、tanθの値
に従う。)の割合で垂直方向に平行移動する。
FIG. 4A shows an original image. Θ = -1
It shows the rotation of 4.4 [deg] and tan θ = -1/4. FIG. 4B shows the vertical translation. With coordinates P (X o , Y o ) as the origin,
tan θ = -1 / 4 (the code depends on the value of tan θ depending on the position of the target pixel) and is translated in the vertical direction.

【0043】[0043]

【数12】 [Equation 12]

【0044】原画像のXの位置によりvだけ移動する。Depending on the X position of the original image, it moves by v.

【0045】水平方向の平行移動に関して図4(c)に
示す。垂直方向と同様な手順により、式(8)(9)
(10)(11)に従い座標Q”(Xj",Yj")に平行
移動する。
The horizontal translation is shown in FIG. 4 (c). By the same procedure as in the vertical direction, equations (8) and (9)
(10) In accordance with (11), the object is moved in parallel to the coordinate Q ″ (Xj ″, Yj ″).

【0046】[0046]

【数13】 [Equation 13]

【0047】θ=-26.6[deg]、tanθ=-1/2の回転補正
の様子を図5(a)(b)(c)に示す。式(12)
(13)を用い回転度数k=2の場合と同様に回転補正で
きる。この時移動量u,vは以下の式を用いる。
FIGS. 5A, 5B and 5C show the state of rotation correction when θ = −26.6 [deg] and tan θ = −1 / 2. Formula (12)
Using (13), the rotation can be corrected in the same manner as in the case of the rotation frequency k = 2. At this time, the following expressions are used for the movement amounts u and v.

【0048】[0048]

【数14】 [Equation 14]

【0049】図4、図5に示す手法により画像の回転補
正を行うことにより、演算量の少ない回転補正が実現で
きる。図6、図7に本発明による回転補正装置のハード
ウェアまたはソフトウェアによる実現法を詳細に示す。
ここで原画像をθ=3.6[deg]回転度数k=3の時
計方向へ回転するものとした。
By performing image rotation correction by the method shown in FIGS. 4 and 5, rotation correction with a small amount of calculation can be realized. 6 and 7 show in detail how the rotation correction device according to the present invention is implemented by hardware or software.
Here, it is assumed that the original image is rotated clockwise with θ = 3.6 [deg] rotation degree k = 3.

【0050】図6(a)はメモリ上における各レジスタ
の要素の例である。これは出力手段(ディスプレイ)上
の各画素値に1ビット毎対応しているとする。図6
(b)に垂直方向の平行移動を示す。原画像が二次元配
列A(i,j)に格納されているとき(配列Aは1バイ
ト)、垂直方向の平行移動において、tanθ=-1/8の回
転は図に示すように、8ビットごとの平行移動となるの
で各記憶要素(配列)Aを記憶要素(配列)Bに入れ換
えることで実現できる。A(i,j)を中心に回転補正する
場合の変換関係をしめす。
FIG. 6A shows an example of elements of each register on the memory. This corresponds to each pixel value on the output means (display) bit by bit. Figure 6
The vertical translation is shown in (b). When the original image is stored in the two-dimensional array A (i, j) (array A is 1 byte), in parallel translation, rotation of tan θ = -1/8 is 8 bits as shown in the figure. Since each memory element (array) A is replaced by a memory element (array) B, it can be realized. The conversion relationship in the case of rotation correction around A (i, j) is shown.

【0051】[0051]

【数15】 [Equation 15]

【0052】図6(b)にA(i,1)を中心に回転補正す
る場合の例を示す。これをソフトウェアで実現する場合
にはメモリ上のアドレスを変更するだけでいいので非常
に高速に処理することが出来る。また、回転度数kがk
<3のときバイト単位で処理できないのが、ビットマス
クの処理を施すことにより同様に扱うことが出来る。
FIG. 6B shows an example of the case where the rotation correction is performed around A (i, 1). When this is implemented by software, it is only necessary to change the address on the memory, so processing can be performed at extremely high speed. Also, the rotation frequency k is k
When <3, processing cannot be performed in byte units, but it can be handled in the same way by performing bit mask processing.

【0053】次に、水平方向の平行移動について示す。
tanθ=-1/8の回転であるので8ビットごとの処理とな
り各配列を垂直方向に8ビットごとにまとめて処理す
る。簡単のために配列BをB(8n+l,j)[l=0,1,2,・・・,
7,n=0,1,2,・・・]のブロックBnjとする。点Pを中心に
回転移動するときそれぞれのブロックBnjはビットシフ
トにより水平方向に平行移動できる。変換後の画素ブロ
ックをCnjとする。8ビット以上のビットシフトは記憶
要素の交換とビットシフトを併用することにより、8ビ
ット以上のシフトレジスタを用意する必要はない。式
(11)で示したように水平方向の移動は、水平方向の
位置による補正項tan2θが必要となるが、この操作も回
転度数k(角度θ)が決定されることにより、X座標の
位置だけで一意に決定できるのでビットシフト処理のみ
で実行することが可能である。また、ビットシフティン
グにより桁あふれをするビットに対してはバッファに取
り込み前後のブロックに挿入する必要がある。X方向の
補正により画素値が決定されないとき、つまり画素抜け
するときも、前後の画素値を補換することにより画素抜
けを防止することが可能となる。以上により点Pを中心
とした回転補正をビットシフトと配列要素の入れ替えの
みで実現できることが示された。図6および図7では回
転度数k=3の例を示したが他の回転度数に対しても同様
な操作で実現できる。アフイン変換等の画像処理では各
ビット単位の処理になるのに対し本発明による画像処理
ではバイト単位で処理することが出来る利点を有してい
る。
Next, horizontal translation will be described.
Since the rotation is tan θ = -1 / 8, processing is performed every 8 bits, and each array is collectively processed in every 8 bits in the vertical direction. For simplification, the array B is changed to B (8n + l, j) [l = 0,1,2, ...,
7, n = 0, 1, 2, ...], which is a block B nj . When rotating around the point P, each block B nj can be moved in parallel in the horizontal direction by bit shift. The pixel block after conversion is C nj . For bit shift of 8 bits or more, it is not necessary to prepare a shift register of 8 bits or more by exchanging storage elements and using bit shift together. As shown in Expression (11), the horizontal movement requires a correction term tan 2 θ depending on the horizontal position, but this operation also determines the rotation frequency k (angle θ), and thus the X coordinate Since it can be uniquely determined only by the position of, it can be executed only by the bit shift process. Also, for bits that overflow due to bit shifting, it is necessary to take them into a buffer and insert them into blocks before and after. Even when the pixel value is not determined by the correction in the X direction, that is, when the pixel is missing, it is possible to prevent the pixel missing by replacing the preceding and following pixel values. As described above, it has been shown that the rotation correction around the point P can be realized only by bit shift and replacement of array elements. 6 and 7 show an example in which the rotation frequency k = 3, the same operation can be realized for other rotation frequencies. While image processing such as Affine conversion is performed on a bit-by-bit basis, the image processing according to the present invention has an advantage that it can be processed on a byte-by-byte basis.

【0054】ディスプレイ上で行う画像処理では、原画
像が横向きに読み込まれた場合など90度の回転補正が
必要となることが考えられる。そこで以下に90度回転
の補正を実現する手段について示す。図8(a)は横向
き画像を縦向きに補正したときのモデルである。Aij
lバイトの原画素レジスタである。これらの各レジスタ
を図8(b)に示すシフトレジスタとmビットのバッフ
ァによりmビットごと取り込みそれをアフイン変換レジ
スタCjiの位置に移動することで90度の回転補正が実
現できる。図8(b)ではl=8,m=8として例を示
す。また、180度、270度の回転補正は90度回転
補正を2度、3度繰り返すことで実現できる。
Image processing performed on the display may require 90-degree rotation correction when the original image is read in the horizontal direction. Therefore, a means for realizing the 90-degree rotation correction will be described below. FIG. 8A shows a model when a horizontally oriented image is vertically corrected. A ij is a 1-byte original pixel register. Rotation correction of 90 degrees can be realized by fetching each of these registers every m bits by the shift register and the m-bit buffer shown in FIG. 8B and moving them to the position of the affine conversion register C ji . FIG. 8B shows an example where l = 8 and m = 8. Rotational corrections of 180 degrees and 270 degrees can be realized by repeating 90-degree rotation corrections twice and three times.

【0055】上記実施例は、画像の傾き補正にtanθ=2
-kの回転度数kを用いkを任意に設定することで任意の
回転補正が実現できることを示すとともに、図150の
回転補正手段の具現化法としてバイト単位で回転補正処
理できる画像回転補正処理方法および装置装置について
説明した。これにより簡単な構成で高速な回転補正が実
現できる。
In the above embodiment, tan θ = 2 is used for correcting the inclination of the image.
It is shown that arbitrary rotation correction can be realized by arbitrarily setting k using the rotation frequency k of -k , and an image rotation correction processing method capable of performing rotation correction processing in byte units as a method of embodying the rotation correction means in FIG. The device has been described. As a result, high-speed rotation correction can be realized with a simple structure.

【0056】[0056]

【発明の効果】以上のように本発明によれば、画像の回
転を水平・垂直方向の平行移動に分解したことにより回
転補正をビットシフトと論理演算のみで実現したため処
理速度を大幅に改善できる効果を有する。さらに、簡単
なアルゴリズムであるためソフトウェア及びハードウェ
ア化が容易である。
As described above, according to the present invention, since the rotation of the image is decomposed into the parallel movement in the horizontal and vertical directions, the rotation correction is realized only by the bit shift and the logical operation, so that the processing speed can be greatly improved. Have an effect. Furthermore, since it is a simple algorithm, it can be easily implemented as software and hardware.

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

【図1】 本発明の一実施例による回転補正処理方法お
よび装置の全体構成を示すブロック図。
FIG. 1 is a block diagram showing an overall configuration of a rotation correction processing method and apparatus according to an embodiment of the present invention.

【図2】 二次元アフイン変換と移動量u,vを定義す
る図。
FIG. 2 is a diagram defining a two-dimensional affine transformation and movement amounts u and v.

【図3】 回転度数の定義と回転角の関係を示す図。FIG. 3 is a diagram showing a relationship between a definition of a rotation frequency and a rotation angle.

【図4】 画像の回転補正手段を説明する図(回転度数
k=2)。
FIG. 4 is a diagram for explaining image rotation correction means (rotational frequency k = 2).

【図5】 画像の回転補正手段を説明する図(回転度数
k=1)。
FIG. 5 is a diagram for explaining image rotation correction means (rotational frequency k = 1).

【図6】 画像の回転補正手段を実現するための具体例
を示す図(Y方向平行移動)。
FIG. 6 is a diagram showing a specific example for realizing image rotation correction means (Y direction parallel movement).

【図7】 画像の回転補正手段を実現するための具体例
を示す図(X方向平行移動)。
FIG. 7 is a diagram showing a specific example for realizing image rotation correction means (translation in the X direction).

【図8】 回転角90度の場合の回転補正手段を説明す
る図。
FIG. 8 is a diagram illustrating rotation correction means when the rotation angle is 90 degrees.

【符号の説明】[Explanation of symbols]

10・・・二値化回路 20・・・画像出力装置 30・・・画像メモリ 40・・・傾き検出回路 50・・・回転補正回路 60・・・制御部 70・・・制御入力装置 71・・・傾き検出制御信号 72・・・回転補正制御信号 73・・・制御入力信号 74・・・画像デ−タ 10 ... Binarization circuit 20 ... Image output device 30 ... Image memory 40 ... Tilt detection circuit 50 ... Rotation correction circuit 60 ... Control unit 70 ... Control input device 71. ..Inclination detection control signal 72 ... Rotation correction control signal 73 ... Control input signal 74 ... Image data

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 入力画像が傾いて入力されたとき、傾き
量に応じて傾きを補正する画像回転補正処理方法におい
て、読み込まれた原画像を二値化する二値化手段と、二
値化した画像を表示する画像出力手段と、読み込まれた
画像の傾き量を検出する傾き検出手段と、傾き補正をア
フイン変換により行う回転補正手段と、外部入力装置か
ら傾き補正量を入力する制御入力手段と、傾き検出手段
と回転補正手段を制御する制御手段とを備えたことを特
徴とする画像回転補正処理方法。
1. An image rotation correction processing method for correcting an inclination according to an inclination amount when an input image is input with an inclination, a binarizing unit for binarizing a read original image, and a binarization. Image output means for displaying the displayed image, tilt detection means for detecting the tilt amount of the read image, rotation correction means for performing tilt correction by affine transformation, and control input means for inputting the tilt correction amount from an external input device. And an image rotation correction processing method comprising: a tilt detection unit and a control unit that controls the rotation correction unit.
【請求項2】画像回転補正処理手段において、入力され
た画像の各画素に対するビットシフトと論理演算のみで
アフイン変換を実行し、傾きを補正することを特徴とす
る画像回転補正処理装置。
2. An image rotation correction processing apparatus, wherein image rotation correction processing means performs affine transformation by only bit shift and logical operation for each pixel of an input image to correct the inclination.
【請求項3】上記画像回転補正処理手段の回転補正をX
軸の平行移動とY軸の平行移動により実行することによ
り、回転補正をバイト単位で処理することを特徴とする
請求項2記載の画像回転補正処理装置。
3. The rotation correction of the image rotation correction processing means is X.
3. The image rotation correction processing device according to claim 2, wherein the rotation correction is processed in byte units by executing the parallel movement of the axes and the parallel movement of the Y axes.
JP4219426A 1992-08-18 1992-08-18 Image rotation correction processing method and image rotation correction processor Pending JPH0668245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4219426A JPH0668245A (en) 1992-08-18 1992-08-18 Image rotation correction processing method and image rotation correction processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4219426A JPH0668245A (en) 1992-08-18 1992-08-18 Image rotation correction processing method and image rotation correction processor

Publications (1)

Publication Number Publication Date
JPH0668245A true JPH0668245A (en) 1994-03-11

Family

ID=16735213

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4219426A Pending JPH0668245A (en) 1992-08-18 1992-08-18 Image rotation correction processing method and image rotation correction processor

Country Status (1)

Country Link
JP (1) JPH0668245A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6718070B2 (en) 2000-02-24 2004-04-06 Minolta Co., Ltd. Device and method for detecting subject inclination
JP2010124366A (en) * 2008-11-21 2010-06-03 Sony Corp Image signal processing apparatus, image signal processing method and image projection device
US8121441B2 (en) 2007-10-26 2012-02-21 Murata Machinery, Ltd. Image processing apparatus, image scanning apparatus, image processing method, and image processing program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6718070B2 (en) 2000-02-24 2004-04-06 Minolta Co., Ltd. Device and method for detecting subject inclination
US8121441B2 (en) 2007-10-26 2012-02-21 Murata Machinery, Ltd. Image processing apparatus, image scanning apparatus, image processing method, and image processing program
JP2010124366A (en) * 2008-11-21 2010-06-03 Sony Corp Image signal processing apparatus, image signal processing method and image projection device
US8803946B2 (en) 2008-11-21 2014-08-12 Sony Corporation Image signal processing device, method and projecting device for stereoscopic images

Similar Documents

Publication Publication Date Title
US5272469A (en) Process for mapping high resolution data into a lower resolution depiction
US8553284B2 (en) Information input/output method using dot pattern
JP3005296B2 (en) Rotate run-length coded images
US20060274948A1 (en) Stroke localization and binding to electronic document
AU2005200145A1 (en) Strokes localization by m-array decoding and fast image matching
MXPA05000369A (en) Enhanced approach of m-array decoding and error correction.
US5889893A (en) Method and apparatus for the fast rotation of an image
JPS6232476B2 (en)
US4942621A (en) Method for mapping scanned pixel data
US5670982A (en) System for fast 90-degree rotation of bi-level images
KR20080009870A (en) Apparatus and method for rotation bitmap image
US6785428B1 (en) Rotated transform of an image using block transfers
JPH0668245A (en) Image rotation correction processing method and image rotation correction processor
JP3009525B2 (en) Vector image drawing equipment
CN114495105A (en) Image tilt correction method, device, storage medium and computer equipment
JPH08237486A (en) Method for smoothing character in scanner/printer
JP2644724B2 (en) Document image skew correction method
JPS5938612B2 (en) information input device
JPH09237318A (en) Inclination correcting method for character image data inputted by image scanner
JPH07296157A (en) Method and system of rotating image data
JPH09120430A (en) Image processor
JP3072721B2 (en) Image processing method and apparatus, storage medium for storing image processing program
CN110490825B (en) Method, device and equipment for correcting coded picture and storage medium
JPH05151350A (en) Method for correcting position distortion of image data
JP2023037359A (en) Image processing program and image processing system