JPH0581431A - Method for calculating area of polygon - Google Patents

Method for calculating area of polygon

Info

Publication number
JPH0581431A
JPH0581431A JP3244018A JP24401891A JPH0581431A JP H0581431 A JPH0581431 A JP H0581431A JP 3244018 A JP3244018 A JP 3244018A JP 24401891 A JP24401891 A JP 24401891A JP H0581431 A JPH0581431 A JP H0581431A
Authority
JP
Japan
Prior art keywords
polygon
area
vector
calculated
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
Application number
JP3244018A
Other languages
Japanese (ja)
Inventor
Taizo Yamada
泰三 山田
Keisuke Goto
啓介 後藤
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.)
Meidensha Corp
Meidensha Electric Manufacturing Co Ltd
Original Assignee
Meidensha Corp
Meidensha Electric Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Meidensha Corp, Meidensha Electric Manufacturing Co Ltd filed Critical Meidensha Corp
Priority to JP3244018A priority Critical patent/JPH0581431A/en
Publication of JPH0581431A publication Critical patent/JPH0581431A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To shorten the processing time for calculation of the area of a polygon in a drawing recognition device where a graphic consisting of a polygon of a map or a floor plan is inputted as segment data by a computer. CONSTITUTION:When the area of a polygon formed by connecting plural apexes having coordinate values of two orthogonal axes will be calculated, a vactor is set to each apex of the polygon from the coordinate origin. Triangles are successively formed while overlapping every two vectors out of these vectors, and their exterior product values are calculated. Calculated exterior product values are integrated as they are, and finally, a half of the absolute value of the integral value is adopted as the area value.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、地図や間取図など多角
形で成る図形を線分データとしてコンピュータへ入力す
る図面認識装置で多角形の面積を算出する算出方法に関
し、特に、処理時間を短縮する多角形面積の算出方法に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a calculation method for calculating the area of a polygon with a drawing recognition device for inputting a polygonal figure such as a map or floor plan to a computer as line segment data, and particularly to a processing time. The present invention relates to a method of calculating a polygonal area for shortening.

【0002】[0002]

【従来の技術】近年、イメージスキャナ等の技術的な進
歩に伴って、図形の判読や認識が多用されるようになっ
ている。地図上で行政区分を確認する場合や各種平面図
により間取りを把握する場合、またCADで部品とその
組み立て後の全体像を想定する場合など、複合図形及び
その単位図形とを形成するポリゴンを線分データとして
コンピュータへ入力しなければならないことが非常に多
い。図4及び図5は、そのような図面認識装置で、複合
図形を多角形の単位図形に分割する方法の一例を示す説
明図で、図中41は線分、42〜45は該線分41の方
向転換点、46及び47は線分41の分岐点である。同
図において、複合図形の線分41を正方向及び逆方向へ
2回ずつ辿るものとし、所望の線分の最初の分岐点46
では該線分41より反時計回りに探索して最初に発見さ
れた方の線分を選択して辿る。次の分岐点47でも同様
にして反時計回りに線分を辿り、ベクトルが平素句する
と、これをポリゴン48とする。線分を2回ずつ辿る
と、更にポリゴン49及び50が得られる。これらのポ
リゴンのうち1つは外周ループであるが、その判別は意
外に繁雑である。例えば図5に示す各ノード51〜56
における方向転換角度を合計し、合計値のプラス又はマ
イナスによって前記ポリゴン48及び49は単位ポリゴ
ンであり、ポリゴン50は外周ポリゴンであると判断す
る方法もあるが、通常はベクトル57やベクトル58に
よって形成される多角形の面積を算出し、その値が最大
のものを外周ループとしている。
2. Description of the Related Art In recent years, with the technical progress of image scanners and the like, the reading and recognition of graphics have been frequently used. When checking administrative divisions on a map, grasping the floor plan by various floor plans, and assuming the overall image after assembly of parts with CAD, the polygons that form the composite figure and its unit figure are drawn as lines. Very often it has to be entered into the computer as minute data. FIGS. 4 and 5 are explanatory views showing an example of a method of dividing a composite figure into polygonal unit figures in such a drawing recognition device, in which 41 is a line segment and 42 to 45 are the line segments 41. The turning points 46 and 47 are branch points of the line segment 41. In the figure, the line segment 41 of the complex figure is traced twice in the forward direction and the reverse direction, and the first branch point 46 of the desired line segment is traced.
Then, the line segment 41 is searched counterclockwise and the line segment first discovered is selected and traced. Similarly, at the next branch point 47, the line segment is traced counterclockwise, and when the vector is a plain phrase, this is made a polygon 48. When the line segment is traced twice, polygons 49 and 50 are further obtained. One of these polygons is a peripheral loop, but its discrimination is surprisingly complicated. For example, the nodes 51 to 56 shown in FIG.
There is also a method in which the polygons 48 and 49 are unit polygons and the polygon 50 is a peripheral polygon by summing up the direction change angles in the above, and the polygons are usually formed by the vector 57 and the vector 58. The area of the polygon to be calculated is calculated, and the one with the largest value is used as the outer loop.

