JPH02165288A - Picture processor - Google Patents

Picture processor

Info

Publication number
JPH02165288A
JPH02165288A JP63320256A JP32025688A JPH02165288A JP H02165288 A JPH02165288 A JP H02165288A JP 63320256 A JP63320256 A JP 63320256A JP 32025688 A JP32025688 A JP 32025688A JP H02165288 A JPH02165288 A JP H02165288A
Authority
JP
Japan
Prior art keywords
image
rotation
coordinate
picture
character
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
JP63320256A
Other languages
Japanese (ja)
Inventor
Yoshihiro Mizuniwa
水庭 佳弘
Hitoshi Goto
仁 後藤
Kiyoya Shima
島 清哉
Kiyoshi Ishikawa
澄 石川
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.)
Hitachi Industry and Control Solutions Co Ltd
Original Assignee
Hitachi Engineering Co Ltd Ibaraki
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 Hitachi Engineering Co Ltd Ibaraki filed Critical Hitachi Engineering Co Ltd Ibaraki
Priority to JP63320256A priority Critical patent/JPH02165288A/en
Publication of JPH02165288A publication Critical patent/JPH02165288A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Character Discrimination (AREA)
  • Image Analysis (AREA)

Abstract

PURPOSE:To increase a character rotational speed by transforming the rotatory coordinate of an original picture and the rotatory coordinate of a new picture using a prescribed expression when a character obliquely taken in using a camera is to be rotated, returned to its normal direction and recognized, and providing up and down counters for a control circuit. CONSTITUTION:A cylindrical object 14, in which the character is written, is illuminated by an illuminator 13 and photographed by a camera 11, the picture is processed in a picture processor 10, and the written character is read. The analog output signal of the camera 11 is converted into a digital signal in an A/D converter 101 in the device 10, the output of the converter 101 is selected in a selector 102, binarized in a lookup table 103, passed through a filter circuit 104, and stored in a picture memory 105. For this picture, a character part is selected and segmented in X and Y axis projection circuits 110 and 111, rotation-processed, and stored in a picture memory 107, and at this time, the coordinate of the original picture and the coordinate of the new picture, namely, X, Y and X2, Y2, are transformed using expressions X2=AX+BY and Y2=CX+ DY and expanded for (1-2<0.5>) times.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はカメラにより取り込まれた文字等の像をパター
ンマツチングにより認識する画像処理装置に係り、特に
斜めに取り込まれた文字等を回転し、正常な方向に直し
て認識する装置に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to an image processing device that recognizes images of characters, etc. captured by a camera by pattern matching, and in particular, the present invention relates to an image processing device that recognizes images of characters etc. captured by a camera by pattern matching. , relates to a device for correcting and recognizing the normal orientation.

〔従来の技術〕[Conventional technology]

パターンマツチング技術を用いて文字や記号あるいは部
品の形等を認識する技術は色々と考案されている。
Various technologies have been devised to recognize characters, symbols, shapes of parts, etc. using pattern matching technology.

パターンマツチングにおいては、まず、パターンを標準
の行数2列数(例えば16行、16列)の画素に正規化
した2値の信号とすることを決め。
In pattern matching, first, it is decided that the pattern will be a binary signal normalized to a standard number of rows and two columns of pixels (for example, 16 rows and 16 columns).

標準となるパターンを人力する。次に、対象物の画像を
カメラにより取り込み、パターンを切り出す。これより
標準の16行、16列の白黒の2値パターンに正規化さ
れた対象物のパターンを求め、これと標準パターンを比
較する。そして、対象物のパターンに対して一致した画
素の数が所要の値より多い標準パターンが対象物に対応
するパターンであると判断する。
Manually create a standard pattern. Next, an image of the object is captured by a camera and a pattern is cut out. From this, a pattern of the object normalized to a standard black and white binary pattern of 16 rows and 16 columns is obtained, and this is compared with the standard pattern. Then, a standard pattern in which the number of pixels matching the pattern of the target object is greater than a required value is determined to be a pattern corresponding to the target object.

この方式により、缶などの円筒の底に印刷された文字等
を認識する場合、取り込まれた画像は斜めになっている
のが1片通であり、画像の回転によりこれを水平な方向
に戻した後で、切り出し、正規化等の処理を行う必要が
ある。
When using this method to recognize characters printed on the bottom of a cylinder such as a can, the captured image is slanted in one direction, and by rotating the image, it is returned to the horizontal direction. After that, it is necessary to perform processing such as extraction and normalization.

画像の回転の技術はこれまで種々開発されており、例え
ば、特開昭62−139085号公報には回転後のアド
レスを計算して画素の位置を置き換えることにより画像
を回転する方法が述べられている。
Various image rotation techniques have been developed so far. For example, Japanese Patent Laid-Open No. 139085/1985 describes a method of rotating an image by calculating addresses after rotation and replacing pixel positions. There is.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかし、これまでの画像回転の技術は、パターンマツチ
ング技術と組み合わせた手法としては考えられていなか
った。
However, until now, image rotation technology has not been considered as a method that can be combined with pattern matching technology.

回転を行い1文字などの方向を水平に直してパターンマ
ツチングを行う手法においては、パターンマツチングに
おいて1画素数を正規化するという処理を含むので、普
・通の画像の回転とは意味が異なる。
In the method of performing pattern matching by rotating and correcting the direction of a single character, etc. to horizontal, the pattern matching includes a process of normalizing the number of pixels, so it has no meaning with normal image rotation. different.

