JPS6234283A - Two-dimensional distance calculating device - Google Patents

Two-dimensional distance calculating device

Info

Publication number
JPS6234283A
JPS6234283A JP60174923A JP17492385A JPS6234283A JP S6234283 A JPS6234283 A JP S6234283A JP 60174923 A JP60174923 A JP 60174923A JP 17492385 A JP17492385 A JP 17492385A JP S6234283 A JPS6234283 A JP S6234283A
Authority
JP
Japan
Prior art keywords
distance
chebyshev
chebyshev distance
point
curve
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.)
Granted
Application number
JP60174923A
Other languages
Japanese (ja)
Other versions
JPH07107710B2 (en
Inventor
Hiroshi Kamata
洋 鎌田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP60174923A priority Critical patent/JPH07107710B2/en
Publication of JPS6234283A publication Critical patent/JPS6234283A/en
Publication of JPH07107710B2 publication Critical patent/JPH07107710B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To attain the approximation of a two-dimensional Euclid distance with high accuracy by providing the 3rd arithmetic part which adds and normalizes the Chebyshev distances obtained by the 1st and 2nd arithmetic parts. CONSTITUTION:The 1st Chebyshev distance arithmetic part 14 calculates the Chebyshev distance based on an equal Chebyshev distance curve as shown in (a). While the 2nd Chebyshev distance arithmetic part 15 calculates the Chebyshev distance based on an equal Chebyshev distance curve turned by 45 as shown in (b). These obtained Chebyshev distances are given to an addition/ normalization part 16 to be synthesized there. Thus the result obtained from a synthetic equal Chebyshev distance curve is delivered as shown in (c). This synthetic equal Chebyshev distance curve has a right octagonal shape and therefore the approximation error can be reduced down to about 8% or less.

Description

【発明の詳細な説明】 〔概要〕 2点間の2次元ユークリッド距離を単純にチェビシェフ
距離で近似した場合、計算速度は速いが誤差が大きいと
いう欠点がある。そこで2点を45度回転したもののチ
ェビシェフ距離を、もとの2点のチェビシェフ距離に加
算したもので近似して、計算の高速性をあまり損なわず
に精度を上げるようにした。
[Detailed Description of the Invention] [Summary] When the two-dimensional Euclidean distance between two points is simply approximated by the Chebyshev distance, the calculation speed is fast, but there is a drawback that the error is large. Therefore, we approximated the Chebyshev distance of the two points rotated by 45 degrees and added them to the Chebyshev distance of the original two points, in order to improve accuracy without significantly impairing calculation speed.

〔産業上の利用分野〕[Industrial application field]

本発明は2文字や図形などのパターンを処理する画像処
理装置に有用な任意の2点間の距離を高速に求めるため
の2次元距離計算装置に関する。
The present invention relates to a two-dimensional distance calculation device for quickly determining the distance between two arbitrary points, which is useful for an image processing device that processes patterns such as two characters or figures.

〔従来の技術〕[Conventional technology]

一般に1画像処理においては9平面上に与えられた任意
の2点間の距離を求める処理要求がしばしば生じる。2
点間の距離は次のようにして求められる。
Generally, in one image processing, there is often a processing request to find the distance between two arbitrary points given on nine planes. 2
The distance between points can be found as follows.

第4図に示すように、平面上の2点P、、P2の座標を
(x、、Yl )、  (xz、yz)としたとき、P
、、P2間の距離は、座標(X、−Xi 。
As shown in Figure 4, when the coordinates of two points P, , P2 on a plane are (x,, Yl), (xz, yz), P
, , P2 is the coordinate (X, -Xi).

Yl  Yz)の点P、と原点との間の距離に等しい。It is equal to the distance between the point P of Yl Yz) and the origin.

