JPH01246677A - Segment length simplified calculation system - Google Patents
Segment length simplified calculation systemInfo
- Publication number
- JPH01246677A JPH01246677A JP63075318A JP7531888A JPH01246677A JP H01246677 A JPH01246677 A JP H01246677A JP 63075318 A JP63075318 A JP 63075318A JP 7531888 A JP7531888 A JP 7531888A JP H01246677 A JPH01246677 A JP H01246677A
- Authority
- JP
- Japan
- Prior art keywords
- line segment
- segment length
- axis
- square root
- absolute value
- 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
Links
- 238000004364 calculation method Methods 0.000 title claims description 26
- 239000013598 vector Substances 0.000 claims abstract description 26
- 238000010606 normalization Methods 0.000 claims description 15
- 238000000034 method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
Description
【発明の詳細な説明】
A、産業上の利用分野
本発明は、イメージスキャナ等の入力装置で文字や図形
のパターンを認識する際に線分ベクトルを演算する方式
に関し、特に、線分ベクトルの長さを演算する線分長簡
易計算方式に関する。DETAILED DESCRIPTION OF THE INVENTION A. Field of Industrial Application The present invention relates to a method for calculating line segment vectors when recognizing character or graphic patterns using an input device such as an image scanner, and in particular to a method for calculating line segment vectors. This paper relates to a simple line segment length calculation method for calculating length.
B1発明の概要
本発明は、イメージスキャナ等の入力装置で文字や図形
のパターンを認識する際に線分ベクトルの長さを演算す
る線分長簡易計算方式において、予め算定した平方根デ
ータをm X m gのテーブルで格納する基準線分長
テーブルメモリと、線分ベクトルのX軸及びy軸の座標
差の絶対値を前記基準線公民テーブルの分割数に対応さ
せる正規化係数の演算手段と、その正規化係数で前記X
軸及びy軸の座標差絶対値を除算して得た各方向基準値
により前記基準線分長テーブルを対照する手段とを備え
、基準線分長テーブルメモリ内から採択した平方根デー
タに前記正規化係数を乗することにより、線分ベクトル
の長さと方向の演算のうち、特に線分長の演算方法を改
善し、精度のよい平方根の近似計算を行う技術を開示す
るものである。B1 Summary of the Invention The present invention uses pre-calculated square root data as m a reference line segment length table memory stored in a table of m to g, and a normalization coefficient calculation means for making the absolute value of the coordinate difference between the X axis and the y axis of the line segment vector correspond to the number of divisions of the reference line civil table; With that normalization coefficient,
means for comparing the reference line segment length table with each direction reference value obtained by dividing the absolute value of the coordinate difference between the axes and the y-axis, and normalizing the reference line segment length table to the square root data adopted from the reference line segment length table memory. The present invention discloses a technique for improving the method of calculating the length and direction of a line segment vector, especially the line segment length, by multiplying by a coefficient, and performing an accurate approximation calculation of the square root.
C3従来の技術
文字や図形等のパターンを認識する場合、2つの座標点
を結ぶ線分ベクトルは、その長さと方向を特徴量として
取り扱うのが通常である。例えば書類や図面等をイメー
ジスキャナ等の入力装置で走査して得られる黒と白の2
値画像データについて、文字や図形の輪郭に沿った線分
ベクトル系列を用いて論じることが多く、その場合、線
分ベクトルの数だけの長さと方向の演算が必要となる。C3 Conventional technology When recognizing patterns such as characters and figures, the length and direction of a line segment vector connecting two coordinate points are usually treated as feature quantities. For example, black and white images obtained by scanning documents, drawings, etc. with an input device such as an image scanner
Value image data is often discussed using a series of line segment vectors along the contours of characters or figures, and in that case, it is necessary to calculate the length and direction as many as the number of line segment vectors.
第3図に示す如く、座標点A(xs、ys)を始点とし
、座標点B(xeSye)を終点とする線分ベクトルの
長さa及び方向θは、次のように求めることができる。As shown in FIG. 3, the length a and direction θ of a line segment vector starting from coordinate point A (xs, ys) and ending at coordinate point B (xeSye) can be determined as follows.
上記0式のような平方根やアークタンゼントの計算は複
雑でメインプロセッサの演算量が大きなものとなるため
、通常は、メインプロセッサ以外に浮動少数点演算器の
ような副プロセツサを補助的に用いて、メインプロセッ
サにかかる演算量の負担を軽減し、同時に処理速度を速
くする方法がとられている。Calculations of square roots and arctangents such as the above equation 0 are complex and require a large amount of calculation on the main processor, so usually a sub-processor such as a floating-point arithmetic unit is used as an auxiliary processor in addition to the main processor. Therefore, methods are being used to reduce the computational burden on the main processor and at the same time increase processing speed.
D0発明が解決しようとする課題
しかし、副プロセツサを用いることはコストを高め、装
置を大型化し、システムの普及を妨げることになる。従
って、あらゆるランクのマシンに副プロセツサを使用す
るとは限らない現状であるが、副プロセツサが配置され
ていない場合には、演算に対するメインプロセッサの負
担が大きいものとなる。D0 Problems to be Solved by the Invention However, the use of a sub-processor increases costs, increases the size of the device, and impedes the spread of the system. Therefore, although sub-processors are not always used in machines of all ranks, if a sub-processor is not provided, the load on the main processor for calculations will be heavy.
一般に、文字や図形の輪郭ベクトルのような例ではベク
トルの数が多く、演算がそれに比例して大きくなるため
、副プロセツサがない場合には、平方根演算やアークタ
ンゼント計算をしなくてもよいような精度のよい近似計
算をするなどして、メインプロセッサの負担を軽減し、
処理を高速化する工夫が必要である。Generally, in cases such as contour vectors of characters or figures, there are many vectors, and the calculations become proportionally larger, so if there is no subprocessor, there is no need to perform square root calculations or arctangent calculations. Reduce the burden on the main processor by performing highly accurate approximate calculations such as
It is necessary to devise ways to speed up the processing.
線分ベク゛トルの長さに関する近似計算の一例を次に示
す。An example of approximate calculation regarding the length of a line segment vector is shown below.
次式は、線分ベクトルの長さと座標点の関係を表すもの
である。The following equation represents the relationship between the length of the line segment vector and the coordinate point.
Q≦1xe−xsl+lye ysi−・・■局所的
な領域を論することの多い画像処理に際しては、始点と
終点が接近している場合にのみ、この式に基づいて、
Q=lxe−xsl+lye ysl −−■の如
く、左辺と右辺を等価的に扱う場合があり、演算が簡単
で誤差も許容範囲内として扱うことが多いが、この0式
では、始点と終点が離れている場合には、(2n−1)
π/4に近付くほど誤差が大きいことは明白で、許容範
囲を越えていて、精度はまったく保証できないものとな
る。Q≦1xe-xsl+lye ysi-...■In image processing that often deals with local areas, based on this formula, only when the starting point and end point are close, Q=lxe-xsl+lye ysl - In some cases, as in -■, the left and right sides are treated as equivalent, and the calculation is simple and the error is often treated as within an allowable range. However, in this 0 formula, if the starting point and the ending point are far apart, ( 2n-1)
It is obvious that the closer it gets to π/4, the larger the error is, which is beyond the allowable range, and the accuracy cannot be guaranteed at all.
本発明は、このような課題に鑑みて創案されたもので、
線分ベクトルの長さと方向の演算方法のうち、特に長さ
の演算方法を改善し、精度のよい平方根の近似計算を行
う線分長簡易計算方式を提供することを目的としている
。The present invention was created in view of these problems, and
Among the methods of calculating the length and direction of line segment vectors, the purpose of this invention is to improve the method of calculating length in particular, and to provide a simple line segment length calculation method that performs accurate square root approximation calculations.
91課題を解決するための手段
本発明において、上記の課題を解決するための手段は、
互いに直交するX軸及びy軸座標上の線分長を計算する
線分長簡易計算方式において、予め算定した平方根デー
タをm x m個のテーブルで格納する基準線分長テー
ブルメモリと、線分ベクトルのX軸及びy軸の座標差の
絶対値を前記基準線分長テーブルの分割数に対応させる
正規化係数の演算手段と、その正規化係数で前記X軸及
びy軸の座標差絶対値を除算して得た各方向基準値によ
り前記基準線分長テーブルを対照する手段とを備え、基
部線分長テーブルメモリ内から採択した平方根データに
前記正規化係数を乗することにより線分ベクトルの線分
長を得る線分長簡易計算方式によるものとする。91 Means for Solving the Problems In the present invention, the means for solving the above problems are as follows:
In the line segment length simple calculation method that calculates line segment lengths on X-axis and y-axis coordinates that are orthogonal to each other, there is a reference line segment length table memory that stores square root data calculated in advance in m x m tables, and a line segment length table memory that stores square root data calculated in advance in m x m tables. means for calculating a normalization coefficient that makes the absolute value of the coordinate difference between the X-axis and the y-axis of the vector correspond to the number of divisions of the reference line segment length table; means for comparing the reference line segment length table with each direction reference value obtained by dividing the base line segment length table, and multiplying the square root data adopted from the base line segment length table memory by the normalization coefficient to obtain a line segment vector. A simple line segment length calculation method is used to obtain the line segment length.
F1作用
本発明は、平方根データを予めテーブル化し、そのテー
ブルに線分ベクトルのX軸及びy軸の座標差の絶対値を
対応させるため正規化係数を設定し、この正規化係数を
演算する手段と正規化係数によりテーブル両軸の方向基
準値を演算する手段とを設け、方向基準値によって平方
根データを検索し、その値に前記正規化係数を乗じて線
分長を得るものである。F1 action The present invention is a means for preparing a table of square root data in advance, setting a normalization coefficient in order to make the absolute value of the coordinate difference between the X-axis and y-axis of a line segment vector correspond to the table, and calculating this normalization coefficient. and means for calculating direction reference values for both axes of the table using a normalization coefficient, search for square root data using the direction reference value, and multiplying the square root data by the normalization coefficient to obtain a line segment length.
G、実施例
以下、図面を参照して、本発明の実施例を詳細に説明す
る。G. Embodiments Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
第1図は、本発明を実施した線分長簡易計算装置の一例
を示す構成図である。第1図において、lはX方向差分
演算器、2はy方向差分演算器、3はX方向絶対値演算
器、4はX方向絶対値演算器、5はX方向の正規化係数
Kxを算出するX方向係数演算器、6はy方向の正規化
係数Kyを算出するy方向係数演算器、7は両係数の大
きい方を採択する最大値比較器、8は線分長を演算する
線分長さ演算器、9は基準線分長テーブルメモリである
。基準線分長テーブルメモリ9は、平方根を予め求めて
整数化した値を、第2図に示す如くm x m個のテー
ブルとして格納したもので、本発明は、この基準線分長
テーブルメモリ9を用いて線分ベクトルの長さQを下記
の如く求める。FIG. 1 is a block diagram showing an example of a simple line segment length calculation device embodying the present invention. In Figure 1, l is an X-direction difference calculator, 2 is a y-direction difference calculator, 3 is an X-direction absolute value calculator, 4 is an X-direction absolute value calculator, and 5 calculates the normalization coefficient Kx in the X-direction. 6 is a y-direction coefficient calculator that calculates the normalization coefficient Ky in the y-direction, 7 is a maximum value comparator that selects the larger of both coefficients, and 8 is a line segment that calculates the line segment length. The length calculator 9 is a reference line segment length table memory. The reference line segment length table memory 9 stores values obtained by calculating square roots in advance and converting them into integers as m x m tables as shown in FIG. The length Q of the line segment vector is determined using the following equation.
まず、線分の始点A(xs、ys)及び終点B(xeS
ye)が与えられると、それらのX成分(xe%xs)
はX方向差分演算器1に入力されy成分(ye、ys)
はy方向差分演算器2に入力される。First, start point A (xs, ys) and end point B (xeS
ye) are given, their X components (xe%xs)
is input to the X-direction difference calculator 1 and the y component (ye, ys)
is input to the y-direction difference calculator 2.
差分演算器l及び2は線分ベクトルの終点と始点の座標
差をX軸及びy軸それぞれについて演算し、X軸及びy
軸の絶対値演算器3.4は座標差の絶対値1xe−xs
l、lye yslを出力する。Difference calculators l and 2 calculate the coordinate difference between the end point and the start point of the line segment vector for the X-axis and the y-axis, respectively, and
The axis absolute value calculator 3.4 calculates the absolute value of the coordinate difference 1xe-xs
Output l, lye ysl.
正規化係数には、線分ベクトルのX軸及びy軸の座標差
絶対値を基準線分長テーブル9の分割数に対応させるも
ので、そのベクトルの長さにより基め線分長テーブル9
のどの位置のデータを取り出せばよいかを決めるため、
テーブル空間に正規化するための係数である。Kは自然
数で、下記のように求められる。The normalization coefficient is used to make the absolute value of the coordinate difference between the X-axis and y-axis of a line segment vector correspond to the number of divisions in the reference line segment length table 9, and depending on the length of the vector, the reference line segment length table 9
In order to decide which position of the data should be retrieved,
This is a coefficient for normalizing to table space. K is a natural number and is determined as follows.
K=max(l xe−xs l/m+1゜l ye−
ys l/m+1)−■
本実施例では、X方向の正規化係数KxをX方向係数演
算器5により、
Kx−1xe−xs l/m+1
として算出し、y方向の正規化係数Kyをy方向係数演
算器6により、
Ky= i ye−ys l/rn 工 1
として算出して、それらを最大値比較器7により比較し
、両係数の大きい方を採択する。K=max(l xe-xs l/m+1゜l ye-
ys l/m+1)-■ In this embodiment, the X-direction normalization coefficient Kx is calculated by the X-direction coefficient calculator 5 as Kx-1xe-xs l/m+1, and the y-direction normalization coefficient Ky is calculated as By the coefficient calculator 6, Ky= i ye-ys l/rn engineering 1
They are compared by the maximum value comparator 7, and the larger of both coefficients is selected.
このとき、テーブル横軸のX方向基準値i及び縦軸のy
方向基準値jをKに基づいて次のように求める。At this time, the reference value i in the X direction on the horizontal axis of the table and y on the vertical axis
The direction reference value j is determined based on K as follows.
ここでi、jは正の整数で、0≦i≦m−1,0≦J≦
m−1である。Here, i and j are positive integers, 0≦i≦m-1, 0≦J≦
It is m-1.
線分長さ演算器8は、このi、jにより基孕線分長テー
ブル9の(i、j)位置にある値Ci、jを選択すると
、長さQを下記の如く演算する。When the line segment length calculator 8 selects the value Ci, j at the (i, j) position of the basic line segment length table 9 based on these i, j, the line segment length calculator 8 calculates the length Q as follows.
Q=に−・C1,j ・・・・・・・・・■
このようにして、本発明は線分ベクトルの長さQを簡単
に求めることができる。Q=ni-・C1,j ・・・・・・・・・■
In this way, the present invention can easily determine the length Q of the line segment vector.
因みに本方式における演算誤差を評価すると、最大でも
、((テーブルのある位置における値と隣合う数値の差
)x(k−1))の範囲内にある程度である。Incidentally, when evaluating the calculation error in this method, at most it is within the range of ((difference between a value at a certain position in the table and an adjacent numerical value) x (k-1)).
例えば、線分の始点Aが(!0.12)、終点Bが(6
L30.)のとき、線分長は54.08(小数点3位以
下4捨5人)となるが、本発明の方式によればに=4.
1=12、j=4となり、52という長さが得られて、
その誤差はたかだか2.08である。そして、基準線分
長テーブルの刻みを第2図の例より細かくとった実数デ
ータを与えれば、その誤差は一層小さなものとなる。For example, the starting point A of the line segment is (!0.12) and the ending point B is (6
L30. ), the line segment length is 54.08 (5 digits to the 4th decimal place), but according to the method of the present invention, = 4.
1=12, j=4, and a length of 52 is obtained,
The error is at most 2.08. If real number data is provided in which the increments of the reference line segment length table are finer than the example shown in FIG. 2, the error will be further reduced.
従来の簡易方式として示した■式に上記の数値を適用す
ると、51+18=69となり、誤差は14.92とな
って、本発明で誤差が改善されていることは明らかであ
る。When the above numerical values are applied to the equation (2) shown as a conventional simplified method, the result is 51+18=69, and the error is 14.92.It is clear that the error has been improved by the present invention.
このように、本発明の方式で・は、
(1)浮動少数点部算器のような副プロセツサを補助的
に用いなくても線分の長さが簡単に得られる。As described above, in the method of the present invention: (1) The length of a line segment can be easily obtained without supplementary use of a sub-processor such as a floating point unit.
(2)演算mが少なく、メインプロセッサの負担が少な
い。(2) The number of calculations m is small, and the burden on the main processor is small.
(3)処理は、テーブルを参照する程度なので、繰返し
計算等を必要とせず、高速である。(3) Since the processing only refers to a table, it does not require repeated calculations and is fast.
(4)誤差が予め評価できるので、許容範囲内の処理か
否かを判断したうえで、テーブルを構成すればよい。(4) Since the error can be evaluated in advance, the table can be constructed after determining whether the processing is within the allowable range.
H、発明の効果
以上、説明したとおり、本考案によれば、線分ベクトル
の長さと方向の演算のうち、特に長さの演算方式を改善
し、精度のよい平方根の近似計算を行う線分長簡易計算
方式を提供することができる。H. Effects of the Invention As explained above, according to the present invention, among the calculations of the length and direction of line segment vectors, the length calculation method is particularly improved, and the square root of the line segment can be calculated with high precision by approximating the square root. A long and simple calculation method can be provided.
第1図は本発明の一実施例の構成図、第2図は基準線分
長テーブルの見本図、第3図は線分ベクトルの説明図で
ある。
1・・・X方向差分演算器、2・・・X方向差分演算器
、3・・X方向絶対値演算器、4・・・X方向絶対値演
算器、5・・・X方向係数演算器、6・・・y方向係数
演算器、7・・・最大値比較器、8・・・線分長さ演算
器、9・・語学線分長テーブルメモリ。
第2図FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a sample diagram of a reference line segment length table, and FIG. 3 is an explanatory diagram of line segment vectors. 1...X-direction difference calculator, 2...X-direction difference calculator, 3...X-direction absolute value calculator, 4...X-direction absolute value calculator, 5...X-direction coefficient calculator , 6... Y-direction coefficient calculator, 7... Maximum value comparator, 8... Line segment length calculator, 9... Language line segment length table memory. Figure 2
Claims (1)
る線分長簡易計算方式において、予め算定した平方根デ
ータをm×m個のテーブルで格納する基準線分長テーブ
ルメモリと、線分ベクトルのx軸及びy軸の座標差の絶
対値を前記基準線分長テーブルの分割数に対応させる正
規化係数の演算手段と、その正規化係数で前記x軸及び
y軸の座標差絶対値を除算して得た各方向基準値により
前記基準線分長テーブルを対照する手段とを備え、基準
線分長テーブルメモリ内から採択した平方根データに前
記正規化係数を乗することにより線分ベクトルの線分長
を得ることを特徴とする線分長簡易計算方式。In the line segment length simple calculation method that calculates line segment lengths on mutually orthogonal x-axis and y-axis coordinates, there is a reference line segment length table memory that stores square root data calculated in advance in m x m tables, and a line segment length table memory that stores square root data calculated in advance in m x m tables. means for calculating a normalization coefficient that makes the absolute value of the coordinate difference between the x-axis and y-axis of the vector correspond to the number of divisions of the reference line segment length table; means for comparing the reference line segment length table with each direction reference value obtained by dividing the line segment vector by multiplying the square root data adopted from the reference line segment length table memory by the normalization coefficient. A simple line segment length calculation method characterized by obtaining the line segment length.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63075318A JPH01246677A (en) | 1988-03-29 | 1988-03-29 | Segment length simplified calculation system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63075318A JPH01246677A (en) | 1988-03-29 | 1988-03-29 | Segment length simplified calculation system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01246677A true JPH01246677A (en) | 1989-10-02 |
Family
ID=13572790
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63075318A Pending JPH01246677A (en) | 1988-03-29 | 1988-03-29 | Segment length simplified calculation system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01246677A (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62549A (en) * | 1985-03-26 | 1987-01-06 | Dainippon Ink & Chem Inc | Resin composition for sealing electronic component |
-
1988
- 1988-03-29 JP JP63075318A patent/JPH01246677A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62549A (en) * | 1985-03-26 | 1987-01-06 | Dainippon Ink & Chem Inc | Resin composition for sealing electronic component |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Coons | Surfaces for computer-aided design of space forms | |
US5506947A (en) | Curve and surface smoothing without shrinkage | |
Beier et al. | Highlight-line algorithm for realtime surface-quality assessment | |
US8289323B2 (en) | Drawing processing apparatus, texture processing apparatus, and tessellation method | |
Grédiac et al. | On the optimal pattern for displacement field measurement: random speckle and DIC, or checkerboard and LSA? | |
CN111563959B (en) | Updating method, device, equipment and medium of three-dimensional deformable model of human face | |
KR0180253B1 (en) | Device and method for plotting graphic | |
JPH01246677A (en) | Segment length simplified calculation system | |
CN116468761A (en) | Registration method, equipment and storage medium based on probability distribution distance feature description | |
WO2004053741A1 (en) | Method of calculating intersecions between triangle and line segment and progam therefor | |
Siegel | Geometric data analysis: an interactive graphics program for shape comparison | |
CN114708145A (en) | Method and device for determining ocean current flow field of GOCI water color image | |
JPH01251184A (en) | Simple calculating system for line segment direction | |
CN111091602B (en) | SLAM back end optimization method, optimization device and electronic equipment | |
Kavianpour et al. | A new approach for circle detection on multiprocessors | |
Bonmassar et al. | Geometric invariance in space-variant vision systems: the exponential chirp transform | |
JP2507812B2 (en) | Square root calculation method | |
Lukasiewicz | Concentrated loadings on shells | |
Chen | Notes on diffusion networks | |
CN115984370A (en) | Sub-pixel pose determining method, device and equipment and storage medium | |
JP3312382B2 (en) | Normal vector coordinate converter | |
CN118657658A (en) | Image scaling method, apparatus, electronic device, and computer-readable storage medium | |
CN117788863A (en) | Local template generation method and local template generation device | |
KR930005776B1 (en) | Apparatus and method for shading operation of image | |
CN115908123A (en) | Image processing method, image processing device, electronic equipment and storage medium |