つまり、普通の回転においては1回転した後の画像の大
きさは当然回転前と同じでなければならないが、正規化
を行うパターンマツチングの場合は回転前と大きさが変
わることは問題とはならない。また、パターンマツチン
グにおいて回転しなければならない部分は、対象の文字
などの部分だけである。
In other words, in normal rotation, the size of the image after one rotation must of course be the same as before rotation, but in the case of pattern matching that performs normalization, it is not a problem that the size changes from before rotation. It won't happen. In addition, the only parts that need to be rotated in pattern matching are target characters and the like.

このような条件を考えると、画像の回転手法が簡単にな
り、高速に回転処理を行うことができるようになる。
Considering these conditions, the image rotation method becomes simple and rotation processing can be performed at high speed.

本発明の目的は、斜めに取り込まれた画像を回転して正
常な方向に直して認識することができる画像処理装置を
提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide an image processing device that can rotate an image captured obliquely, correct it in the normal direction, and then recognize the image.

〔課題を解決するための手段〕[Means to solve the problem]

第2図に示すように点■)を、原点Oを中心にαだけ回
転した場合の点をPi とし、各々の座標を(x、y)
、(XI、Yl)とする。
As shown in Figure 2, the point (■) rotated by α around the origin O is Pi, and each coordinate is (x, y).
, (XI, Yl).

いま、ベクトルOI)の長さをr、X軸となす角度を0
とすると次の式が成立する。
Now, the length of vector OI) is r, and the angle between it and the X axis is 0.
Then, the following formula holds.

(3)式かられかるように、XIとYsを求めるために
は、XとYにそれぞれcosαとsinαを掛けなけれ
ばならない。
As can be seen from equation (3), in order to obtain XI and Ys, X and Y must be multiplied by cos α and sin α, respectively.

しかし、いまαを一45″〜+45″に限定すれば、1
/cosα は1〜./Tである。パターンマツチング
に用いるのであれば1画像が〜を一倍に拡大するのは全
く問題がない。
However, if we limit α to -45'' to +45'', then 1
/cosα is 1~. /T. If it is used for pattern matching, there is no problem in enlarging one image by one time.

そこで1点P!を1/cosα倍した位置P2の座標を
(X Z、 Y 2)とすれば次のようになる。
1 point P there! If the coordinates of position P2, which is obtained by multiplying 1/cosα by (X Z, Y 2), are as follows.

次に1点P1については次の式が成立する。Next, the following equation holds true for one point P1.

(2)式を変形すると次の式が得られる。By transforming equation (2), the following equation is obtained.

このように、Xzを求めるのはY座標にtanαを、Y
xを求めるにはX座標にtanα を掛ける1回の処理
で対応することができる。さらによいことは、画像の座
標変換を行うさいに、元画像のデータはX軸方向に1行
ずつ走査していくので、新画像の座標を1行分求めるに
当たっては元座標のY座標の値は不変で、X座標のみ1
ずっ増加するので、新座標はX座標を同様に1つずつ増
加させ。
In this way, to find Xz, set tanα to the Y coordinate and Y
To obtain x, it is possible to perform a single process of multiplying the X coordinate by tanα. Even better, when performing image coordinate transformation, the data of the original image is scanned line by line in the is unchanged, only the X coordinate is 1
Since it will continue to increase, the new coordinate will similarly increase the X coordinate by one.

Y座標をtanαずつ変化させればよい。It is sufficient to change the Y coordinate by tanα.

次の行の最初の座標を求めるには、前の行の最初の座標
を基準として、Y座標は1つ増加し、X座標は−tan
αだけ変化させればよい。
To find the first coordinate of the next row, take the first coordinate of the previous row as a reference, increase the Y coordinate by 1, and set the X coordinate by -tan.
It is sufficient to change only α.

このように、新座標を求めるに当たっては、tanαを
1回毎に加算するだけであり、掛は算も必要ない。
In this way, to obtain new coordinates, tanα is simply added each time, and no multiplication is necessary.

また、実際には座標は整数値しか取りえないので、4倍
5人する必要がある。
Also, in reality, coordinates can only take integer values, so it is necessary to multiply by 4 times 5 people.

このように、画像の大きさを最大5倍に拡大するだけで
、高速に画像を回転させることができるが、以上の方法
では、−45’〜+45”以上の角度を回転させること
はできない。しかし、画像を90°単位で回転させる方
法としては、X座標とYi標を交換する手法が知られて
いるので、この技術も応用して回転角度を90’ずつ4
つの範囲に分けて次のような方法で求めることにした。
In this way, the image can be rotated at high speed simply by enlarging the image size up to 5 times, but with the above method, it is not possible to rotate the image by an angle greater than -45' to +45''. However, as a method for rotating an image in 90° increments, there is a known method of exchanging the X coordinate and Yi mark, so this technique can also be applied to rotate the image in 90° increments of 4.
I decided to divide it into two ranges and calculate it using the following method.

回転角αが45°から135゛のときは1/sinα 
が1から5の範囲であるので、画像を1/sinα倍と
することにした。そのときの座標(xx、 Yz)は次
のようになる。
When the rotation angle α is 45° to 135°, 1/sin α
is in the range of 1 to 5, so it was decided to multiply the image by 1/sin α. The coordinates (xx, Yz) at that time are as follows.

Y座標を固定してX座標を1つ増加する毎に、新座標で
はY座標を1つずつ増加し、X座標はtan(90’−
α)ずつ増加する。
Every time the Y coordinate is fixed and the X coordinate is increased by 1, the Y coordinate is increased by 1 at the new coordinate, and the X coordinate is tan (90'-
α) increases.