したがって、任意の2点間の距離を定義する場合1点(
X、Y)と原点(0,0)との間の距離を定義すれば十
分である。
Therefore, when defining the distance between any two points, one point (
It is sufficient to define the distance between (X, Y) and the origin (0,0).

ここで2点(X、 Y)と原点(0,0)との間の距離
をd (X、Y)で表すことにする。以下d(X、Y)
について議論する。
Here, the distance between the two points (X, Y) and the origin (0, 0) is expressed as d (X, Y). Below d(X,Y)
discuss.

ところで、2点間の直線距離は、ユークリッド距離と呼
ばれa (X、Y)=、E”’+冨1で定義される。
By the way, the straight-line distance between two points is called the Euclidean distance and is defined as a (X, Y)=, E"'+Full 1.

第5図は2等ユークリッド距離を示す点の軌跡の曲線、
すなわち、原点を中心とする円を表している。しかし、
実際の距離計算装置上でこのユークリッド距離を計算す
る際には、ニュートン法を用いた平方根の近似計算が必
要となり、計算時間が長くなる欠点がある。
Figure 5 shows the curve of the locus of points showing the second Euclidean distance.
In other words, it represents a circle centered at the origin. but,
When calculating this Euclidean distance on an actual distance calculation device, approximation calculation of the square root using Newton's method is required, which has the drawback of increasing calculation time.

そこで、高速処理が必要な場合には1点(X。Therefore, if high-speed processing is required, score 1 point (X).

Y)と原点(0,0)との間の距離を、座標値X。The distance between Y) and the origin (0,0) is the coordinate value X.

Yの各絶対値の和で定義するチェビシェフ距離d  (
X、Y)=lXl+lYl が近似的に用いられることが多い。
Chebyshev distance d (
X, Y)=lXl+lYl is often used approximately.

第6図は1等チェビシェフ距離を示す点の軌跡。Figure 6 shows the locus of points showing the first order Chebyshev distance.

すなわち原点を中心として45度回転した正方形を表し
ている。
In other words, it represents a square rotated 45 degrees around the origin.

このチェビシェフ距離を用いると、基本的には1回の加
算動作だけで済ますことができるため。
By using this Chebyshev distance, basically only one addition operation is required.

高速処理が可能となる。High-speed processing becomes possible.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来の2次元距離計算装置では、チェビシェフ距離を用
いて2点間の距離を求める場合、木質的には、第5図に
示す等ユークリッド距離曲線の円と第6図に示す等チェ
ビシェフ距離曲線の正方形との差に基づく誤差が発生し
、たとえば第6図において、x、yの座標軸に近い程誤
差は小さく。
In a conventional two-dimensional distance calculation device, when calculating the distance between two points using the Chebyshev distance, in terms of wood, the circle of the iso-Euclidean distance curve shown in Fig. 5 and the circle of the iso-Chebyshev distance curve shown in Fig. 6 are used. An error occurs based on the difference from the square, and for example in FIG. 6, the closer to the x and y coordinate axes, the smaller the error is.

座標軸から離れる程、すなわち1Xl=lYlに近い程
誤差が大きくなり、最大40%程度にも達するという問
題があった。
There was a problem in that the further away from the coordinate axis, that is, the closer to 1Xl=lYl, the larger the error became, reaching a maximum of about 40%.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は、チェビシェフ距離を用いる2次元距離計算装
置の近似誤差を改善することを目的としており、そのた
め、与えられた2点間のチェビシェフ距離を求めるとと
もに、その2点の座標を45度回転させたものについて
もチェビシェフ距離を求め、得られた2つのチェビシェ
フ距離を加算し正規化したものを結果として出力するよ
うに構成するものである。
The purpose of the present invention is to improve the approximation error of a two-dimensional distance calculation device that uses Chebyshev distance, and therefore calculates the Chebyshev distance between two given points and rotates the coordinates of the two points by 45 degrees. The configuration is such that the Chebyshev distance is also determined for the two Chebyshev distances obtained, the two obtained Chebyshev distances are added, and the normalized result is output.