【0003】[0003]

【発明が解決しようとする課題】ところで、上記の図面
認識装置では、入力した画像を一旦ビットマップメモリ
に展開したのち、その後の処理を実行している。多角形
面積の算出も、従来は、ビットマップに展開した画像の
多角形に含まれるビット数をカウントすることで計数し
ていた。しかしながら、そのようなカウント方式は、言
うまでもなく多大の処理時間を必要とし、全体の処理に
及ぼす影響も少なくない。本発明は、このような課題に
鑑みて創案されたもので、処理時間を短縮可能な多角形
面積の算出方法を提供することを目的としている。
By the way, in the above drawing recognition apparatus, the input image is once expanded in the bit map memory and then the subsequent processing is executed. The calculation of the polygonal area has conventionally been performed by counting the number of bits included in the polygon of the image developed in the bitmap. However, it goes without saying that such a counting method requires a great deal of processing time and has a considerable influence on the overall processing. The present invention was devised in view of such problems, and an object thereof is to provide a method for calculating a polygonal area that can reduce the processing time.

【0004】[0004]

【課題を解決するための手段】本発明における上記課題
を解決するための手段は、直交2軸の座標値を有する複
数の頂点を連結して成る多角形の面積算出方法におい
て、複数の頂点を重複させながら2点ずつ組み合わせ、
座標原点から2点への2本のベクトルで形成される各三
角形の面積は外積値により算出し、それらの面積を加減
算することで多角形の面積を算出することを特徴とする
算出方法によるものとする。
Means for solving the above-mentioned problems in the present invention is to provide a polygonal area calculating method in which a plurality of vertices having coordinate values of two orthogonal axes are connected to each other. While overlapping, combine 2 points each,
The area of each triangle formed by two vectors from the coordinate origin to the two points is calculated by the cross product value, and the area of the polygon is calculated by adding and subtracting those areas, which is a calculation method. And

【0005】[0005]

【作用】本発明は、ベクトルの外積値を使用して多角形
の面積を算出する方法である。ここでベクトルの外積値
とは、2つのベクトルが存在するとき、第1のベクトル
と第2のベクトルの第1のベクトルに対する垂直成分と
の積のことで、ベクトルが直交2軸座標で(xa,x
a)及び(xb,xb)で示されるとき、両ベクトルの
成す角度に関係なく、xa yb−ya xbで示され
る。しかも、三角形の面積は公知のとおり底辺×高さ÷
2であるので、前記外積値の絶対値の1/2に該当す
る。一方で、面積を算出したい多角形が前記直交2軸の
座標系上に存在するとき、その多角形の各頂点に対して
座標原点からのベクトルを想定し、それらを2本ずつ組
み合わせると、三角形が形成され、それらの三角形の面
積を加減算することで多角形の面積が得られる。
The present invention is a method of calculating the area of a polygon using the cross product value of vectors. Here, the cross product value of a vector is a product of a first vector and a vertical component of the second vector with respect to the first vector when two vectors are present, and the vector has an orthogonal biaxial coordinate (xa , X
a) and (xb, xb), they are represented by xa yb-ya xb regardless of the angle formed by both vectors. Moreover, the area of the triangle is, as is known, the base x height ÷
Since it is 2, it corresponds to 1/2 of the absolute value of the outer product value. On the other hand, when a polygon whose area is to be calculated exists on the coordinate system of the two orthogonal axes, a vector from the coordinate origin is assumed for each vertex of the polygon, and two of them are combined to form a triangle. Are formed, and the areas of the polygons are obtained by adding and subtracting the areas of the triangles.