次の行の先頭の座標(元座標のY座標が減少)は、前の
行の先頭の座標に対してX座標を1つ大きくし、Y座標
はtan(90°−α)だけ減少する。
For the coordinates of the beginning of the next row (the Y coordinate of the original coordinates is decreased), the X coordinate is increased by one compared to the coordinates of the beginning of the previous row, and the Y coordinate is decreased by tan (90°-α).

回転角αが135°から225°のときは、1/cos
α が1から5の範囲であるので、画像は一1/cos
α倍する。そのときの座標(X2゜Y2)は次のように
なる。
When the rotation angle α is from 135° to 225°, 1/cos
Since α ranges from 1 to 5, the image is 1/cos
Multiply by α. The coordinates (X2°Y2) at that time are as follows.

さらに、回転角αが225°から315° (45’ 
) 1jHIili、  1/5incz  が1から
 Hの範囲であるので、画像を一17sinα倍する。
Furthermore, the rotation angle α is from 225° to 315° (45'
) 1jHIili, 1/5incz ranges from 1 to H, so multiply the image by -17 sin α.

そのときの座標(X2. Yz)は次のようになる。The coordinates (X2. Yz) at that time are as follows.

このような手法を採用することによって、360゜いず
れの角度にも回転することができる。
By employing such a method, it is possible to rotate to any angle of 360 degrees.

第3図に回転角αに対して画像を何倍にするのかを示し
である。
FIG. 3 shows how many times the image is multiplied with respect to the rotation angle α.

実際にプログラムを組む場合には、テーブルとしてta
n O°〜tan45°までを作るので、次の式の変換
係数A、B、C,Dを第4図のようにし、αの範囲を4
5°ずつ8つの範囲に分解することになる。
When actually programming, use ta as a table.
Since we are creating a range from n O° to tan45°, we set the conversion coefficients A, B, C, and D in the following equation as shown in Figure 4, and set the range of α to 4.
It is divided into eight ranges of 5° each.

要するに、上記目的は、画像の回転を行うために、元画
素の座標をx、y、新座標の座標をX2゜Y2として、 X2=A−X+B−Y、Y2=C−X+D−Yの変換式
を設定し1回転角度を少なくとも4種類に分割して、分
割数に等しい変換係数の種類を設定し、回転後の画像が
回転前の画像よりも長さで1〜5倍に拡大することを許
容することにより、4個の変換係数A、B、C,Dのう
ちの2個を±1とすることにより、高速に回転処理を行
う手段を設けて達成するようにした。
In short, the above purpose is to rotate the image by converting X2=A-X+B-Y, Y2=C-X+D-Y, where the original pixel coordinates are x, y and the new coordinates are X2°Y2. Set a formula, divide one rotation angle into at least 4 types, set a type of conversion coefficient equal to the number of divisions, and enlarge the image after rotation by 1 to 5 times in length than the image before rotation. By allowing , two of the four conversion coefficients A, B, C, and D are set to ±1, thereby achieving this by providing means for performing rotation processing at high speed.

〔作用〕[Effect]

第4図を見ると、A、DかB、Cのどちらかの絶対値が
必ず1となっている。このことは、もとの画像でY座標
を固定してX座標を1つずつ増加する1行の走査のとき
は、求める座標の一方は1ずつ増加すればよく、他方は
ある一定の量だけ変化すればよいことをしめしている。
Looking at FIG. 4, the absolute value of either A, D or B, C is always 1. This means that when scanning a single line in which the Y coordinate is fixed and the X coordinate is increased by 1 in the original image, one of the desired coordinates only needs to be increased by 1, and the other coordinate is increased by a certain amount. It shows us that we need to change.

また、1行の走査を終了し、次の走査の最初の座標をも
とめるときも、前行の最初の点に対して一方の座標を1
ずつ変化し、他方の座標を前と同じ一定の量だけ変化す
ればよいことを示している。
Also, when you finish scanning one line and find the first coordinate of the next scan, set one coordinate to 1 for the first point of the previous line.
This shows that it is only necessary to change the other coordinate by the same fixed amount as before.

この方式は従来の方式と比較して、演算が大幅に簡略化
されている。
This method has greatly simplified calculations compared to conventional methods.

なお、以上の回転は原点を中心に考えたものであるが、
原点以外の点を中心とした回転の場合は、まず、回転の
中心を(0,0)となるように座標変換して、上記の計
算を行えばよい。
Note that the above rotations are based on the origin, but
In the case of rotation around a point other than the origin, the above calculation can be performed by first performing coordinate transformation so that the center of rotation is (0,0).

パターンマツチングの場合は、まず、パターンを切り出
し、切り出した部分だけ回転すればよく。
For pattern matching, all you need to do is cut out the pattern and rotate only the cut out part.

かつ、パターンの相対的位置も問題とならないので、元
画像の走査の開始′点と回転の中心が一致し。
Moreover, since the relative position of the pattern does not matter, the starting point of scanning of the original image coincides with the center of rotation.

かつ、演算は変化量のみを問題としているので、回転の
中心が原点でないことは、実際の演算における問題とは
ならない。
In addition, since the calculation concerns only the amount of change, the fact that the center of rotation is not the origin does not pose a problem in the actual calculation.