第1図は1本発明の原理的構成図である。FIG. 1 is a diagram showing the basic configuration of the present invention.

図において、11は第1点入力部、12は第2点入力部
、13は相対位置変換部、14は第1チエビシエフ距離
演算部、15は第2チエビシエフ距離演算部、16は加
算および正規化部を表す。
In the figure, 11 is a first point input section, 12 is a second point input section, 13 is a relative position conversion section, 14 is a first Tievisiev distance calculation section, 15 is a second Tievisiev distance calculation section, and 16 is an addition and normalization section. represents the division.

第1点入力部11および第2点入力部12には。In the first point input section 11 and the second point input section 12.

距離を計算すべき第1点および第2点の各一方が入力設
定される。ここで第1点および第2点の座標は、  (
X+ 、YI )、  (Xz 、Yz )とする。
One of the first point and the second point for which the distance is to be calculated is input and set. Here, the coordinates of the first point and the second point are (
X+, YI), (Xz, Yz).

相対位置変換部13は、第1点入力部11および第2点
入力部12にそれぞれ設定されている第1点および第2
点の相対座標を求めて、第2点を原点位置に移動する処
理を行う。これにより、第1点の座標は(X+   X
z 、YI   Y2 )となり。
The relative position conversion unit 13 converts the first point and second point set in the first point input unit 11 and second point input unit 12, respectively.
The relative coordinates of the point are determined and the process of moving the second point to the origin position is performed. As a result, the coordinates of the first point are (X+X
z, YI Y2).

第2点の座標は(0,O)となる。The coordinates of the second point are (0, O).

第1チェビシェフ距離演算部14は1回転なしの基準位
置における2点間のチェビシェフ距離d (X、Y) 
−1Xl+lYl      ・・・(1)を計算する
The first Chebyshev distance calculation unit 14 calculates the Chebyshev distance d (X, Y) between two points at the reference position without one rotation.
-1Xl+lYl...(1) is calculated.

第2チエビシエフ距離 、喉襄部15は、原点に対して
45度回転させた2つの点のチェビシェフ距離 d (X、Y)= −(lx+yl+1X−yl)・・
・(2)π を求める。
Second Chebyshev distance, the throat fold 15 is the Chebyshev distance d between two points rotated 45 degrees with respect to the origin (X, Y) = - (lx + yl + 1X - yl)...
・(2) Find π.

加算および正規化部16は、第1.第2の各チェビシェ
フ距離演算部から出力された2つのチェビシェフ距離を
加算し、座標軸上の入力値と結果値とが一致するように
定数倍して正規化することにより。
The addition and normalization unit 16 includes the first . By adding the two Chebyshev distances output from each second Chebyshev distance calculation unit and normalizing by multiplying by a constant so that the input value on the coordinate axis and the result value match.