【0006】[0006]

【実施例】以下、図面を参照して、本発明の実施例を詳
細に説明する。図1は、本発明の一実施例を示すフロー
チャートである。同図において本発明の処理は、まず2
軸座標上のn角形の各頂点に対して座標原点からベクト
ルを設定し、そのうち2本ずつで順次三角形を形成して
はその外積値を算出し、その総和の絶対価の1/2を面
積値とする。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a flowchart showing an embodiment of the present invention. In the figure, the process of the present invention is
A vector is set from the coordinate origin for each vertex of the n-gon on the axis coordinates, two of them form a triangle in sequence, the outer product value is calculated, and 1/2 of the absolute value of the sum is calculated as the area. The value.

【0007】図2は、上記実施例の面積値算出の一例を
示す説明図で、三角形の面積を外積値を使用して求める
方法を説明するものである。図2において、ベクトルO
AとベクトルOBの外積値とは、ベクトルOAと、ベク
トルOBのベクトルOAに対する垂直成分との積であっ
て、│OA│・│OB│・Sinθで定義される。
FIG. 2 is an explanatory diagram showing an example of area value calculation in the above embodiment, and illustrates a method for obtaining the area of a triangle by using the outer product value. In FIG. 2, the vector O
The outer product value of A and the vector OB is the product of the vector OA and the vertical component of the vector OB with respect to the vector OA, and is defined by | OA | · | OB | · Sinθ.

【0008】また、ベクトルOAとベクトルOBの内積
値とは、ベクトルOAと、ベクトルOBのベクトルOA
に対する平行成分との積であって、│OA│・│OB│
・Cosθで定義される。
The inner product value of the vector OA and the vector OB is the vector OA and the vector OA of the vector OB.
│OA│ ・ │OB│
-Defined by Cosθ.

【0009】ここで注意する点は、内積値も外積値も正
負の値をとることである。また、ベクトルOAとベクト
ルOBの外積値と、ベクトルOBとベクトルOAの外積
値とは符号がSin(−θ)=−Sinθと反転している。
The point to be noted here is that both the inner product value and the outer product value take positive and negative values. Further, the signs of the outer product value of the vector OA and the vector OB and the outer product value of the vector OB and the vector OA are inverted to Sin (−θ) = − Sinθ.

【0010】外積値は│OA│・│OB│・Sinθであ
るから、この値は、2軸座標成分(xa,ya)および
(xb,yb)を用いると、直角座標はベクトルOAと
ベクトルOBとなす角度θは、ベクトルOAの傾きαと
ベクトルOBの傾きβより、θ=β−αとなり、三角関
数の加法定理により、 Sin(β-α)=Sinβ・Cosα−Cosβ・Sinα Cos(β−α)=Cosβ・Cosα+Sinβ・Sinα となり、従って、 │OA│・│OB│・Cosθ=│OA│・│OB│・(Cosβ・Cosα+Sinβ・Sinα) =│OA│・Cosα・│OB│・Cosβ+│OA│・Sinα・│OB│・Sinβ =xa・xb+ya・yb │OA│・│OB│・Sinθ=│OA│・│OB│・(Sinβ・Cosα-Cosβ・Sinα) =│OA│・Cosα・│OB│・Sinβ-│OA│・Sinα・│OB│・Cosβ =xa・yb-ya・xb 即ち、2軸座標成分(xa・xa)及び(xb・yb)を用い
ると、 OA│・│OB│・Sinθ=xa・yb-ya・yb で得られる。そこで、ベクトルOAとベクトルOBとで
形成される三角形OABの面積SOABは、 SOAB=1/2│(xa・yb-ya・xb) で求めることができる。
Since the outer product value is | OA |. | OB | .Sin.theta., This value uses the biaxial coordinate components (xa, ya) and (xb, yb), and the Cartesian coordinates are the vector OA and the vector OB. From the inclination α of the vector OA and the inclination β of the vector OB, θ = β−α, and by the addition theorem of the trigonometric function, Sin (β−α) = Sinβ · Cosα−Cosβ · Sinα Cos (β −α) = Cosβ · Cosα + Sinβ · Sinα, so │OA│ ・ │OB│ ・ Cosθ = │OA│ ・ │OB│ ・ (Cosβ ・ Cosα + Sinβ ・ Sinα) = │OA│ ・ Cosα ・ │OB│ ・ Cosβ + │OA│ ・ Sinα ・ │OB│ ・ Sinβ = xa ・ xb + ya ・ yb │OA│ ・ │OB│ ・ Sinθ = │OA│ ・ │OB│ ・ (Sinβ ・ Cosα-Cosβ ・ Sinα) = │OA│ ・Cosα ・ │OB│ ・ Sinβ-│OA│ ・ Sinα ・ │OB│ ・ Cosβ = xa ・ yb-ya ・ xb That is, if two-axis coordinate components (xa ・ xa) and (xb ・ yb) are used, OA│・ │OB│ ・ Sinθ = xa ・ yb-ya ・ yb That. Therefore, the area S OAB of the triangle OAB formed by the vector OA and the vector OB can be calculated by S OAB = 1/2 | (xa · yb-ya · xb).