ところで、画像処理装置では走査を左上から右へ、1行
ずつ下へ行うことから、横軸をX軸、縦軸をY軸とする
のは同じだが、下に行くとY座標が大きくなる第5図の
形となっている。従って第2図と同じ方向に見るために
は、上下を逆にして。
By the way, since the image processing device scans from the top left to the right and down one line at a time, the horizontal axis is the X axis and the vertical axis is the Y axis, but as you go down, the Y coordinate increases. It has the shape shown in Figure 5. Therefore, to view it in the same direction as Figure 2, turn it upside down.

しかも、裏から見なければならない。Moreover, you have to look at it from behind.

その場合のOの方向は時計回りとなり、第2図とは逆に
なる。
In that case, the direction of O is clockwise, which is opposite to that in FIG.

以上の手法によって、拡大する範囲は5倍以下で36o
°の回転が可能となる。
With the above method, the area to be expanded is 36 degrees or less by 5 times.
Rotation of ° is possible.

このように回転を行った後で、文字などを切り出し、1
6行、16列の2値化パターンに正規化すると、2倍に
拡大した影響は除くことができる。
After rotating in this way, cut out the letters, etc., and
By normalizing to a binary pattern of 6 rows and 16 columns, the effect of doubling can be removed.

なお黒文字の例では、5倍に拡大した場合、黒い部分の
間に白点が発生して、文字が幾分薄くなるので、黒点の
拡大、縮小のフィルタリングを行い、文字の画質を改善
する場合もある。
In addition, in the example of black text, if you enlarge it five times, white dots will appear between the black parts and the text will become a little thinner, so you may want to perform filtering to enlarge or reduce the black dots to improve the image quality of the text. There is also.

〔実施例〕〔Example〕

第1図に本発明を採用する画像処理装置のハードウェア
構成図の1実施例を示す。これは、円筒状の対象物の底
に記入された文字を認識する例について示しである。
FIG. 1 shows an embodiment of a hardware configuration diagram of an image processing apparatus employing the present invention. This is an example of recognizing characters written on the bottom of a cylindrical object.

底に文字を記入された円筒状の対象物14は、照明13
で照明を受け、カメラ11で撮影される。
A cylindrical object 14 with letters written on the bottom is a light 13
It is illuminated by the camera 11 and photographed by the camera 11.

この画像は画像処理装置10で処理され、対象物14の
底に記入された文字を読み取る。
This image is processed by an image processing device 10 to read the characters written on the bottom of the object 14.

A/D変換器101がカメラ11のアナログ出力信号を
ディジタル信号に変換し、セレクタ102に送る。画像
入力時はセレクタ102はA/D変換器101の出力を
選択するので、この信号はルックアップテーブルLUT
 103で2値化され、フィルタ回路104を通って画
像メモリ105に記憶される。
A/D converter 101 converts the analog output signal of camera 11 into a digital signal and sends it to selector 102 . When inputting an image, the selector 102 selects the output of the A/D converter 101, so this signal is sent to the lookup table LUT.
The image is binarized in step 103, passed through a filter circuit 104, and stored in an image memory 105.

この画像は出力回路112から出力され、モニタテレビ
12でモニタされる。
This image is output from the output circuit 112 and monitored on the monitor television 12.

この画像に雑音信号が含まれており、黒点拡大、縮小な
どによりフィルタリングを行う必要がある場合は、画像
メモリ105の画像をセレクタ109 。
If this image contains a noise signal and needs to be filtered by enlarging or reducing black points, the image in the image memory 105 is selected by the selector 109 .

102で選択してルックアンプテーブルLUT103を
通してフィルタ回路104に送る。フィルタ回路104
では3行分の画像メモリを有しており、周囲8点と自分
の画像情報9点のAND。
102 and sends it to the filter circuit 104 through the look amplifier table LUT 103. Filter circuit 104
It has 3 lines of image memory, and ANDs 8 surrounding points and 9 points of your own image information.

OR,FORをとることによって、黒点の膨張。Expand the sunspot by taking OR and FOR.

収縮などの処理を行う。Perform processing such as shrinkage.

このように、画像は画像バス117を通って1回転され
る過程で、種々の処理をうけるので、このループを画像
ループと称する。
In this way, the image undergoes various processes during one rotation through the image bus 117, so this loop is referred to as an image loop.

これらの処理の指令はキーボードに/B 115により
入力し、制御部CPUI 13がメモリ114に記憶さ
れたプログラムに従って行う。
Commands for these processes are inputted to the keyboard via /B 115, and are executed by the control unit CPU 13 according to a program stored in the memory 114.

画像メモリ105の画像は、X軸投影回路110やY軸
投影回路111により得られる投影分布(X軸方向各行
の白点の数、Y軸方向各列の白点の数)によって1文字
の部分が選択されて切り出され1回転処理を受けて画像
メモリ107に記憶される。さらに、文字1個1個が切
り出され、メモリ114に記憶された標準パターンと比
較されて認識される。これらの結果はモニタテレビ12
に表示される。また、必要があれば入出力回路■101
16により他の計算機などに出力される。
The image in the image memory 105 is divided into parts of one character based on the projection distribution (the number of white dots in each row in the X-axis direction, the number of white dots in each column in the Y-axis direction) obtained by the X-axis projection circuit 110 and the Y-axis projection circuit 111. is selected, cut out, subjected to one-rotation processing, and stored in the image memory 107. Furthermore, each character is cut out and compared with a standard pattern stored in memory 114 for recognition. These results are shown on monitor TV 12
will be displayed. In addition, if necessary, input/output circuit■101
16, the data is output to other computers, etc.

アドレス制御回路AC106,108はそれぞれ画像メ
モリ105,107のアドレスの制御を行うものである
Address control circuits AC106 and AC108 control the addresses of image memories 105 and 107, respectively.