d  (X、Y) −(ff−1)  (lXl+lY
I+ (1−−)  (lX+Yl+1X−Yl)・・
・(3)を結果値として出力する。
d (X, Y) −(ff−1) (lXl+lY
I+ (1--) (lX+Yl+1X-Yl)...
- Output (3) as the result value.

〔作用〕[Effect]

第1図において、第1チェビシェフ距離演算部14は、
第2図(a)に示される等チェビシェフ距離曲線に基づ
くチェビシェフ距離を計算し、これに対して第2チェビ
シェフ距離演算部15は第2図(b)に示される45度
回転された等チェビシェフ距離曲線に基づくチェビシェ
フ距離を計算する。
In FIG. 1, the first Chebyshev distance calculation unit 14 is
The Chebyshev distance is calculated based on the iso-Chebyshev distance curve shown in FIG. Calculate Chebyshev distance based on a curve.

第1図の加算および正規化部16は、これらの結果を合
成することにより、第2図(c)に示される合成等チェ
ビシェフ距離曲線に基づく結果を出力する。
The addition and normalization unit 16 in FIG. 1 combines these results and outputs a result based on the combined Chebyshev distance curve shown in FIG. 2(c).

第2図(c)の合成等チェビシェフ距離曲線は。The composite iso-Chebyshev distance curve in Figure 2(c) is.

正八角形をなしており、第5図に示した等ニークリ・7
ド距離曲線により近いことから、近似誤差が減少され、
約8%以内に抑えることができる。
It has a regular octagonal shape, and has the same shape as shown in Figure 5.
The approximation error is reduced because it is closer to the distance curve.
It can be suppressed to within about 8%.

次に、上記(11,(2+の各式から(3)式が得られ
る過程を説明する。
Next, the process of obtaining equation (3) from the above equations (11 and (2+) will be explained.

(2)式は、(1)式に対して次の座標回転変換を施し
たものである。
Equation (2) is obtained by subjecting Equation (1) to the following coordinate rotation transformation.

・・・(4) ここで(1)式と(2)式とを加算し。...(4) Now, add equations (1) and (2).

d  (1,0) −1・・・(5) となるように係数の定数を設定して正規化し。d (1,0) -1...(5) Normalize by setting constants for the coefficients so that

・・・(6) が得られる。さらに定数の分母から平方根を外し。...(6) is obtained. Furthermore, remove the square root from the denominator of the constant.

式を整理することにより、(3)弐が得られる。By rearranging the equation, (3) 2 can be obtained.

〔実施例〕〔Example〕

第3図は1本発明の1実施例装置の構成図である。 FIG. 3 is a block diagram of an apparatus according to an embodiment of the present invention.

第1点座標入力部31に第1点の座標(Xl。The coordinates of the first point (Xl) are entered in the first point coordinate input section 31.

YI)を入力し、第2点座標入力部32に第2点の座標
(Xz 、  Yz )を入力する。
YI), and input the coordinates (Xz, Yz) of the second point into the second point coordinate input section 32.

第1点座標入力部31から第1点X座標格納部33にX
Iを、また第1点X座標格納部35にy。
From the first point coordinate input section 31 to the first point X coordinate storage section 33
I and y in the first point X coordinate storage section 35.

をそれぞれ転送し格納する。同様に第2点座標入力部3
2から第2点X座標格納部34にX2を。
are transferred and stored respectively. Similarly, the second point coordinate input section 3
2 to the second point X coordinate storage section 34.

また第1点X座標格納部36にY2をそれぞれ転送し格
納する。
Further, Y2 is transferred and stored in the first point X coordinate storage section 36, respectively.

次に33.34から減算部37にX、、X2を転送し、
差値X=X、−X2を求め、差値X格納部38にXを格
納する。同様に35.36から減算部37にY、、Y2
を転送し、差値Y=Y、−Y2を求め、差値Y格納部3
9にYを格納する。
Next, transfer X, , X2 from 33.34 to the subtraction unit 37,
The difference value X=X, -X2 is determined, and X is stored in the difference value X storage section 38. Similarly, from 35.36, subtracter 37 inputs Y, , Y2
is transferred, the difference value Y=Y, -Y2 is calculated, and the difference value Y storage unit 3
Store Y in 9.

次に38から絶対値計算部40にXを転送して絶対値を
求め、IX1格納部41に格納する。同様に39から4
0にYを転送し、絶対値IYIを求め、IY1格納部4
2に格納する。
Next, X is transferred from 38 to the absolute value calculation section 40 to obtain the absolute value and stored in the IX1 storage section 41. Similarly from 39 to 4
Transfer Y to 0, find the absolute value IYI, and store IY1 storage section 4.
Store in 2.

次に38.39から加算部43.減算部44にX、Yを
転送する。43でXIYを求めた後40に転送し、絶対
値I XIY lを求めてl XIY 1格納部45に
格納する。また44でX−Yを求めた後40に転送し、
絶対値I X−Y lを求めて。
Next, from 38.39, the adder 43. Transfer X and Y to the subtraction unit 44. After determining XIY in step 43, it is transferred to step 40, where the absolute value I XIY l is determined and stored in l XIY 1 storage section 45 . Also, after finding X-Y at 44, transfer it to 40,
Find the absolute value I X-Y l.

l X−Y l格納部46に格納する。l XY l Store in the storage section 46.

次に、41.42からIXl、IYIを加算部47に転
送し、lXl+lYlを求め、lXl+IYI格納部4
8に格納し、また45.46からlX+Yl、IX−Y
lを加算部47に転送し。
Next, from 41.42, IXl and IYI are transferred to the adder 47, lXl+lYl is obtained, and lXl+IYI storage unit 4
8, and from 45.46 lX+Yl, IX-Y
l is transferred to the addition section 47.

l XIY l + l X−Y lを求め、lX+Y
l+1X−Y l格納部49に格納する。
l XIY l + l X-Y Find l, lX+Y
l+1X-Y Store in l storage section 49.

第1定数格納部50には5 ((2)−1)の定数値を
格納しておき、第2定数格納部51には、  (1π m−)の定数値を格納しておく。
The first constant storage section 50 stores a constant value of 5 ((2)-1), and the second constant storage section 51 stores a constant value of (1π m-).

ここで、50,48,49.51に格納した各個を、積
和計算部52に転送する。52では、50からの値(旧
−1)と48からの値の積IXI+lYl、および49
からの値I XIY l + l Xl −Y l 51とからの値(1−−)の積の和を求め。
Here, each item stored in 50, 48, 49, and 51 is transferred to the sum-of-products calculating section 52. 52, the product IXI+lYl of the value from 50 (old -1) and the value from 48, and 49
Find the sum of the products of the value I XIY l + l Xl - Y l 51 and the value (1--) from.

結果格納部53に格納する。The result is stored in the result storage section 53.

このようにして前述した(3)式の結果が得られる。In this way, the result of equation (3) described above is obtained.

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

本発明の装置によれば、2次元ユークリッド距離を、従
来の単純なチェビシェフ距離に基づく近似にくらべて計
算速度をそれぼど低下させることなくより高精度で近似
することができる。
According to the apparatus of the present invention, a two-dimensional Euclidean distance can be approximated with higher precision without reducing the calculation speed at all compared to the conventional approximation based on a simple Chebyshev distance.

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

第1図は本発明の原理的構成図、第2図(a)は等チェ
ビシェフ距離曲線のグラフ、第2図(b)は45度回転
した等チェビシェフ距離曲線のグラフ、第2図(c)は
合成等チェビシェフ距離曲線のグラフ、第3図は本発明
の1実施例の構成図。 第4図は2点間の距離の説明図、第5図は等ユークリッ
ド距離曲線の説明図、第6図は等チェビシェフ距離曲線
の説明図である。 第1図中。 11:第1点入力部 12:第2点入力部 13:相対位置変換部 14;第1チエビシエフ距離演算部 15:第2チエビシエフ距離演算部 16:加算および正規化部
Figure 1 is a diagram of the basic configuration of the present invention, Figure 2 (a) is a graph of the equal Chebyshev distance curve, Figure 2 (b) is a graph of the equal Chebyshev distance curve rotated by 45 degrees, and Figure 2 (c) is a graph of the equal Chebyshev distance curve. 3 is a graph of a synthetic equivalent Chebyshev distance curve, and FIG. 3 is a configuration diagram of an embodiment of the present invention. FIG. 4 is an explanatory diagram of the distance between two points, FIG. 5 is an explanatory diagram of the equi-Euclidean distance curve, and FIG. 6 is an explanatory diagram of the equi-Chebyshev distance curve. In Figure 1. 11: First point input section 12: Second point input section 13: Relative position conversion section 14; First Thiebishev distance calculation section 15: Second Thievishev distance calculation section 16: Addition and normalization section

Claims (1)

【特許請求の範囲】[Claims] 2つの直交座標軸をもつ座標系の与えられた2点に対し
、その2点のチェビシェフ距離を求める第1の演算部(
14)と、前記2点を座標系に対し45度回転した点の
チェビシェフ距離を求める第2の演算部(15)と、第
1の演算部(14)と第2の演算部(15)でそれぞれ
求めたチェビシェフ距離を加算および正規化する第3の
演算部(16)とをそなえていることを特徴とする2次
元距離計算装置。
A first calculation unit (
14), a second calculation unit (15) that calculates the Chebyshev distance between the two points rotated by 45 degrees with respect to the coordinate system, and a first calculation unit (14) and a second calculation unit (15). A two-dimensional distance calculation device characterized by comprising a third calculation unit (16) that adds and normalizes the Chebyshev distances determined respectively.
JP60174923A 1985-08-08 1985-08-08 Two-dimensional distance calculation device for image processing device Expired - Fee Related JPH07107710B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60174923A JPH07107710B2 (en) 1985-08-08 1985-08-08 Two-dimensional distance calculation device for image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60174923A JPH07107710B2 (en) 1985-08-08 1985-08-08 Two-dimensional distance calculation device for image processing device

Publications (2)

Publication Number Publication Date
JPS6234283A true JPS6234283A (en) 1987-02-14
JPH07107710B2 JPH07107710B2 (en) 1995-11-15

Family

ID=15987076

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60174923A Expired - Fee Related JPH07107710B2 (en) 1985-08-08 1985-08-08 Two-dimensional distance calculation device for image processing device

Country Status (1)

Country Link
JP (1) JPH07107710B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002059837A1 (en) * 2001-01-23 2002-08-01 Sony Corporation Distance calculating method and imaging device
JP2016114746A (en) * 2014-12-15 2016-06-23 株式会社メガチップス Liquid crystal display device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002059837A1 (en) * 2001-01-23 2002-08-01 Sony Corporation Distance calculating method and imaging device
US7317482B2 (en) 2001-01-23 2008-01-08 Sony Corporation Distance calculating method and imaging device
JP2016114746A (en) * 2014-12-15 2016-06-23 株式会社メガチップス Liquid crystal display device

Also Published As

Publication number Publication date
JPH07107710B2 (en) 1995-11-15

Similar Documents

Publication Publication Date Title
JPS5840761B2 (en) Control device for human arm manipulator
JPS6234283A (en) Two-dimensional distance calculating device
Tamtsia et al. New results in images moments-based visual servoing
JP2778430B2 (en) Three-dimensional position and posture recognition method based on vision and three-dimensional position and posture recognition device based on vision
JPS6243706A (en) Interference checking method in robot
Erdos et al. Parametric tool correction algorithm for 5-axis machining
US5091867A (en) Method and apparatus for generating display figures with three degrees of freedom
Ananthasuresh et al. Analysis and Optimal Synthesis of the RSCR Spatial Mechanisms
Vo et al. Kinematic and dynamic accuracy of spherical mechanisms
JP2768331B2 (en) Curve linear approximation device
Cross et al. C1 and G1 continuous rational motions using a conformal geometric algebra
JPH0312787A (en) Inspecting system for overlapping of polygonal patterns
JPS63127365A (en) Coordinate transforming system
JPH056431A (en) Detector for feature point of contour line
JP3080102B2 (en) Data processing method and device
JPH01189765A (en) Function arithmetic unit
Han Design of Verification System on Robot Trajectory Interpolation Algorithm
JPS63310267A (en) Image processor
JPH01271876A (en) Comparison arithmetic processor
SU1571624A1 (en) Device for restoration of function
JPH02153412A (en) Inverse trigonometric function arithmetic unit
KR910001394B1 (en) Cirde graphics on computer
JPH02126378A (en) Sector area painting-out system
JPH06320387A (en) Three-dimensional processing method
JPH01255010A (en) Curve interpolating device

Legal Events

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