【0011】図3は、上記実施例の面積値加減算の一例
を示す説明図で、ベクトル三角形の面積を外積値より求
めたのち、それらの加減算によりオリジナルの多角形面
積を算出する方法を示すものである。ここで、面積計算
の対象となるオリジナルの三角形は、3本のベクトルO
A,OB,OCの矢先で形成される三角形ABCであっ
て、その面積SABCは、 SABC=SOAB+OBC-OCA である。これを外積値に換算すると、 SABC=1/2│(xa・yb-ya・xb)│+1/2│(xb・yc-yb・xc)│-1/2│(xc・ya-yc・xa) =1/2│(xa・yb-ya・xb)+(xb・yc・xc)+(xc・ya-yc・xa) となる。即ち、一般にn個の頂点を有する多角形の面積
Snは、各頂点の座標を(xo,yo),(xl,y
l),…(xn,yn)とすると、
FIG. 3 is an explanatory view showing an example of the area value addition / subtraction of the above embodiment, showing a method of calculating the area of a vector triangle from the outer product value and then calculating the original polygon area by these addition / subtraction. Is. Here, the original triangle that is the target of the area calculation is the three vectors O.
It is a triangle ABC formed by arrowheads of A, OB, and OC, and its area S ABC is S ABC = S OAB + S OBC- S OCA . Converting this to the cross product value, S ABC = 1 / 2│ (xa ・ yb-ya ・ xb) │ + 1 / 2│ (xb ・ yc-yb ・ xc) │-1 / 2│ (xc ・ ya- yc ・ xa) = 1 / 2│ (xa ・ yb-ya ・ xb) + (xb ・ yc ・ xc) + (xc ・ ya-yc ・ xa). That is, generally, the area Sn of a polygon having n vertices has the coordinates of each vertex as (xo, yo), (xl, y
l), ... (xn, yn)

【0012】[0012]

【数1】 [Equation 1]

【0013】で求めることができる。但し、多角形の頂
点であるからxn=xo,yn=yoで求める。尚、上
記の座標値を座標系上の任意の点からの相対座標とし
て、同様な算出処理を行うことも当然可能である。
It can be obtained by However, since it is a vertex of a polygon, it is determined by xn = xo and yn = yo. Incidentally, it is of course possible to perform the same calculation process by using the above coordinate values as relative coordinates from an arbitrary point on the coordinate system.

【0014】[0014]

【発明の効果】以上、説明したとおり、本発明によれ
ば、簡単な演算で済み、処理時間を短縮可能な多角形面
積の算出方法を提供することができる。
As described above, according to the present invention, it is possible to provide a method for calculating a polygonal area that requires only simple calculation and can reduce the processing time.

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

【図1】本発明の一実施例のフローチャート。FIG. 1 is a flowchart of an embodiment of the present invention.

【図2】本発明の一実施例の説明図。FIG. 2 is an explanatory diagram of an embodiment of the present invention.

【図3】本発明の一実施例の説明図。FIG. 3 is an explanatory diagram of an embodiment of the present invention.

【図4】複合図形分割処理の説明図。FIG. 4 is an explanatory diagram of composite figure division processing.