このハードウェアを用いて対象物14の底に書かれた文
字を読み取る場合を例にとって以後説明する。
A case in which this hardware is used to read characters written on the bottom of the object 14 will be described below as an example.

2値化された対象物の底の画像20を第6図に示す。2
1が対象物の底の画像であり、26は記入された文字で
ある。その他に回転角度を検出するための正方形のマー
ク24.25が記入されている。先頭のマーク24は後
尾のマーク25より大きく、その1辺の長さは文字の線
幅より長い。
A binarized image 20 of the bottom of the object is shown in FIG. 2
1 is an image of the bottom of the object, and 26 is a written character. In addition, square marks 24 and 25 for detecting the rotation angle are written. The first mark 24 is larger than the last mark 25, and the length of one side thereof is longer than the line width of the character.

22はウィンドウであり、対象物の位置がばらついても
対象物の周囲の線がウィンドウ22の中に入らない程度
に、かつ、文字列がウィンドウ22の外にはみださない
ように設定される。
22 is a window, which is set so that even if the position of the object varies, the line around the object does not fall within the window 22, and the character string does not protrude outside the window 22. Ru.

この後の処理のおもなフローを第7図に示す。The main flow of the subsequent processing is shown in FIG.

まず、200で文字の回転角度を求める。そのためには
、画像20についてフィルタ回路104を利用し、黒点
収縮を行い、画像メモリ107に記憶すると、その像で
は細い文字26が消えて。
First, the rotation angle of the character is determined using 200. To do this, the filter circuit 104 is used to perform black point contraction on the image 20, and the resultant image is stored in the image memory 107, so that the thin characters 26 disappear from the image.

マーク24.25のみが残る。Only marks 24.25 remain.

次に、ウィンドウ22の中の像を捜し、その像に外接す
る長方形を求める。その手法としては、ウィンドウ22
の中の黒点を捜し、その像の輪郭を求め、輪郭の座標の
最大、最小Y座標、最左。
Next, the image in the window 22 is searched and a rectangle circumscribing the image is found. As a method, window 22
Find the black point in , find the outline of the image, and find the maximum and minimum Y coordinates of the outline, and the leftmost coordinate.

最右X*標を求めるなどの手法を用いて実現できる。This can be achieved using a method such as finding the rightmost X* marker.

面積の大きい方の中心座標を(Xa、 Ya)とし。Let the center coordinates of the larger area be (Xa, Ya).

小さい方の中心座標を(X4. Y4)とするとき、X
座標から時計方向に見た文字の回転角度θは次の式によ
り求められる。
When the smaller center coordinate is (X4. Y4),
The rotation angle θ of the character when viewed clockwise from the coordinates is determined by the following formula.

但し、θはOoから180’の範囲とし、Y3−Y4が
負の場合はその結果に180°を加えるものとする。
However, θ is in the range from Oo to 180', and if Y3-Y4 is negative, 180° is added to the result.

この場合、角度を求めているが、計算に使用するのはt
an Oであるので、これをそのまま回転の計算に使用
してもよい。しかし、別の方法で角度を求める場合も考
慮して、ここでは角度を求める方法について述べる。
In this case, we are finding the angle, but the calculation uses t
Since it is an O, it may be used as is for calculation of rotation. However, considering the possibility of finding angles using other methods, a method for finding angles will be described here.

文字の角度が求められたら、次は、第7図のフローの3
00でその角度だけ回転して、文字の位置を正常な方向
に直す。
Once the angle of the character has been determined, the next step is step 3 in the flowchart in Figure 7.
00 rotates by that angle to correct the character position.

文字を回転する場合のより細かいフローを第9図に示す
FIG. 9 shows a more detailed flow for rotating characters.

301では、まず、回転する部分を切り出す。In step 301, first, a rotating portion is cut out.

回転に要する時間は回転する部分に比例するので、不用
な部分を除いてから回転する。
The time required for rotation is proportional to the parts being rotated, so remove unnecessary parts before rotating.

そこで、画像メモリ105のウィンドウ22の部分のX
軸方向投影分布とY軸方向投影分布を求め、黒点が存在
する範囲に第10図に示すようにウィンドウ23を設定
する。
Therefore, the X of the window 22 portion of the image memory 105 is
The axial projection distribution and the Y-axis projection distribution are determined, and a window 23 is set as shown in FIG. 10 in the range where the black dot exists.

この場合文字26の他にマーク24.25まで含めて回
転することになるが、その程度の無駄はしかたがない。
In this case, in addition to the character 26, marks 24 and 25 will also be rotated, but such a wasteful amount cannot be helped.

次に、302でウィンドウ23の左上の点の座標をXs
、Ysとし、その幅をXa、Ydとすることによりウィ
ンドウ23の座標を求める。
Next, at 302, the coordinates of the upper left point of the window 23 are set to
, Ys, and the widths are Xa and Yd to find the coordinates of the window 23.

303でマーク24.25の位置を求めるために利用し
た画像メモリ107の画像をクリアし、回転した画像を
記録できるように準備する。
In step 303, the image in the image memory 107 used to find the position of the marks 24 and 25 is cleared, and preparations are made to record the rotated image.

304で回転すべき角度α(200で求めた0が一αに
等しい)の範囲から、第4図のテーブルを利用して係数
A、B、C,Dを求める。以下角度αが00〜45°の
範囲にあると仮定して説明する。
From the range of angle α to be rotated at 304 (0 determined at 200 is equal to 1 α), coefficients A, B, C, and D are determined using the table shown in FIG. The following description will be made assuming that the angle α is in the range of 00 to 45 degrees.

つまり、次の式で回転すると仮定する。In other words, assume that it rotates according to the following formula.

305で画像メモリ105の中のウィンドウ23を回転
して、画像メモリ107に記録する。
In step 305, the window 23 in the image memory 105 is rotated and recorded in the image memory 107.

そのために、画像メモリ105を読み出しモード、画像
メモリ107を書き込みモードとして、データを画像ル
ープで回転する。この手法により画像メモリ105の元
画像のアドレスA。の情報が画像メモリ107の新画像
のアドレスA、に移される。それぞれのアドレスはアド
レス制御回路AC106と108で制御される。
For this purpose, the image memory 105 is set to read mode and the image memory 107 is set to write mode, and the data is rotated in an image loop. By this method, the address A of the original image in the image memory 105 is obtained. information is moved to address A of the new image in the image memory 107. Each address is controlled by address control circuits AC106 and AC108.

カメラ11より取り込まれる画像の画素数が256X2
56の場合、画像メモリのアドレスは左上の原点を0と
し、走査方向に画素毎に1つずつ増える。1行分が8ビ
ツトであり、9ビツト以上が行数を表すが、行数も25
6行であるので、8ビツトとなる。従って、8ビツトの
レジスタを2個用いて、X軸アドレス、Y軸アドレスと
することができる。以後、アドレスAoは(Xo、Yo
)、アドレスA0は(xn、y、)のように表す。
The number of pixels of the image captured from camera 11 is 256x2
In the case of 56, the address of the image memory takes the origin at the upper left as 0 and increases by 1 for each pixel in the scanning direction. One line is 8 bits, and 9 or more bits represent the number of lines, but the number of lines is also 25.
Since there are 6 lines, there are 8 bits. Therefore, two 8-bit registers can be used to provide an X-axis address and a Y-axis address. From now on, the address Ao is (Xo, Yo
), address A0 is expressed as (xn, y,).

回転処理部のフローを第11図に示す。FIG. 11 shows the flow of the rotation processing section.

まず400で、X o = X s 、 Y o = 
Y s、かつ。
First, at 400, X o = X s , Y o =
Ys, and.

Xo”xs、Yo=Ysと初期値を設定する。Set the initial values as Xo”xs and Yo=Ys.

401で元画像のアドレスはXoを1つずつ増加し、Y
oは一定とし、402でこれをXd回繰り返す。新画像
のアドレスはこれと同期して変化するが、Xoは1つず
つ増加し、Y、はtan Oずつ増加する。ただし、実
際のアドレスは整数であるので、Ynの値を四捨五入し
た値をアドレスとする。これで1行分を回転することが
できる。
In 401, the address of the original image increases Xo by 1, and Y
o is kept constant, and this is repeated Xd times in 402. The address of the new image changes in synchronization with this, but Xo increases by 1 and Y increases by tan O. However, since the actual address is an integer, the value obtained by rounding off the value of Yn is used as the address. This allows you to rotate one line.

次に、次の1行を回転する。そのためには前の行の先頭
アドレス値を記憶しておく必要があるので、元画像のア
ドレスをXO’IYO’+新画像のアドレスをXn’r
yn′ とすると、1行目の先頭アドレスは次のとおり
である。Xo’ = Xs、 Y。
Next, rotate the next row. To do this, it is necessary to remember the start address value of the previous line, so the address of the original image is XO'IYO' + the address of the new image is Xn'r.
yn', the start address of the first line is as follows. Xo' = Xs, Y.

=Ys、Xn′=xs′、Yn=Ys 403で2行目の先頭アドレスは元画像については、Y
oは1つずつ増加させ、Xoは−tan Oずつ加算す
る。この先頭アドレスは次の行の先頭アドレスの計算に
用いるので記憶しておき、この値を元画像のアドレスA
oと新画像のアドレスAnに代入するため次のようにす
る。X o ” X o ’Yo=Yo′、Xn=X1
1′、Yn=Yn′また、Xo を四捨五入した値をア
ドレスとする。
=Ys, Xn'=xs', Yn=Ys In 403, the start address of the second line is Y for the original image.
o is incremented by 1, and Xo is incremented by -tan O. This start address will be used to calculate the start address of the next line, so remember it and set this value to the address A of the original image.
In order to substitute o and the address An of the new image, do the following. X o ” X o 'Yo=Yo', Xn=X1
1', Yn=Yn' Also, the address is the value obtained by rounding off Xo.

この先頭アドレスを基準にして、1行の回転を行う。Rotation of one line is performed based on this first address.

404で401から403の動作をYd回繰り返すとウ
ィンドウ23の回転が終了する。
When the operations from 401 to 403 are repeated Yd times in 404, the rotation of the window 23 is completed.

以上の説明はαがOo〜45″のときであるが、αが4
5°〜90’の場合は次の式で回転する。
The above explanation applies when α is Oo ~ 45'', but α is 4
In the case of 5° to 90', rotation is performed using the following formula.

このときの処理は401に示した式のうちX。。The processing at this time is X in the formula shown in 401. .