【図5】複合図形分割処理の説明図。FIG. 5 is an explanatory diagram of composite figure division processing.

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

41…線分、42〜45…方向転換点、46,47…分
岐点、48〜50…ポリゴン、51〜56…ノード、5
7及び58…ベクトル。
41 ... Line segment, 42-45 ... Direction change point, 46, 47 ... Bifurcation point, 48-50 ... Polygon, 51-56 ... Node, 5
7 and 58 ... Vector.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 直交2軸の座標値を有する複数の頂点を
直結して成る多角形の面積算出方法において、複数の頂
点を重複させながら2点ずつ組み合わせ、座標原点から
2点への2本のベクトルで形成される各三角形の面積を
外積値により算出し、それらの面積を加減算することで
多角形の面積を算出することを特徴とする多角形の面積
算出方法。
1. In a polygonal area calculation method comprising a plurality of vertices having coordinate values of two orthogonal axes, the vertices are overlapped, and two points are combined to form two points from a coordinate origin. An area calculation method for a polygon, characterized in that the area of each triangle formed by the vector is calculated by an outer product value, and the area of the polygon is calculated by adding and subtracting the areas.
JP3244018A 1991-09-25 1991-09-25 Method for calculating area of polygon Pending JPH0581431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3244018A JPH0581431A (en) 1991-09-25 1991-09-25 Method for calculating area of polygon

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3244018A JPH0581431A (en) 1991-09-25 1991-09-25 Method for calculating area of polygon

Publications (1)

Publication Number Publication Date
JPH0581431A true JPH0581431A (en) 1993-04-02

Family

ID=17112488

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3244018A Pending JPH0581431A (en) 1991-09-25 1991-09-25 Method for calculating area of polygon

Country Status (1)

Country Link
JP (1) JPH0581431A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002298146A (en) * 2001-04-02 2002-10-11 Fujitsu General Ltd Polygonal area calculating method
US6910031B2 (en) 2001-03-07 2005-06-21 Beacon Information Technologies Inc. Data search system and method for displaying data search results

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6910031B2 (en) 2001-03-07 2005-06-21 Beacon Information Technologies Inc. Data search system and method for displaying data search results
US7539670B2 (en) 2001-03-07 2009-05-26 Beacon International Technology Inc. Data search system and method for displaying data search results
JP2002298146A (en) * 2001-04-02 2002-10-11 Fujitsu General Ltd Polygonal area calculating method

Similar Documents

Publication Publication Date Title
EP4068150A1 (en) Hand key point detection method, gesture recognition method, and related devices
JP3242108B2 (en) Target mark recognition and tracking system and method
Wei et al. A non-contact measurement method of ship block using image-based 3D reconstruction technology
Leopoldseder et al. Approximation of developable surfaces with cone spline surfaces
CN111079565B (en) Construction method and identification method of view two-dimensional attitude template and positioning grabbing system
CN103632366A (en) Parameter identification method for elliptical target
JPH08138082A (en) Method and system for generation of square mesh
Selaković et al. New dynamics in dynamic geometry: Dragging constructed points
JPH0581431A (en) Method for calculating area of polygon
JPH09102039A (en) Template matching method
Pedraza et al. BS-SLAM: Shaping the World.
CN114075810B (en) Space path fitting method and system for concrete 3D printing
Chen et al. Bearing rigidity and formation stabilization for multiple rigid bodies in SE (3)
Sappa et al. Incremental multiview integration of range images
CN114998381A (en) Welding track fitting method, device, equipment and storage medium in tube plate welding
JP3339648B2 (en) Information processing apparatus and drawing method
JPH05324921A (en) Method and device for forming curve
JP2000251081A (en) Inner point deciding method, graphic drawing device, and program storage medium
JP2854588B2 (en) Raster vector conversion method and line figure input device
US10762718B2 (en) System and method for determining minimal negative distance between two objects
JP3071495B2 (en) Object model editing device
JPH0251008A (en) Method and apparatus for estimating posture of object
Kim et al. Point Cloud-Based Spatial Environment Development for Near Real-Time Erection Simulation in Shipyards
JPH05324835A (en) Method and device for pattern matching of two-dimensional figure
JPH03103992A (en) Calculating device for regular polygon vertex