Yoは変わらないが、X、はtan(90’ −a)を
加算し、Ynは1を加算するように変える。また、40
3はX6’HYo’は変わらず、Xn′  は1を減算
し、Yn′ はtan(90” −a)を加算する。
Yo remains unchanged, but changes are made such that tan (90'-a) is added to X and Yn is added by 1. Also, 40
3, X6'HYo' remains unchanged, Xn' subtracts 1, and Yn' adds tan(90''-a).

αが他の範囲の場合も401と403の式を第4図の表
に従って変えれば対応することができる。
Other ranges of α can also be accommodated by changing the equations 401 and 403 according to the table in FIG.

この場合、アドレス変更にあたって、1増加や1減少は
特願昭58−9874号に示されるようなアップカウン
タ、ダウンカウンタをアドレス制御回路AC106,1
08の中に含むことにより、非常に短時間に処理するこ
とができる。従って、401 。
In this case, when changing the address, incrementing or decrementing the address by 1 uses an up counter or a down counter as shown in Japanese Patent Application No. 58-9874.
By including it in 08, it can be processed in a very short time. Therefore, 401.

403に於いてjanα 等の実数を加算するのが、α
のどの範囲でもそれぞれ1個のみにするのができるのは
、画像が最大5倍になることを許した効果が表れている
と言える。
In step 403, adding real numbers such as janα is α
The fact that it is possible to have only one image in each area can be said to reflect the effect of allowing the image to be multiplied up to five times.

これに対して、(3)式を用いる従来の方式では、X座
標、Y座標とも、sinα、 CO8α等の実数を加算
する必要がある。
On the other hand, in the conventional method using equation (3), it is necessary to add real numbers such as sinα and CO8α to both the X and Y coordinates.

このように文字の回転が終了したので、次に500でパ
ターンマツチングを行う。
Since the rotation of the characters has been completed in this way, pattern matching is then performed in step 500.

そのためには、まず1文字を切り出す。文字の切り出し
の方法としては、マークの切り出しと同様輪郭から求め
ればよい。次に切り出した画像を16ドツl−X 16
ドツトに正規化して、メモリ114に記憶されている標
準パターンとのマツチングを行って、文字を認識する。
To do this, first cut out one character. As for the method of cutting out characters, it is possible to find out from the contours as in the case of cutting out marks. Next, cut out the image by 16 dots l-X 16
The characters are normalized to dots and matched with a standard pattern stored in the memory 114 to recognize the characters.

16ドツト×16ドツトに正規化する処理によって、文
字が回転角度によって1〜5倍と異なった倍率に拡大さ
れる欠点が問題なくなる。
The normalization process to 16 dots x 16 dots eliminates the problem that characters are enlarged to different magnifications from 1 to 5 times depending on the rotation angle.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、カメラにより斜めに取り込まれた文字
等を回転し、正常な方向に戻して認識する場合に、アド
レス制御回路にアップカウンタ、ダウンカウンタを含む
ことにより、文字等の回転を高速に行うことができる。
According to the present invention, when characters, etc. captured diagonally by a camera are rotated and then returned to the normal direction for recognition, the address control circuit includes an up counter and a down counter, so that the characters, etc. can be rotated at high speed. can be done.

この場合に、文字等の回転角度によって1〜2倍に拡大
される欠点があるが、16ドツト×16ドツト等に正規
化する使用法では、問題なくなる。
In this case, there is a drawback that the characters are enlarged by a factor of 1 to 2 depending on the rotation angle of the characters, but there is no problem if the characters are normalized to 16 dots x 16 dots or the like.

従って、本発明は、回転して入力された文字等の認識に
採用すると、効果が大きい。
Therefore, the present invention is highly effective when adopted for recognizing rotated input characters.

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

第1図は本発明の画像処理装置の一実施例を示すハード
ウェア構成図、第2図、第3図はそれぞれ像回転の理論
を説明するための図、第4図は回転角と係数の関係を示
す図、第5図は画像処理装置における座標の表現法を示
す図、第6図は対象物の像を示す図、第7図は本発明に
おける主たるフローの一実施例を示すフローチャーI・
、第8図は回転角の検出法を示す図、第9図、第11図
はそれぞれ第7図の300、第9図の305の−実施例
を示すフローチャート、第10図は回転部分の切り出し
法を示す図である。 10・・・画像処理装置、11・・・カメラ、12・・
・モニタテレビ、13・・・照明、14・・・対象物、
20・・・2値化画像、21・・・対象物の底の画像、
22.23・・・ウィンドウ、24.25・・・マーク
、26・・・文字、101・A/D変換器、102,1
09−f!レクタ、103・・・ルックアップテーブル
LUT、104・・・フィルタ回路、105,107・
・・画像メモリ、106.108・・・アドレス制御回
路AC,110・・X軸投影回路、111・・・Y軸投
影回路、112・・出力回路、113・・・制御回路C
PU、114・・メモリ、115・・・キーボードに/
B、116・・・入出力回路I10゜
FIG. 1 is a hardware configuration diagram showing an embodiment of the image processing device of the present invention, FIGS. 2 and 3 are diagrams for explaining the theory of image rotation, and FIG. 4 is a diagram showing the rotation angle and coefficients. 5 is a diagram showing the method of expressing coordinates in an image processing device, FIG. 6 is a diagram showing an image of an object, and FIG. 7 is a flowchart showing an embodiment of the main flow in the present invention. I.
, FIG. 8 is a diagram showing a rotation angle detection method, FIGS. 9 and 11 are flowcharts showing examples of 300 in FIG. 7 and 305 in FIG. 9, respectively, and FIG. FIG. 10... Image processing device, 11... Camera, 12...
・Monitor TV, 13...Lighting, 14...Object,
20... Binarized image, 21... Image of the bottom of the object,
22.23...Window, 24.25...Mark, 26...Character, 101・A/D converter, 102,1
09-f! Rector, 103... Lookup table LUT, 104... Filter circuit, 105, 107...
...Image memory, 106.108...Address control circuit AC, 110...X-axis projection circuit, 111...Y-axis projection circuit, 112...Output circuit, 113...Control circuit C
PU, 114...Memory, 115...Keyboard/
B, 116... Input/output circuit I10°

Claims (3)

【特許請求の範囲】[Claims] 1.対象物の画像をカメラ等で取り込み、2値化して画
像処理を行う複数の画像メモリと複数の画像メモリ用ア
ドレス制御回路を備え、該各アドレス制御回路はメモリ
アクセスと同時にx座標とY座標の1加算または1減算
をすることも可能で、装置全体を制御する制御回路と、
該制御回路のためのプログラムを記憶するメモリを有す
るものにおいて、前記画像の回転を行うために、元画素
の座標をX,Y、新座標の座標をX_2,Y_2として
、 X_2=AX+BY,Y_2=CX+DY の変換式を設定し、回転角度を少なくとも4種類に分割
して分割数に等しい変換係数の種類を設定し、回転後の
画像が回転前の画像よりも長さで(1〜√2)倍に拡大
することを許容することにより、4個の変換係数A,B
,C,Dのうちの2個を±1とすることにより高速に回
転処理する手段を具備することを特徴とする画像処理装
置。
1. It is equipped with a plurality of image memories and a plurality of image memory address control circuits that capture an image of an object with a camera, etc., binarize it, and perform image processing. It is also possible to add 1 or subtract 1, and there is a control circuit that controls the entire device,
In a device having a memory for storing a program for the control circuit, in order to rotate the image, let the coordinates of the original pixel be X, Y and the coordinates of the new coordinates be X_2, Y_2, X_2=AX+BY, Y_2= Set the conversion formula of CX+DY, divide the rotation angle into at least 4 types, set the type of conversion coefficient equal to the number of divisions, and make sure that the image after rotation is longer than the image before rotation (1 to √2). By allowing the expansion by a factor of two, the four conversion coefficients A, B
, C, and D are set to ±1 to perform rotation processing at high speed.
2.回転した画像から文字等を切り出し、16ドツト×
16ドツトなどの決まつた画素数に正規化してパターン
を求め、該パターンをメモリ記憶されている標準パター
ンと比較して認識する特許請求の範囲第1項記載の画像
処理装置。
2. Cut out characters etc. from the rotated image and print 16 dots
2. The image processing apparatus according to claim 1, wherein a pattern is obtained by normalizing to a predetermined number of pixels, such as 16 dots, and the pattern is recognized by comparing it with a standard pattern stored in a memory.
3.フイルタ回路を有し、黒点拡大や縮少などのフイル
タリングにより回転した画像の画質を改善するようにす
る特許請求の範囲第1項記載の画像処理装置。
3. 2. The image processing device according to claim 1, which includes a filter circuit and improves the image quality of the rotated image by filtering such as black point enlargement or reduction.
JP63320256A 1988-12-19 1988-12-19 Picture processor Pending JPH02165288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63320256A JPH02165288A (en) 1988-12-19 1988-12-19 Picture processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63320256A JPH02165288A (en) 1988-12-19 1988-12-19 Picture processor

Publications (1)

Publication Number Publication Date
JPH02165288A true JPH02165288A (en) 1990-06-26

Family

ID=18119471

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63320256A Pending JPH02165288A (en) 1988-12-19 1988-12-19 Picture processor

Country Status (1)

Country Link
JP (1) JPH02165288A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04233670A (en) * 1990-12-28 1992-08-21 Omron Corp Picture processor
JPH0528321A (en) * 1991-07-19 1993-02-05 Hitachi Ltd Image recognition method and image recognition system
JPH0652137A (en) * 1992-07-31 1994-02-25 Nippon Steel Corp Pattern classification device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04233670A (en) * 1990-12-28 1992-08-21 Omron Corp Picture processor
JPH0528321A (en) * 1991-07-19 1993-02-05 Hitachi Ltd Image recognition method and image recognition system
JPH0652137A (en) * 1992-07-31 1994-02-25 Nippon Steel Corp Pattern classification device

Similar Documents

Publication Publication Date Title
US5129014A (en) Image registration
EP0431958B1 (en) Identification and segmentation of finely textured and solid regions of binary images
Jiang et al. A fast approach to the detection and correction of skew documents
JPS60167069A (en) Pattern recognizer
US6327393B1 (en) Method and apparatus to transform a region within a digital image using a deformable window
JPH02165288A (en) Picture processor
KR940006918B1 (en) Method and system for filling contours in digital typefaces
US4903315A (en) Apparatus for enlarging or reducing an image pattern
JP2000076378A (en) Character recognizing method
JPH0391877A (en) Picture processing device
JPH0765108A (en) Form image processing device
JPH09135331A (en) Image processing device
JPH09120430A (en) Image processing device
JPH0266681A (en) Drawing processor
Shoji An algorithm for affine transformation of binary images stored in pxy tables by run format
JP3037504B2 (en) Image processing method and apparatus
JPH05151350A (en) Image data position distortion correction method
JPH07160811A (en) Character recognition device
KR950005536B1 (en) Method for image rotation
EP0428795A1 (en) Binary image thinning and feature extracting method and processing device thereof
CN116469105A (en) Image recognition method, device, computer equipment, and computer-readable storage medium
JPH06325206A (en) Image display device
JPH06131452A (en) Image data position distortion correction method
JPS61282973A (en) Image processing method
JP2021152836A (en) Image processing device, image processing method and program