[go: up one dir, main page]

JP2006323780A - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP2006323780A
JP2006323780A JP2005148560A JP2005148560A JP2006323780A JP 2006323780 A JP2006323780 A JP 2006323780A JP 2005148560 A JP2005148560 A JP 2005148560A JP 2005148560 A JP2005148560 A JP 2005148560A JP 2006323780 A JP2006323780 A JP 2006323780A
Authority
JP
Japan
Prior art keywords
boundary
rectangular area
area
rectangular
vertex
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.)
Withdrawn
Application number
JP2005148560A
Other languages
Japanese (ja)
Inventor
Isamu Yamashita
勇 山下
Teruyoshi Washisawa
輝芳 鷲澤
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2005148560A priority Critical patent/JP2006323780A/en
Publication of JP2006323780A publication Critical patent/JP2006323780A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

【課題】 厚みの薄い形状など、複雑な形状を境界とする場合にも容易に境界形状データの生成を可能にする為の技術を提供すること。
【解決手段】 複数の領域が設定された2次元仮想平面を分割した矩形領域のうち、設定された領域同士の境界部分を含む境界矩形領域を所定数の領域に分割し(S508)、分割領域を構成する各頂点について分割領域内の境界部分との位置関係を求め、分割領域を構成する頂点若しくは稜線と、分割領域内の境界部分との交点位置を求め、上記位置関係、及び上記交点位置を用いて、分割領域内で設定された領域に属している部分、属していない部分を特定することで、分割領域が、予め作成された複数種のパターンのうち何れのパターンに相当するのかを決定する(S505)。
【選択図】 図5
PROBLEM TO BE SOLVED: To provide a technique for easily generating boundary shape data even when a complicated shape such as a thin shape is used as a boundary.
Out of rectangular areas obtained by dividing a two-dimensional virtual plane in which a plurality of areas are set, a boundary rectangular area including a boundary portion between the set areas is divided into a predetermined number of areas (S508). The position relationship between the vertices constituting the divided area and the boundary portion in the divided area is obtained, the intersection position between the vertex or ridge line constituting the divided area and the boundary portion in the divided area is obtained, and the positional relationship and the intersection position are determined. By identifying the part that belongs to the area set in the divided area and the part that does not belong, it is possible to determine which pattern among the multiple types of patterns created in advance. Determine (S505).
[Selection] Figure 5

Description

本発明は、界面などの境界形状データの生成技術に関するものである。   The present invention relates to a technique for generating boundary shape data such as an interface.

近年、流体解析等、境界を扱う数値解析手法では、計算機の急速な進歩に伴い、古くから知られていた直交格子法が大規模計算に適した手法として再注目されており、直交格子上での境界形状データを生成する有力な方法の1つにカットセル法が知られている。特に2次元空間上の境界形状を扱うカットセル法は非特許文献1に開示されている。   In recent years, in the numerical analysis methods dealing with boundaries, such as fluid analysis, with the rapid progress of computers, the orthogonal lattice method that has been known for a long time has been refocused as a method suitable for large-scale computation. The cut cell method is known as one of the powerful methods for generating the boundary shape data. In particular, Non-Patent Document 1 discloses a cut cell method for handling a boundary shape in a two-dimensional space.

非特許文献1に開示されているカットセル法は、まず一様な間隔を持つ直交格子によって生成されるセル(格子で仕切られた矩形からなる領域)の集合の中から、境界セル(境界が通過するセル。境界がセルを通過する状態とは、セルの輪郭を成す稜線または頂点と境界が交わっている状態を指す)を検出する。この検出により、セルの集合内の、境界セル、非境界セル(境界が通過しないセル)が明らかになる。次に上記検出により検出された境界セルを予め用意した基本パターンと照合する。図2は、基本パターンの例を示す図である。   In the cut cell method disclosed in Non-Patent Document 1, first, a boundary cell (boundary is a boundary cell) is selected from a set of cells (regions made up of rectangles partitioned by a lattice) generated by orthogonal lattices having a uniform interval. A cell passing through (a state where the boundary passes through the cell means a state where the boundary intersects with a ridge line or a vertex forming the outline of the cell). This detection reveals boundary cells and non-boundary cells (cells through which no boundary passes) in the cell set. Next, the boundary cell detected by the above detection is collated with a basic pattern prepared in advance. FIG. 2 is a diagram illustrating an example of a basic pattern.

基本パターンとは、ある仮定に基づいて予め数え上げた境界セルのパターンであり、従来では、適切な大きさのセルで切り取られた境界が一本の線分で表現されると暗黙に仮定し、その仮定の元で考えられる全ての境界セルのパターンを数え上げることで基本パターンを作成する。この基本パターンは、境界セル内部に存在する複数の交点の接続に関する情報と、境界によって分断されたセルの断片が境界の内側外側のどちらに属するかという情報(以下、上記二つの情報をまとめて境界セル情報と呼ぶ)を有している。   A basic pattern is a pattern of boundary cells counted up in advance based on a certain assumption. Conventionally, it is implicitly assumed that a boundary cut out by an appropriately sized cell is expressed by a single line segment, A basic pattern is created by counting up all the boundary cell patterns that can be considered under the assumption. This basic pattern consists of information on the connection of multiple intersections existing inside the boundary cell and information on whether the cell fragment divided by the boundary belongs to the inside or outside of the boundary (hereinafter, the above two pieces of information are combined). Called boundary cell information).

照合の結果、境界セルと基本パターンが一致を見る場合には、基本パターンにより境界セルに関する境界セル情報が明らかになる。照合の結果、境界セルと基本パターンとの一致が見られない場合は、境界セルを分割し再照合する。上記分割は、予め定められた分割回数の上限までの範囲内で、一致を見るまで繰り返し行う。   As a result of the collation, when the boundary cell and the basic pattern are matched, the basic cell reveals the boundary cell information regarding the boundary cell. If no match is found between the border cell and the basic pattern, the border cell is divided and re-matched. The above division is repeated until a match is found within a predetermined upper limit of the number of divisions.

上記カットセル法を使用し、境界セル毎に、境界セルの稜線と境界との交点を求め、境界セル情報を使用すれば、交点を構成要素とする向き付けられた線分を用いて境界を近似表現できる。   Using the above cut cell method, for each boundary cell, find the intersection between the edge of the boundary cell and the boundary.If boundary cell information is used, the boundary is defined using the line segment that has the intersection as a component. Approximate expression.

入力された境界形状データが図3(a)、(b)に示す301,302のような形状の場合、1セル内に境界が複数存在しているため上記の方法では処理できない。しかしながら非特許文献2で開示されているbluntingと呼ばれる処理(先端部を切り落とす)を行うことで、それぞれ311,312で示すように近似表現を得られる事が知られている。   When the input boundary shape data has a shape such as 301 and 302 shown in FIGS. 3A and 3B, a plurality of boundaries exist in one cell, and thus cannot be processed by the above method. However, it is known that approximate processing can be obtained as indicated by 311 and 312 by performing a process called blunting (cutting off the tip) disclosed in Non-Patent Document 2, respectively.

図3から明らかなように同図(a)の場合は、注目しているセルのみで上記処理が行われ、同図(b)の場合は、周辺セルの情報を用いてbluntingを実行する。
J.J. Quirk、”An alternative to unstructured grids for computing gas dynamic flows around arbitrarily complex two-dimensional bodies”、Computers Fluids、Vo. 23, No. 1, pp. 125-142, 1994。 J.J. Quirk、”A CARTESIAN GRID APPROACH WITH HIERARCHICAL REFINEMENT FOR COMPRESSIBLE FLOWS”、NASA CR-194938 ICASE Report、No.94-51、pp. 23、June 1994.
As is clear from FIG. 3, in the case of FIG. 3A, the above processing is performed only on the cell of interest, and in the case of FIG. 3B, blunting is executed using information on neighboring cells.
JJ Quirk, “An alternative to unstructured grids for computing gas dynamic flows around arbitrarily complex two-dimensional bodies”, Computers Fluids, Vo. 23, No. 1, pp. 125-142, 1994. JJ Quirk, “A CARTESIAN GRID APPROACH WITH HIERARCHICAL REFINEMENT FOR COMPRESSIBLE FLOWS”, NASA CR-94938 ICASE Report, No. 94-51, pp. 23, June 1994.

しかしながら、従来の2次元のカットセル法には、以下に述べる3つの問題がある。   However, the conventional two-dimensional cut cell method has the following three problems.

1. 境界の形状が複雑である場合には、境界セルの分割を多数回実行し、その結果生成される膨大な数のセルを使用するため、数値解析での計算負荷が増大する。   1. When the shape of the boundary is complicated, the boundary cell is divided many times and the enormous number of cells generated as a result is used, so that the calculation load in the numerical analysis increases.

2. 予め定められた分割回数の上限に達した場合に、図2のような基本パターンと一致を見ない境界セル(厚みの薄い形状や、尖鋭の形状など)が存在する場合には、入力形状、もしくは格子を生成するパラメータ(分割回数の上限等)を修正しなければならない。   2. When there is a boundary cell (thin shape, sharp shape, etc.) that does not match the basic pattern as shown in FIG. Alternatively, parameters for generating a lattice (upper limit of the number of divisions, etc.) must be corrected.

3. 予め定められた分割回数の上限に達した場合に、尖鋭な部分を有する形状があれば、複雑なblunting処理を行わなければならない。   3. When the upper limit of the predetermined number of divisions is reached, if there is a shape having a sharp portion, complicated blunting processing must be performed.

本発明は以上の問題に鑑みてなされたものであり、上記問題点1,2,3を改善するための技術、特に、従来では困難であった尖鋭な部分を有する形状や、厚みの薄い形状など、複雑な形状を境界とする場合にも容易に境界形状データの生成を可能にする為の技術を提供することを目的とする。   The present invention has been made in view of the above problems, and is a technique for improving the above problems 1, 2, and 3. In particular, a shape having a sharp portion that has been difficult in the prior art, and a shape having a small thickness. An object of the present invention is to provide a technique for easily generating boundary shape data even when a complicated shape is used as a boundary.

本発明の目的を達成するために、例えば本発明の画像処理装置は以下の構成を備える。   In order to achieve the object of the present invention, for example, an image processing apparatus of the present invention comprises the following arrangement.

即ち、2次元仮想平面中に複数の領域を設定する設定手段と、
前記2次元仮想平面を複数の矩形領域に分割する分割手段と、
前記分割手段によって得られた矩形領域群のうち、前記設定手段によって設定された領域同士の境界部分を含む境界矩形領域を選択する選択手段と、
前記選択手段が選択した境界矩形領域を構成する各頂点について、当該境界矩形領域内の前記境界部分との位置関係を求める第1の計算手段と、
前記境界矩形領域を構成する頂点若しくは稜線と、前記境界矩形領域内の前記境界部分との交点位置を求める第2の計算手段と、
前記境界矩形領域を構成する各頂点と前記境界矩形領域内の前記境界部分との位置関係、及び前記境界矩形領域を構成する頂点若しくは稜線と前記境界矩形領域内の前記境界部分との交点位置を用いて、前記境界矩形領域内で前記設定手段によって設定された領域に属している部分、属していない部分を特定することで、前記境界矩形領域のパターンが、予め作成された複数種のパターンのうち何れのパターンに相当するのかを決定する決定手段と
を備えることを特徴とする。
That is, setting means for setting a plurality of regions in a two-dimensional virtual plane;
Dividing means for dividing the two-dimensional virtual plane into a plurality of rectangular regions;
A selection means for selecting a boundary rectangular area including a boundary portion between the areas set by the setting means from the rectangular area group obtained by the dividing means;
First calculation means for obtaining a positional relationship with each of the vertices constituting the boundary rectangular area selected by the selection means with the boundary portion in the boundary rectangular area;
Second calculation means for obtaining an intersection position between a vertex or a ridge line constituting the boundary rectangular area and the boundary portion in the boundary rectangular area;
The positional relationship between each vertex constituting the boundary rectangular area and the boundary part in the boundary rectangular area, and the intersection position of the vertex or ridge line constituting the boundary rectangular area and the boundary part in the boundary rectangular area And identifying a portion belonging to the region set by the setting means in the boundary rectangular region and a portion not belonging to the boundary rectangular region, so that the pattern of the boundary rectangular region is a plurality of types of patterns created in advance. And determining means for determining which pattern corresponds to the pattern.

本発明の目的を達成するために、例えば本発明の画像処理方法は以下の構成を備える。   In order to achieve the object of the present invention, for example, an image processing method of the present invention comprises the following arrangement.

即ち、2次元仮想平面中に複数の領域を設定する設定工程と、
前記2次元仮想平面を複数の矩形領域に分割する分割工程と、
前記分割工程で得られた矩形領域群のうち、前記設定工程で設定された領域同士の境界部分を含む境界矩形領域を選択する選択工程と、
前記選択工程で選択した境界矩形領域を構成する各頂点について、当該境界矩形領域内の前記境界部分との位置関係を求める第1の計算工程と、
前記境界矩形領域を構成する頂点若しくは稜線と、前記境界矩形領域内の前記境界部分との交点位置を求める第2の計算工程と、
前記境界矩形領域を構成する各頂点と前記境界矩形領域内の前記境界部分との位置関係、及び前記境界矩形領域を構成する頂点若しくは稜線と前記境界矩形領域内の前記境界部分との交点位置を用いて、前記境界矩形領域内で前記設定工程で設定された領域に属している部分、属していない部分を特定することで、前記境界矩形領域のパターンが、予め作成された複数種のパターンのうち何れのパターンに相当するのかを決定する決定工程と
を備えることを特徴とする。
That is, a setting step for setting a plurality of regions in a two-dimensional virtual plane;
A dividing step of dividing the two-dimensional virtual plane into a plurality of rectangular regions;
A selection step of selecting a boundary rectangular region including a boundary portion between the regions set in the setting step among the rectangular region group obtained in the dividing step;
A first calculation step for obtaining a positional relationship with each of the vertices constituting the boundary rectangular region selected in the selection step with the boundary portion in the boundary rectangular region;
A second calculation step for obtaining an intersection position between a vertex or a ridge line constituting the boundary rectangular area and the boundary portion in the boundary rectangular area;
The positional relationship between each vertex constituting the boundary rectangular area and the boundary part in the boundary rectangular area, and the intersection position of the vertex or ridge line constituting the boundary rectangular area and the boundary part in the boundary rectangular area By using the boundary rectangular area to identify the part that belongs to the area set in the setting step and the part that does not belong to the boundary rectangular area, the pattern of the boundary rectangular area is a plurality of patterns created in advance. And a determining step for determining which pattern corresponds to the pattern.

本発明の構成により、上記問題点1,2,3を改善することができる。特に、従来では困難であった尖鋭な部分を有する形状や、厚みの薄い形状など、複雑な形状を境界とする場合にも容易に境界形状データの生成を可能にすることができる。   The above problems 1, 2, and 3 can be improved by the configuration of the present invention. In particular, it is possible to easily generate boundary shape data even when a complicated shape such as a shape having a sharp portion or a thin shape, which has been difficult in the past, is used as a boundary.

以下添付図面を参照して、本発明を好適な実施形態に従って詳細に説明する。   Hereinafter, the present invention will be described in detail according to preferred embodiments with reference to the accompanying drawings.

図4は、以下説明する各処理を実行する画像処理装置として機能するコンピュータのハードウェア構成を示すブロック図である。   FIG. 4 is a block diagram illustrating a hardware configuration of a computer that functions as an image processing apparatus that executes each process described below.

401はCPUで、RAM404にロードされたプログラムやデータを用いて本コンピュータ全体の制御を行うと共に、コンピュータが行う後述の各処理を実行する。   Reference numeral 401 denotes a CPU that controls the entire computer using programs and data loaded in the RAM 404 and executes each process described below performed by the computer.

402は表示装置で、CRTや液晶画面などにより構成されており、CPU401による処理結果を画像や文字などでもって表示する。   A display device 402 includes a CRT, a liquid crystal screen, and the like, and displays a processing result by the CPU 401 using an image or a character.

403は入力装置で、キーボードやマウスなどにより構成されており、本コンピュータの操作者が操作することで、各種の指示をCPU401に対して入力することができる。   Reference numeral 403 denotes an input device, which includes a keyboard, a mouse, and the like. Various instructions can be input to the CPU 401 by an operator of the computer.

404はRAMで、外部記憶装置405からロードされたプログラムやデータを一時的に記憶するためのエリア、通信装置406が外部から受信したプログラムやデータを一時的に記憶するためのエリア、そして、CPU401が各種の処理を実行する際に用いるワークエリア等、各種のエリアを適宜提供することができる。   Reference numeral 404 denotes a RAM, an area for temporarily storing programs and data loaded from the external storage device 405, an area for temporarily storing programs and data received from the outside by the communication device 406, and a CPU 401. Various areas such as a work area used when executing various processes can be provided as appropriate.

405は外部記憶装置で、ハードディスクドライブ装置に代表される大容量情報記憶装置であって、ここにOS(オペレーティングシステム)や、コンピュータが行う後述の各処理をCPU401に実行させるためのプログラムやデータが保存されており、これらはCPU401による制御に従ってRAM404にロードされ、CPU401による処理対象となる。   Reference numeral 405 denotes an external storage device, which is a large-capacity information storage device typified by a hard disk drive device. These are stored, loaded into the RAM 404 under the control of the CPU 401, and are processed by the CPU 401.

406は通信装置であって、LANやインターネットなどのネットワークを介して外部装置とのデータ通信を行うものであり、外部記憶装置405に保存されているとするプログラムやデータの一部若しくは全部は、通信装置406により適宜外部装置から受信してRAM404に転送するようにしても良い。   A communication device 406 performs data communication with an external device via a network such as a LAN or the Internet. Some or all of programs and data stored in the external storage device 405 are: The communication device 406 may appropriately receive from an external device and transfer it to the RAM 404.

407は上述の各部を繋ぐバスである。   A bus 407 connects the above-described units.

次に、仮想の2次元平面上で流体力学計算などの計算処理を行う場合について説明する。上述の通り、仮想の2次元平面上でこのような計算処理を行う場合には、先ず、この2次元仮想平面上に例えば流体の内部領域、外部領域等のように、複数の領域を設定する必要がある。このように複数の領域を設定するということは同時に、領域同士の境界(界面)を設定することに等価である。   Next, a case where calculation processing such as fluid dynamics calculation is performed on a virtual two-dimensional plane will be described. As described above, when such a calculation process is performed on a virtual two-dimensional plane, first, a plurality of areas such as a fluid internal area and an external area are set on the two-dimensional virtual plane. There is a need. Setting a plurality of regions in this way is equivalent to setting a boundary (interface) between the regions at the same time.

次に、複数の領域を設定した2次元仮想平面を複数の矩形領域に分割する。その場合、矩形領域によっては、境界を含むものもある。以下の説明では、このように、分割された複数の矩形領域のうち、境界部分を含むものがある場合には、矩形内の境界部分を線形に近似するための処理を行う。   Next, the two-dimensional virtual plane in which a plurality of areas are set is divided into a plurality of rectangular areas. In that case, some rectangular regions include a boundary. In the following description, if there is a plurality of divided rectangular areas including a boundary portion, processing for approximating the boundary portion in the rectangle linearly is performed.

図5は、このような処理のフローチャートである。なお、同図のフローチャートに従った処理をCPU401に実行させるためのプログラムやデータは外部記憶装置405に保存されており、これをCPU401による制御に従って適宜RAM404にロードし、CPU401がこれを用いて処理を実行することで、本コンピュータは以下説明する各処理を実行する。   FIG. 5 is a flowchart of such processing. Note that programs and data for causing the CPU 401 to execute the processing according to the flowchart of FIG. 10 are stored in the external storage device 405, which is appropriately loaded into the RAM 404 under the control of the CPU 401, and the CPU 401 uses the processing. By executing this, the computer executes each process described below.

先ず、2次元仮想平面上に設定する各領域を定義するデータ(境界形状データ)を外部記憶装置405からRAM404にロードする(ステップS500)。例えば2次元仮想平面上で固体と流体との界面を扱う流体解析計算処理を行う場合には、境界の内側が固体、外側が流体等、境界の内側外側の情報が必要となる。よって境界形状データは、境界の形状を示すと共に、この境界を境にどの側が内側でどの側が外側なのかを示すものである。本実施形態では境界形状データは、陰関数の組み合わせにより定義される。   First, data (boundary shape data) defining each region set on the two-dimensional virtual plane is loaded from the external storage device 405 to the RAM 404 (step S500). For example, when performing a fluid analysis calculation process that handles an interface between a solid and a fluid on a two-dimensional virtual plane, information on the inside and outside of the boundary is required, such as solid inside and fluid outside. Therefore, the boundary shape data indicates the shape of the boundary, and indicates which side is the inner side and which side is the outer side with respect to the boundary. In the present embodiment, the boundary shape data is defined by a combination of implicit functions.

例えば図6に示す円形において円形領域の内部DinはDin={(x、y)|x+y−1<0}と定義されるし、円形領域の外部DoutはDout={(x、y)|x+y−1>0}と定義される。 For example, in the circle shown in FIG. 6, the inner Din of the circular region is defined as Din = {(x, y) | x 2 + y 2 −1 <0}, and the outer Dout of the circular region is Dout = {(x, y ) | X 2 + y 2 −1> 0}.

また、図7に示す三角形の領域において、領域内部DinはC言語等のプログラミング言語を意識した不等式の論理演算式
(y−2x−1<0)∩(y+2x−1<0)∩(y>0)
でもって定義される。
In addition, in the triangular area shown in FIG. 7, the internal area Din is an inequality logical operation expression (y−2x−1 <0) 0 (y + 2x−1 <0) ∩ (y>) in consideration of a programming language such as C language. 0)
It is therefore defined.

このように、領域内部Dinは3つの集合Ain={(x、y)|y−2x−1<0}、Bin={(x、y)|y+2x−1<0}、Cin={(x、y)|y>0}の論理積Ai∩Bin∩Cinでもって定義される。   In this way, the region internal Din has three sets Ain = {(x, y) | y-2x-1 <0}, Bin = {(x, y) | y + 2x-1 <0}, Cin = {(x , Y) | y> 0} is defined by the logical product Ai∩Bin∩Cin.

一方、図7に示す三角形の領域の外部Doutは、Aout={(x、y)|y−2x−1>0}、Bout={(x、y)|y+2x−1>0}、Cout={(x、y)|y<0}の論理和Aout∪Bout∪Coutでもって定義される。   On the other hand, the external Dout of the triangular area shown in FIG. 7 is Aout = {(x, y) | y−2x−1> 0}, Bout = {(x, y) | y + 2x−1> 0}, Cout = It is defined by the logical sum Aout∪Bout∪Cout of {(x, y) | y <0}.

また、図7に示す三角形の領域上Dは、(Din∪Dout)でもって定義される。ここで(A)は、集合Aの補集合を表す。 Further, a triangular area D shown in FIG. 7 is defined by c (Din∪Dout). Here, c (A) represents a complement of the set A.

このような不等式の論理演算による境界形状の表現は、C言語等のプログラミング言語で用意されている条件式と真偽値を使用することで、容易に実現できる。   The expression of the boundary shape by the logical operation of such an inequality can be easily realized by using a conditional expression and a true / false value prepared in a programming language such as C language.

このように、2次元仮想平面上に設定されたそれぞれの領域の境界の形状、及び、2次元仮想平面上の各位置がその領域の内部/外部に位置するのかを示す境界形状データをRAM404にロードする。   In this way, the boundary shape data indicating the shape of the boundary of each region set on the two-dimensional virtual plane and whether each position on the two-dimensional virtual plane is located inside / outside the region is stored in the RAM 404. Load it.

次に、2次元仮想平面を複数の矩形領域に分割する(ステップS501)。即ち、2次元仮想平面上に格子点を格子状に配置することで、格子点で囲まれた領域(矩形領域)毎に2次元仮想平面を分割する。なお、矩形領域の縦横のサイズについては特に限定するものではない。   Next, the two-dimensional virtual plane is divided into a plurality of rectangular areas (step S501). That is, by arranging lattice points in a lattice shape on the two-dimensional virtual plane, the two-dimensional virtual plane is divided for each region (rectangular region) surrounded by the lattice points. The vertical and horizontal sizes of the rectangular area are not particularly limited.

図8は、複数の矩形領域に分割された2次元仮想平面の一部の例を示す図である。同図において800は2次元仮想平面の一部を示すものであり、同図に示す如く、2次元仮想平面は複数の矩形領域に分割されている。また、同図において803は境界を示すものであり、上記境界形状データでもって定義されるものである。   FIG. 8 is a diagram illustrating an example of a part of a two-dimensional virtual plane divided into a plurality of rectangular regions. In the figure, reference numeral 800 denotes a part of the two-dimensional virtual plane, and the two-dimensional virtual plane is divided into a plurality of rectangular areas as shown in the figure. In the figure, reference numeral 803 denotes a boundary, which is defined by the boundary shape data.

また同図において802は、境界803が通過している矩形領域(境界部分803を含む矩形領域)であり、801は、境界803が通過していない矩形領域(境界部分803を含まない矩形領域)である。ここで、境界部分を含む矩形領域とは、矩形領域の輪郭を成す稜線や頂点と境界部分との交点が存在するような矩形領域である。以下では、境界部分を含む矩形領域を境界矩形領域と呼称する。   In the figure, reference numeral 802 denotes a rectangular region through which the boundary 803 passes (rectangular region including the boundary portion 803), and reference numeral 801 denotes a rectangular region through which the boundary 803 does not pass (rectangular region not including the boundary portion 803). It is. Here, the rectangular area including the boundary portion is a rectangular area where there are intersections between ridgelines and vertices forming the outline of the rectangular area and the boundary portion. Hereinafter, the rectangular area including the boundary portion is referred to as a boundary rectangular area.

図5に戻って、次に、それぞれの矩形領域を順次参照し(ステップS502)、参照した矩形領域が境界矩形領域であるのか否かを判断する(ステップS503)。ここで、矩形領域が境界矩形領域であるのか否かを判断するための処理について説明する。   Returning to FIG. 5, next, the respective rectangular areas are sequentially referred to (step S502), and it is determined whether or not the referenced rectangular area is a boundary rectangular area (step S503). Here, a process for determining whether or not the rectangular area is a boundary rectangular area will be described.

例えば、境界矩形領域を構成する全ての稜線と境界との交点の個数を用いる方法がある。境界が境界矩形領域の頂点上を通る場合や、境界の先端部が境界矩形領域の外側から境界矩形領域の稜線に接している場合などは、最小の交点の個数をもつ場合であり、その個数は1である。もちろん、非境界矩形領域の交点の個数は0である。   For example, there is a method of using the number of intersections between all the ridgelines constituting the boundary rectangular area and the boundary. When the boundary passes over the vertex of the boundary rectangular area, or when the tip of the boundary touches the edge of the boundary rectangular area from the outside of the boundary rectangular area, it is the case with the minimum number of intersections. Is 1. Of course, the number of intersections of the non-boundary rectangular areas is zero.

一方、矩形領域における交点の個数の最大値は、境界形状の複雑さと矩形領域の大きさに依存するため無限である。   On the other hand, the maximum value of the number of intersections in the rectangular area is infinite because it depends on the complexity of the boundary shape and the size of the rectangular area.

従って、注目する矩形領域の稜線と境界との交点の個数をNとした場合に、N>0であればこの注目する矩形領域は境界矩形領域、それ以外であれば非境界矩形領域であると判別する。なお、矩形領域が境界矩形領域であるのか否かを判別するための処理についてはこれに限定するものではない。   Therefore, when the number of intersections between the ridge line and the boundary of the rectangular area of interest is N, if N> 0, the rectangular area of interest is a boundary rectangular area; otherwise, it is a non-boundary rectangular area. Determine. Note that the processing for determining whether or not the rectangular area is a boundary rectangular area is not limited to this.

従って、ステップS502で参照した矩形領域がステップS503で非境界矩形領域であると判別された場合には、処理をステップS507に進め、未だ参照していない矩形領域がある場合には処理をステップS502に戻し、次の矩形領域について以降の処理を行う。一方、ステップS502で参照した矩形領域がステップS503で境界矩形領域であると判別された場合には、処理をステップS504に進め、以降ではステップS502で参照した矩形領域を分割するのであるが、ステップS504では、この分割する回数が予め定められた回数に達したのか否かを判断する。   Therefore, if it is determined in step S503 that the rectangular area referred to in step S502 is a non-boundary rectangular area, the process proceeds to step S507. If there is a rectangular area that has not yet been referenced, the process proceeds to step S502. Then, the subsequent processing is performed for the next rectangular area. On the other hand, if it is determined in step S503 that the rectangular area referred to in step S502 is a boundary rectangular area, the process proceeds to step S504, and thereafter, the rectangular area referred to in step S502 is divided. In S504, it is determined whether or not the number of divisions has reached a predetermined number.

ここで、境界矩形領域の分割とは、図18に示す如く、1つの境界矩形領域を再帰的に分割することである。同図では4分木分割ステップで分割が行われている。よって、ステップS504では、図18の場合、現在の分割が4分木における階層の深さに達したのか否かを判断することになる。   Here, the division of the boundary rectangular area is to recursively divide one boundary rectangular area as shown in FIG. In the figure, the division is performed in the quadtree division step. Therefore, in step S504, in the case of FIG. 18, it is determined whether or not the current division has reached the depth of the hierarchy in the quadtree.

ステップS504で、境界矩形領域の分割回数が予め定められた回数に達していない場合には処理をステップS508に進め、境界矩形領域を分割し、それぞれの分割境界矩形領域についてステップS502以降の処理を行う。   If the number of divisions of the boundary rectangular area has not reached the predetermined number in step S504, the process proceeds to step S508, the boundary rectangular area is divided, and the processes in and after step S502 are performed for each divided boundary rectangular area. Do.

一方、ステップS504で、境界矩形領域を予め定められた回数だけ分割していた場合には処理をステップS505に進め、外部記憶装置405に保存されている複数の基本パターンのうち、分割境界矩形領域が何れの基本パターンに相当するのか(最も近いのか)を判断する。なお、ここではステップS508により必要な回数だけ分割後に、ステップS505の判断を行なうようにしたが、分割前や分割する毎にステップS505の判断を行なうようにしてもよい。   On the other hand, if the boundary rectangular area has been divided a predetermined number of times in step S504, the process proceeds to step S505, and among the plurality of basic patterns stored in the external storage device 405, the divided boundary rectangular area. To which basic pattern corresponds (closest). Although the determination in step S505 is performed after the necessary number of divisions in step S508 here, the determination in step S505 may be performed before or every time the image is divided.

ここで、本実施形態では、境界矩形領域(分割境界矩形領域)内に含まれている境界部分の形状は2本以下の線分でもって表現されるものであるとする。従って、基本パターンはこのような仮定を満たす様々な形状の境界部分を含む境界矩形領域を示すものである。このような基本パターンは予め作成され、データとして外部記憶装置405に保存されているものである。   Here, in the present embodiment, it is assumed that the shape of the boundary portion included in the boundary rectangular area (divided boundary rectangular area) is expressed by two or less line segments. Therefore, the basic pattern indicates a boundary rectangular area including boundary portions of various shapes that satisfy such an assumption. Such a basic pattern is created in advance and stored in the external storage device 405 as data.

図9は、このような基本パターンを作成する為の処理のフローチャートである。なお、同図のフローチャートに従った処理は、上述の通り、図5に示したフローチャートに従った処理の実行前に事前に行われているものである。   FIG. 9 is a flowchart of processing for creating such a basic pattern. The process according to the flowchart of FIG. 5 is performed in advance before the execution of the process according to the flowchart shown in FIG. 5 as described above.

ステップ1:矩形領域内に1つの線分が存在する全ての場合を数え上げる。この中には、右回りに0°、90°、180°、270°回転させると一致するパターンが含まれている。   Step 1: Count all cases where one line segment exists in the rectangular area. This includes patterns that match when rotated clockwise by 0 °, 90 °, 180 °, and 270 °.

ステップ2:ステップ1で数え上げられたパターン群に対し、右回りに0°、90°、180°、270°回転させると一致するパターンを1つのパターンとしてまとめる。   Step 2: Patterns that coincide when rotated clockwise by 0 °, 90 °, 180 °, and 270 ° with respect to the pattern group counted in Step 1 are collected as one pattern.

ステップ3:ステップ1とステップ2で得られた2種類のパターン群からそれぞれ1つずつ選ぶ全ての組み合わせから、2本の線分が通るパターンを作成する。   Step 3: A pattern through which two line segments pass is created from all combinations selected one by one from the two types of pattern groups obtained in Step 1 and Step 2.

ステップ4:ステップ3で作成されるパターン群の内、線分が交差する可能性のあるパターンについて、図10に示すように、更に、
(状況1) 2本の線分が交差する場合
(状況2) 2本の線分が交差しない場合
(状況3) 2本の線分が稜線上で交差する場合
に分ける。
Step 4: As for the patterns in which the line segments may intersect among the pattern group created in Step 3, as shown in FIG.
(Situation 1) Case where two line segments intersect (Situation 2) Case where two line segments do not intersect (Situation 3) The case where two line segments intersect on the ridgeline is divided.

ステップ5:境界が不等式の論理演算式の領域で与えられることを考慮し、(状況1)について、図11に示す例のように、4つのパターンに分ける。   Step 5: Considering that the boundary is given in the area of the inequality logical operation expression, (Situation 1) is divided into four patterns as in the example shown in FIG.

以上の順序で数え上げた境界矩形領域のパターン群をまとめることによって、図12に示すような基本パターン群を得る。図12は、本実施形態で用いる基本パターン群の例を示す図である。同図に示す例では、それぞれの基本パターンでの回転対象性をまとめている。   The basic pattern group as shown in FIG. 12 is obtained by collecting the pattern groups of the boundary rectangular areas counted in the above order. FIG. 12 is a diagram illustrating an example of a basic pattern group used in the present embodiment. In the example shown in the same figure, the rotation objectivity in each basic pattern is summarized.

次に、分割境界矩形領域が何れの基本パターンに一致するのかを決定する処理について詳細に説明する。   Next, a process for determining which basic pattern the divided boundary rectangular area matches will be described in detail.

先ず、分割境界矩形領域内で、境界形状データが示す領域の内側に属している部分、外側に属している部分を特定する処理を行う。   First, in the divided boundary rectangular area, a process of specifying a part belonging to the inner side and a part belonging to the outer side of the area indicated by the boundary shape data is performed.

そのためには先ず、分割境界矩形領域を構成する4つの頂点のそれぞれが、境界形状データが定義する領域の内側、外側、境界上の何れに属しているのかをチェックする。   For this purpose, first, it is checked whether each of the four vertices constituting the divided boundary rectangular area belongs to the inside, the outside, or the boundary of the area defined by the boundary shape data.

例えば図13Aの左側に示すように、分割境界矩形領域1301と領域1302との位置関係が同図に示すような状態である場合、同図右側に示すように分割境界矩形領域を構成する4つの頂点のうち左上隅の頂点(黒丸で示した頂点)以外の3頂点(白丸で示した頂点)が領域1302の内側に含まれており、左上隅の頂点のみが境界1302の外側に位置する。   For example, as shown on the left side of FIG. 13A, when the positional relationship between the divided boundary rectangular area 1301 and the area 1302 is in the state shown in the figure, the four constituting the divided boundary rectangular area are shown on the right side of the figure. Among the vertices, three vertices (vertices indicated by white circles) other than the vertices at the upper left corner (vertices indicated by black circles) are included inside the region 1302, and only the vertices at the upper left corner are located outside the boundary 1302.

なお、それぞれの頂点が、境界形状データが定義する領域の内側、外側、境界上の何れに属しているのかをチェックする方法については様々なものが考えられるが、本実施形態では境界形状データは、領域を定義するための不等式の論理演算式を用いたものであるので、任意の座標位置をこの不等式の左辺に代入し、その結果が正負、または0であるかどうかによって、この任意の座標位置が、境界形状データが定義する領域の内側、外側、境界上の何れに属しているのかをチェックすることができる。そして、頂点が境界形状データが定義する領域の内側、外側、境界上の何れに属しているのかを示す値を、この頂点に対して設定する。   There are various methods for checking whether each vertex belongs to the inside, outside, or on the boundary of the region defined by the boundary shape data, but in this embodiment, the boundary shape data is Since the inequality logical operation expression for defining the region is used, an arbitrary coordinate position is assigned to the left side of the inequality, and this arbitrary coordinate is determined depending on whether the result is positive or negative or 0. It can be checked whether the position belongs to the inside, the outside, or the boundary of the region defined by the boundary shape data. Then, a value indicating whether the vertex belongs to the inside, the outside, or the boundary of the area defined by the boundary shape data is set for this vertex.

本実施形態では、境界形状データが定義する領域の内側に頂点が位置する場合にはこの頂点に対して「0」を設定し、外側に頂点が位置する場合にはこの頂点に対して「1」を設定し、境界上に位置する場合にはこの頂点に対して「2」を設定する。これにより、1つの分割境界矩形領域を構成するそれぞれの頂点には値(以下、内外判定値と呼称する)が設定されることになる。   In the present embodiment, when the vertex is located inside the area defined by the boundary shape data, “0” is set for this vertex, and when the vertex is located outside, “1” is set for this vertex. "Is set, and if it is located on the boundary," 2 "is set for this vertex. As a result, a value (hereinafter referred to as an inside / outside determination value) is set for each vertex constituting one division boundary rectangular area.

以上の処理により、分割境界矩形領域を構成するそれぞれの頂点が、境界形状データが定義する領域の内側、外側、境界上の何れに属しているのかをチェックすることができる。   With the above processing, it is possible to check whether each vertex constituting the divided boundary rectangular area belongs to the inside, the outside, or the boundary of the area defined by the boundary shape data.

また、図14Aの左側に示すように、分割境界矩形領域1301と領域1302との位置関係が同図に示すような状態である場合(即ち図13Aの左側に示すような状態)、分割境界矩形領域を構成する稜線(頂点を含む)と領域1302の境界との交点は同図右側に示す如く、2点求まる。   Further, as shown on the left side of FIG. 14A, when the positional relationship between the divided boundary rectangular area 1301 and the area 1302 is in the state shown in the figure (that is, the state shown on the left side of FIG. 13A), the divided boundary rectangular area As shown on the right side of the figure, two intersection points between the edge lines (including vertices) constituting the area and the boundary of the area 1302 are obtained.

よって、分割境界矩形領域1301と領域1302の内側との位置関係が図13Aの左側に示すような状態である場合、分割境界矩形領域内において、この交点間を結ぶ線分を境界として一方側が領域1302の内側、他方側が領域1302の外側と定義することができるが、この線分を境界として一方側に位置する1つの頂点は内外判定値が「1」、他方側に位置する3つの頂点は内外判定値が「0」であることから、この線分を境界として左上側が領域1302の外側、その残りが内側であるとすることができる。   Therefore, when the positional relationship between the divided boundary rectangular area 1301 and the inner side of the area 1302 is as shown on the left side of FIG. 13A, one side is an area in the divided boundary rectangular area with a line segment connecting the intersections as a boundary. The inner side and the other side of 1302 can be defined as the outer side of the region 1302. One vertex located on one side with this line segment as the boundary has an inside / outside judgment value of “1”, and the three vertices located on the other side are Since the inside / outside determination value is “0”, it can be assumed that the upper left side is outside the region 1302 and the rest is inside the line segment as a boundary.

また、分割境界矩形領域1301と領域1302との位置関係は図13Bの左側に示すようなものも考えられ、このような状態である場合、同図右側に示すように分割境界矩形領域1301を構成する4つの頂点のうち左上隅の頂点以外の3頂点が領域1302の内側に含まれており、左上隅の頂点のみが領域1302の境界上に位置する。   Further, the positional relationship between the divided boundary rectangular area 1301 and the area 1302 may be as shown on the left side of FIG. 13B. In such a state, the divided boundary rectangular area 1301 is configured as shown on the right side of the figure. Among the four vertices, three vertices other than the vertex at the upper left corner are included inside the region 1302, and only the vertex at the upper left corner is located on the boundary of the region 1302.

また、分割境界矩形領域1301と領域1302の内側との位置関係が図14Bの左側に示すようなものも考えられ、このような状態である場合、分割境界矩形領域1301を構成する稜線(頂点を含む)と領域1302との交点は同図右側に示す如く、3点求まる。   Further, the positional relationship between the divided boundary rectangular area 1301 and the inner side of the area 1302 may be considered as shown on the left side of FIG. 14B. In such a state, the edge lines (vertices) constituting the divided boundary rectangular area 1301 are considered. 3) are obtained as shown on the right side of FIG.

このようにして、分割境界矩形領域内で、境界形状データが示す領域の内側に属している部分、外側に属している部分を特定することができる。   In this way, it is possible to specify a part belonging to the inner side and a part belonging to the outer side of the area indicated by the boundary shape data in the divided boundary rectangular area.

なお、図15の1501に示すように、境界形状データが示す領域1508と分割境界矩形領域1507との位置関係では、1530に示す如く、分割境界矩形領域1507を構成する4つの頂点1521〜1524のうち、頂点1521、1524が領域1508の外側、頂点1522、1523が領域1508の内側に位置すると共に、領域1508と分割境界矩形領域1507との交点は1541〜1544となる。   As indicated by reference numeral 1501 in FIG. 15, the positional relationship between the area 1508 indicated by the boundary shape data and the divided boundary rectangular area 1507 includes four vertices 1521 to 1524 constituting the divided boundary rectangular area 1507 as indicated by 1530. Among them, the vertices 1521 and 1524 are located outside the area 1508, the vertices 1522 and 1523 are located inside the area 1508, and the intersection points of the area 1508 and the divided boundary rectangular area 1507 are 1541 to 1544.

一方、1502に示すように、境界形状データが示す領域1510、1511と分割境界矩形領域1507との位置関係では、1530に示す如く、分割境界矩形領域1507を構成する4つの頂点1521〜1524のうち、頂点1521、1524が領域1510、1511の外側、頂点1522、1523がそれぞれ領域1511、1510の内側に位置すると共に、領域1510と分割境界矩形領域1507との交点は1542、1543となり、領域1511と分割境界矩形領域1507との交点は1541、1544となる。   On the other hand, as indicated by 1502, in the positional relationship between the areas 1510 and 1511 indicated by the boundary shape data and the divided boundary rectangular area 1507, as indicated by 1530, among the four vertices 1521 to 1524 constituting the divided boundary rectangular area 1507 , Vertices 1521 and 1524 are located outside the areas 1510 and 1511, and vertices 1522 and 1523 are located inside the areas 1511 and 1510, respectively, and intersections of the area 1510 and the divided boundary rectangular area 1507 are 1542 and 1543, The intersection points with the divided boundary rectangular area 1507 are 1541 and 1544.

即ち、境界形状データが示す領域と分割境界矩形領域との位置関係が1501,1502に示すようにそれぞれ異なる位置関係であったとしても、各頂点に設定した内外判定値の配置関係は同じであるし、交点位置も同じである。これでは、分割境界矩形領域内で、境界形状データが示す領域の内側に属している部分、外側に属している部分を一意に特定することはできない。   That is, even if the positional relationship between the area indicated by the boundary shape data and the divided boundary rectangular area is different as indicated by 1501 and 1502, the arrangement relation of the inside / outside determination values set at each vertex is the same. The intersection position is also the same. This makes it impossible to uniquely identify a portion belonging to the inside of the region indicated by the boundary shape data and a portion belonging to the outside in the divided boundary rectangular region.

そこで、1540に示す如く、分割境界矩形領域の略中心部に新たに追加点1560を設け、この追加点1560について、各頂点に対して行った内外判定処理を行う。その結果、1501で示す状態であれば、この追加点1560は「領域1508の内部である」と判定される。一方、1502で示す状態であれば、1550で示す如く、この追加点1560は「領域1510、1511の外側である」と判定される。これにより、1501、1502といったそれぞれ異なった状態においても、分割境界矩形領域内で、境界形状データが示す領域の内側に属している部分、外側に属している部分を一意に特定することができる。   Therefore, as indicated by 1540, an additional point 1560 is newly provided at substantially the center of the divided boundary rectangular area, and the inside / outside determination processing performed for each vertex is performed on this additional point 1560. As a result, in the state indicated by 1501, it is determined that the additional point 1560 is “inside the area 1508”. On the other hand, in the state indicated by 1502, as indicated by 1550, this additional point 1560 is determined to be “outside of the areas 1510 and 1511”. As a result, even in different states such as 1501 and 1502, it is possible to uniquely identify the part belonging to the inside and the part belonging to the outside of the area indicated by the boundary shape data in the divided boundary rectangular area.

図16は、以上説明した、分割境界矩形領域内で、境界形状データが示す領域の内側に属している部分、外側に属している部分を一意に特定する為の処理を示す図である。   FIG. 16 is a diagram showing processing for uniquely specifying the portion belonging to the inside and the portion belonging to the outside of the region indicated by the boundary shape data in the divided boundary rectangular region described above.

図16(a)において1601は分割境界矩形領域で、1602は境界形状データが示す領域を示す。先ず、分割境界矩形領域1601を構成するそれぞれの頂点が領域1602の内部に位置するのか、外部に位置するのかそれとも領域1602の境界上に位置するのかを判定する。その結果、左上隅の頂点のみが領域1602の外部に位置し、残りの3つの頂点が領域1602の内部に位置するので、左上隅の頂点に対しては内外判定値「2」を設定し、残りの3つの頂点のそれぞれに対しては内外判定値「1」を設定する。   In FIG. 16A, reference numeral 1601 denotes a divided boundary rectangular area, and reference numeral 1602 denotes an area indicated by the boundary shape data. First, it is determined whether each vertex constituting the divided boundary rectangular area 1601 is located inside the area 1602, located outside, or located on the boundary of the area 1602. As a result, only the top left corner vertex is located outside the area 1602, and the remaining three vertices are located inside the area 1602, so the inside / outside determination value “2” is set for the top left corner vertex, An inside / outside determination value “1” is set for each of the remaining three vertices.

次に、分割境界矩形領域1601の稜線(頂点を含む)と領域1602との交点を求める。その結果2つの交点が求まる。よって、内外判定値の配置関係、及び交点位置により、分割境界矩形領域1601内で領域1602の内部に属する部分と属していない部分とを示すパターンは1610で示すパターン、即ち、図12に示した基本パターンのうち(k)のパターンに一致する。これにより、分割境界矩形領域1601がどの基本パターンに一致するのかを決定することができる。   Next, the intersection point between the edge (including the vertex) of the divided boundary rectangular area 1601 and the area 1602 is obtained. As a result, two intersection points are obtained. Accordingly, the pattern indicating the part belonging to the inside of the area 1602 and the part not belonging to the inside of the area 1602 in the divided boundary rectangular area 1601 according to the arrangement relation of the inside / outside determination value and the intersection position is the pattern indicated by 1610, that is, as shown in FIG. Of the basic patterns, it matches the pattern (k). Thereby, it is possible to determine which basic pattern the divided boundary rectangular area 1601 matches.

一方、図16(b)において1601は分割境界矩形領域で、1603は境界形状データが示す領域を示す。先ず、分割境界矩形領域1601を構成するそれぞれの頂点が領域1603の内部に位置するのか、外部に位置するのかそれとも領域1603の境界上に位置するのかを判定する。その結果、左上隅、右下隅の頂点のみが領域1603の外部に位置し、残りの2つの頂点が領域1603の内部に位置するので、左上隅、右下隅の頂点に対しては内外判定値「2」を設定し、残りの2つの頂点のそれぞれに対しては内外判定値「1」を設定する。次に、分割境界矩形領域1601の稜線(頂点を含む)と領域1603との交点を求める。その結果4つの交点が求まる。   On the other hand, in FIG. 16B, reference numeral 1601 denotes a divided boundary rectangular area, and reference numeral 1603 denotes an area indicated by the boundary shape data. First, it is determined whether each vertex constituting the divided boundary rectangular area 1601 is located inside the area 1603, located outside, or located on the boundary of the area 1603. As a result, only the vertices at the upper left corner and the lower right corner are located outside the area 1603 and the remaining two vertices are located inside the area 1603. Therefore, the inside / outside determination value “ 2 ”is set, and an inside / outside determination value“ 1 ”is set for each of the remaining two vertices. Next, the intersection of the edge (including the vertex) of the divided boundary rectangular area 1601 and the area 1603 is obtained. As a result, four intersection points are obtained.

しかし、このような場合、内外判定値の配置関係、及び交点位置だけでは、分割境界矩形領域1601内で領域1603の内部に属する部分と属していない部分とを一意に特定することはできない。そこでこのような場合には追加点を分割境界矩形領域1601の略中心部に設け、この追加点について内外判定処理を行う。その結果、この追加点は領域1603の内部に位置していると判断することができるので、この追加点に対して内外判定値「1」を設定する。これにより分割境界矩形領域1601内で領域1603の内部に属する部分と属していない部分とを示すパターンは1620で示すパターン、即ち、図12に示した基本パターンのうち(o)のパターンに一致する。これにより、分割境界矩形領域1601がどの基本パターンに一致するのかを決定することができる。   However, in such a case, the part belonging to the inside of the area 1603 and the part not belonging to the inside of the area 1603 in the divided boundary rectangular area 1601 cannot be uniquely specified only by the arrangement relation of the inside / outside determination value and the intersection position. Therefore, in such a case, an additional point is provided at a substantially central portion of the divided boundary rectangular area 1601, and the inside / outside determination process is performed for this additional point. As a result, it can be determined that the additional point is located inside the area 1603, and therefore, the inside / outside determination value “1” is set for the additional point. As a result, the pattern indicating the part belonging to the inside of the area 1603 and the part not belonging to the area 1603 in the divided boundary rectangular area 1601 matches the pattern indicated by 1620, that is, the pattern (o) of the basic patterns shown in FIG. . Thereby, it is possible to determine which basic pattern the divided boundary rectangular area 1601 matches.

なお、分割境界矩形領域が何れの基本パターンとも一致しない場合には、予め指定された分割回数により生成される分割境界矩形領域の大きさが、境界形状に対して適切ではないと判断し、その旨を伝える警告文を表示し終了する。   If the division boundary rectangular area does not match any basic pattern, it is determined that the size of the division boundary rectangular area generated by the number of divisions specified in advance is not appropriate for the boundary shape, and Display a warning message to the effect and exit.

図5に戻って、ステップS505で分割境界矩形領域に一致する基本パターンを決定すると、処理をステップS506に進め、分割境界矩形領域はこれに一致する基本パターンでもって、交点の接続と境界の内側外側が明確になっているため、後述する向き付けられた線分データを作成する(ステップS506)。   Returning to FIG. 5, when the basic pattern that matches the division boundary rectangular area is determined in step S505, the process proceeds to step S506, and the division boundary rectangular area has the basic pattern that matches this, and is connected to the intersection and inside the boundary. Since the outside is clear, oriented line segment data to be described later is created (step S506).

即ち、交点間を結ぶ線分のデータを作成する。なお、この線分は向き付けられているとする。即ち、二次元空間に存在する点v1と点v2によって構成されている線分は、[v1v2]と記述することを前提とする。従って、2次元空間に存在する点v1と点v2によって構成される線分は、[v1v2]と記述することによって、点v1から点v2へ向かうとき、右を外側、左を内側と定義する。   That is, data of line segments connecting the intersections is created. It is assumed that this line segment is oriented. That is, it is assumed that the line segment constituted by the points v1 and v2 existing in the two-dimensional space is described as [v1v2]. Accordingly, the line segment constituted by the points v1 and v2 existing in the two-dimensional space is described as [v1v2], thereby defining the right as the outside and the left as the inside when going from the point v1 to the point v2.

図17において1700を点v1、1701を点v2とすると、上側が内側で下側が外側ということになる。こうして生成された線分を定義するデータ(例えばv1v2のように、順序付の線分の構成要素からなる)を以下、線分データと呼ぶ。   In FIG. 17, if 1700 is a point v1, and 1701 is a point v2, the upper side is the inside and the lower side is the outside. The data defining the line segment generated in this way (for example, composed of ordered line segment components such as v1v2) is hereinafter referred to as line segment data.

そして処理をステップS507に進め、未だ参照していない矩形領域(もしくは分割境界矩形領域)がある場合には処理をステップS502に戻し、次の矩形領域(もしくは分割境界矩形領域)について以降の処理を行うのであるが、全ての矩形領域(もしくは分割境界矩形領域)を参照した場合には本処理を終了する。   Then, the process proceeds to step S507, and if there is a rectangular area (or divided boundary rectangular area) that has not been referred to yet, the process returns to step S502, and the subsequent processes are performed for the next rectangular area (or divided boundary rectangular area). However, if all rectangular areas (or divided boundary rectangular areas) are referred to, this processing is terminated.

以上説明した処理により、1つの分割境界矩形領域内における境界部分を線分でもって表すことができるので、1つの分割境界矩形領域について1つの線分データを作成することができる。   By the processing described above, a boundary portion in one divided boundary rectangular area can be represented by a line segment, so that one line segment data can be created for one divided boundary rectangular area.

次に、境界形状データが示す領域が以下の式が示す領域である場合に、以上説明した処理によって得られる領域の形状について説明する。   Next, the shape of the region obtained by the above-described processing when the region indicated by the boundary shape data is a region represented by the following expression will be described.

(y−1.2x+0.1>0)∩(y−0.8x−0.1<0)∩
(y−0.8x+0.1>0)∩(y−1.2x−0.1<0)∩
(y+1.2x+0.1>0)∩(y+0.8x−0.1<0)∩
(y+0.8x+0.1>0)∩(y+1.2x−0.1<0)
図20は、このような式で表される領域を示す図である。同図において点線部分が各不等式を等式とした場合の直線で、実線部分で囲まれた領域が上記式が示す領域である。このような領域を2次元仮想平面上に設定し、その後この2次元仮想平面を矩形領域に分割した後に、境界矩形領域について対応する基本パターンを決定すると、境界矩形領域については基本パターンでもって表現することができ、その結果、図1に示した形状の領域が得られる。
(Y−1.2x + 0.1> 0) ∩ (y−0.8x−0.1 <0) ∩
(Y−0.8x + 0.1> 0) ∩ (y−1.2x−0.1 <0) ∩
(Y + 1.2x + 0.1> 0) ∩ (y + 0.8x−0.1 <0) ∩
(Y + 0.8x + 0.1> 0) ∩ (y + 1.2x−0.1 <0)
FIG. 20 is a diagram illustrating a region represented by such an expression. In the figure, the dotted line portion is a straight line when each inequality is an equation, and the region surrounded by the solid line portion is the region indicated by the above equation. When such a region is set on a two-dimensional virtual plane, and then the two-dimensional virtual plane is divided into rectangular regions, a corresponding basic pattern is determined for the boundary rectangular region, and the boundary rectangular region is expressed by the basic pattern. As a result, an area having the shape shown in FIG. 1 is obtained.

即ち、このような尖鋭を有する多角形で表現される形状等、複雑な形状に対して、従来の方法では境界形状データの生成が困難であったが、本実施形態によると、容易に実現される。   That is, it is difficult to generate boundary shape data by a conventional method for a complicated shape such as a shape represented by a polygon having a sharp point, but according to this embodiment, it is easily realized. The

また、以上の処理により得られた線分データに対し、図19に示す処理を行う事により、従来法と同じく矩形領域内に1つの直線が通る場合に制限した線分データを作成することができる。図中のステップS1900では、基本パターンとして図2に示す線分が1つ通るパターンを使用する。   Further, by performing the process shown in FIG. 19 on the line segment data obtained by the above process, line segment data restricted when one straight line passes through the rectangular area as in the conventional method can be created. it can. In step S1900 in the figure, a pattern in which one line segment shown in FIG. 2 passes is used as a basic pattern.

また、本発明の目的は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記録媒体(または記憶媒体)を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記録媒体に格納されたプログラムコードを読み出し実行することによっても、達成されることは言うまでもない。この場合、記録媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記録した記録媒体は本発明を構成することになる。   Also, an object of the present invention is to supply a recording medium (or storage medium) in which a program code of software that realizes the functions of the above-described embodiments is recorded to a system or apparatus, and the computer (or CPU or Needless to say, this can also be achieved when the MPU) reads and executes the program code stored in the recording medium. In this case, the program code itself read from the recording medium realizes the functions of the above-described embodiment, and the recording medium on which the program code is recorded constitutes the present invention.

また、コンピュータが読み出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an operating system (OS) running on the computer based on the instruction of the program code. It goes without saying that a case where the function of the above-described embodiment is realized by performing part or all of the actual processing and the processing is included.

さらに、記録媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込まれた後、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。   Furthermore, after the program code read from the recording medium is written into a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer, the function is based on the instruction of the program code. It goes without saying that the CPU or the like provided in the expansion card or the function expansion unit performs part or all of the actual processing and the functions of the above-described embodiments are realized by the processing.

本発明を上記記録媒体に適用する場合、その記録媒体には、先に説明したフローチャートに対応するプログラムコードが格納されることになる。   When the present invention is applied to the recording medium, program code corresponding to the flowchart described above is stored in the recording medium.

図20に示した領域を2次元仮想平面上に設定し、その後この2次元仮想平面を矩形領域に分割した後に、境界矩形領域について対応する基本パターンでもって表現した場合の形状の領域を示す図である。20 is a diagram showing a region having a shape when the region shown in FIG. 20 is set on a two-dimensional virtual plane, and then the two-dimensional virtual plane is divided into rectangular regions, and then the boundary rectangular region is expressed with a corresponding basic pattern. It is. 基本パターンの例を示す図である。It is a figure which shows the example of a basic pattern. 境界形状データが示す形状の例を示す図である。It is a figure which shows the example of the shape which boundary shape data shows. 画像処理装置として機能するコンピュータのハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the computer which functions as an image processing apparatus. 分割された複数の矩形領域のうち、境界部分を含むものがある場合には、矩形内の境界部分を線形に近似するための処理のフローチャートである。FIG. 10 is a flowchart of a process for linearly approximating a boundary part in a rectangle when there is a part including a boundary part among a plurality of divided rectangular areas. 境界形状データが示す形状、及びその内外の例を示す図である。It is a figure which shows the example which the shape which boundary shape data shows, and its inside and outside. 境界形状データが示す形状、及びその内外の例を示す図である。It is a figure which shows the example which the shape which boundary shape data shows, and its inside and outside. 複数の矩形領域に分割された2次元仮想平面の一部の例を示す図である。It is a figure which shows the example of a part of two-dimensional virtual plane divided | segmented into the several rectangular area. 基本パターンを作成する為の処理のフローチャートである。It is a flowchart of the process for creating a basic pattern. 線分が交差する可能性のあるパターンの例を示す図である。It is a figure which shows the example of the pattern which a line segment may cross | intersect. ステップ5で分けられる4つのパターンを示す図である。It is a figure which shows four patterns divided | segmented by step 5. FIG. 本発明の実施形態で用いる基本パターン群の例を示す図である。It is a figure which shows the example of the basic pattern group used by embodiment of this invention. 分割境界矩形領域1301の各頂点と領域1302との位置関係を説明する図である。FIG. 10 is a diagram for explaining the positional relationship between each vertex of a divided boundary rectangular area 1301 and an area 1302. 分割境界矩形領域1301の各頂点と領域1302との位置関係を説明する図である。FIG. 10 is a diagram for explaining the positional relationship between each vertex of a divided boundary rectangular area 1301 and an area 1302. 分割境界矩形領域1301の稜線と領域1302との交点を示す図である。It is a figure which shows the intersection of the ridgeline of the division | segmentation boundary rectangular area | region 1301, and the area | region 1302. FIG. 分割境界矩形領域1301の稜線と領域1302との交点を示す図である。It is a figure which shows the intersection of the ridgeline of the division | segmentation boundary rectangular area | region 1301, and the area | region 1302. FIG. 境界形状データが示す領域と分割境界矩形領域との位置関係がそれぞれ異なる位置関係である場合の、各頂点に設定した内外判定値の配置関係、交点位置を示す図である。It is a figure which shows the arrangement | positioning relationship of the inside / outside determination value set to each vertex, and an intersection position when the positional relationship between the area | region which boundary shape data shows, and a division | segmentation boundary rectangular area is respectively different. 分割境界矩形領域内で、境界形状データが示す領域の内側に属している部分、外側に属している部分を一意に特定する為の処理を示す図である。It is a figure which shows the process for specifying uniquely the part which belongs to the inner side of the area | region which boundary shape data shows, and the part which belongs to the outer side in a division | segmentation boundary rectangular area. 線分データを説明する図である。It is a figure explaining line segment data. 境界矩形領域の分割を説明する図である。It is a figure explaining division | segmentation of a boundary rectangular area | region. 矩形領域内に1つの直線が通る場合に制限した線分データを作成する為の処理のフローチャートである。It is a flowchart of the process for producing the line segment data restrict | limited when one straight line passes in a rectangular area. 領域の形状の例を示す図である。It is a figure which shows the example of the shape of an area | region.

Claims (7)

2次元仮想平面中に複数の領域を設定する設定手段と、
前記2次元仮想平面を複数の矩形領域に分割する分割手段と、
前記分割手段によって得られた矩形領域群のうち、前記設定手段によって設定された領域同士の境界部分を含む境界矩形領域を選択する選択手段と、
前記選択手段が選択した境界矩形領域を構成する各頂点について、当該境界矩形領域内の前記境界部分との位置関係を求める第1の計算手段と、
前記境界矩形領域を構成する頂点若しくは稜線と、前記境界矩形領域内の前記境界部分との交点位置を求める第2の計算手段と、
前記境界矩形領域を構成する各頂点と前記境界矩形領域内の前記境界部分との位置関係、及び前記境界矩形領域を構成する頂点若しくは稜線と前記境界矩形領域内の前記境界部分との交点位置を用いて、前記境界矩形領域内で前記設定手段によって設定された領域に属している部分、属していない部分を特定することで、前記境界矩形領域のパターンが、予め作成された複数種のパターンのうち何れのパターンに相当するのかを決定する決定手段と
を備えることを特徴とする画像処理装置。
Setting means for setting a plurality of regions in a two-dimensional virtual plane;
Dividing means for dividing the two-dimensional virtual plane into a plurality of rectangular regions;
A selection means for selecting a boundary rectangular area including a boundary portion between the areas set by the setting means from the rectangular area group obtained by the dividing means;
First calculation means for obtaining a positional relationship with each of the vertices constituting the boundary rectangular area selected by the selection means with the boundary portion in the boundary rectangular area;
Second calculation means for obtaining an intersection position between a vertex or a ridge line constituting the boundary rectangular area and the boundary portion in the boundary rectangular area;
The positional relationship between each vertex constituting the boundary rectangular area and the boundary part in the boundary rectangular area, and the intersection position of the vertex or ridge line constituting the boundary rectangular area and the boundary part in the boundary rectangular area And identifying a portion belonging to the region set by the setting means in the boundary rectangular region and a portion not belonging to the boundary rectangular region, so that the pattern of the boundary rectangular region is a plurality of types of patterns created in advance. An image processing apparatus comprising: a determining unit that determines which pattern corresponds to the pattern.
前記決定手段が決定したパターンの矩形領域を構成する頂点若しくは稜線と、当該矩形領域内で前記境界部分に相当する部分との交点を求めた後に、交点同士を結ぶ線分を求めることを特徴とする請求項1に記載の画像処理装置。   After determining the intersection between the vertex or ridge line constituting the rectangular area of the pattern determined by the determining means and the portion corresponding to the boundary portion in the rectangular area, a line segment connecting the intersections is obtained. The image processing apparatus according to claim 1. 前記第1の計算手段は、前記選択手段が選択した矩形領域を構成する各頂点について、当該矩形領域内の前記境界部分上に位置するのか、若しくは前記設定手段が設定した領域の内外の何れに位置するのかに応じた値を求めることを特徴とする請求項1又は2に記載の画像処理装置。   The first calculating means is located on the boundary portion in the rectangular area for each vertex constituting the rectangular area selected by the selecting means or inside or outside the area set by the setting means. The image processing apparatus according to claim 1, wherein a value corresponding to whether it is located is obtained. 前記決定手段は、前記選択手段が選択した矩形領域を構成する各頂点について前記第1の計算手段が求めた値の配置、及び当該矩形領域を構成する頂点若しくは稜線と当該矩形領域内の前記境界部分との交点位置を用いて、当該矩形領域内で、前記設定手段によって設定された領域に属している部分、属していない部分を特定することで、当該矩形領域のパターンが、予め作成された複数種のパターンのうち何れのパターンに相当するのかを決定することを特徴とする請求項3に記載の画像処理装置。   The determining means includes an arrangement of values obtained by the first calculating means for each vertex constituting the rectangular area selected by the selecting means, and a vertex or ridge line constituting the rectangular area and the boundary in the rectangular area A pattern of the rectangular region is created in advance by specifying a portion belonging to the region set by the setting means and a portion not belonging to the rectangular region using the intersection position with the portion. The image processing apparatus according to claim 3, wherein a pattern corresponding to one of a plurality of types of patterns is determined. 2次元仮想平面中に複数の領域を設定する設定工程と、
前記2次元仮想平面を複数の矩形領域に分割する分割工程と、
前記分割工程で得られた矩形領域群のうち、前記設定工程で設定された領域同士の境界部分を含む境界矩形領域を選択する選択工程と、
前記選択工程で選択した境界矩形領域を構成する各頂点について、当該境界矩形領域内の前記境界部分との位置関係を求める第1の計算工程と、
前記境界矩形領域を構成する頂点若しくは稜線と、前記境界矩形領域内の前記境界部分との交点位置を求める第2の計算工程と、
前記境界矩形領域を構成する各頂点と前記境界矩形領域内の前記境界部分との位置関係、及び前記境界矩形領域を構成する頂点若しくは稜線と前記境界矩形領域内の前記境界部分との交点位置を用いて、前記境界矩形領域内で前記設定工程で設定された領域に属している部分、属していない部分を特定することで、前記境界矩形領域のパターンが、予め作成された複数種のパターンのうち何れのパターンに相当するのかを決定する決定工程と
を備えることを特徴とする画像処理方法。
A setting step for setting a plurality of regions in a two-dimensional virtual plane;
A dividing step of dividing the two-dimensional virtual plane into a plurality of rectangular regions;
A selection step of selecting a boundary rectangular region including a boundary portion between the regions set in the setting step among the rectangular region group obtained in the dividing step;
A first calculation step for obtaining a positional relationship with each of the vertices constituting the boundary rectangular region selected in the selection step with the boundary portion in the boundary rectangular region;
A second calculation step for obtaining an intersection position between a vertex or a ridge line constituting the boundary rectangular area and the boundary portion in the boundary rectangular area;
The positional relationship between each vertex constituting the boundary rectangular area and the boundary part in the boundary rectangular area, and the intersection position of the vertex or ridge line constituting the boundary rectangular area and the boundary part in the boundary rectangular area By using the boundary rectangular area to identify the part that belongs to the area set in the setting step and the part that does not belong to the boundary rectangular area, the pattern of the boundary rectangular area is a plurality of patterns created in advance. An image processing method comprising: a determining step for determining which pattern corresponds to the pattern.
コンピュータに請求項5に記載の画像処理方法を実行させることを特徴とするプログラム。   A program causing a computer to execute the image processing method according to claim 5. 請求項6に記載のプログラムを格納したことを特徴とする、コンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 6.
JP2005148560A 2005-05-20 2005-05-20 Image processing apparatus and image processing method Withdrawn JP2006323780A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005148560A JP2006323780A (en) 2005-05-20 2005-05-20 Image processing apparatus and image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005148560A JP2006323780A (en) 2005-05-20 2005-05-20 Image processing apparatus and image processing method

Publications (1)

Publication Number Publication Date
JP2006323780A true JP2006323780A (en) 2006-11-30

Family

ID=37543393

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005148560A Withdrawn JP2006323780A (en) 2005-05-20 2005-05-20 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP2006323780A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072917A (en) * 2008-09-18 2010-04-02 Fujitsu Ltd Plotting device
JP2010140101A (en) * 2008-12-09 2010-06-24 Fujitsu Ltd Drawing device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072917A (en) * 2008-09-18 2010-04-02 Fujitsu Ltd Plotting device
JP2010140101A (en) * 2008-12-09 2010-06-24 Fujitsu Ltd Drawing device

Similar Documents

Publication Publication Date Title
CN115170580A (en) Plate processing control method and device, computer equipment and storage medium
CN103093036A (en) Simulation of the machining of a workpiece
CN113971309B (en) Model generation method, device, computer equipment and storage medium
CN113724401B (en) Three-dimensional model cutting method and device, computer equipment and storage medium
RU2430421C2 (en) Applying effects to merged text path
JP4893148B2 (en) Shape simplification device and program used therefor
CN111783180B (en) Drawing splitting method and related device
CN117521221A (en) Building model conversion method, device, equipment and storage medium
US10558770B1 (en) Finite element based direct modeling
CN120030948A (en) A CAD model surface processing method, device, equipment and medium
CN113486848A (en) Document table identification method, device, equipment and storage medium
US20140081604A1 (en) Computer-implemented method of identifying a group of perforations
CN116628123A (en) Method and system for generating dynamic slices based on spatial database
CN110633484A (en) Method and device for generating bridge disease schematic diagram
JP2006323780A (en) Image processing apparatus and image processing method
Laukotka et al. A digitized approach to reduce assembly conflicts during aircraft cabin conversions
CN103970925A (en) Contact Surface Definition Creation Involving Low Order And Quadratic Finite Elements In A Numerical Simulation Of An Impact Event
CN113033085A (en) Particle swarm optimization and Bezier curve-based particle shape simulation method and system
CN103065306A (en) Processing method and device of graphic data
CN112231801A (en) BIM-based hole protection generation method, device and computer storage medium
CN119005443A (en) Automatic typesetting method and device for two-dimensional graph
CN118918262A (en) Point cloud data screening method, equipment and storage medium
US20180052948A1 (en) Analysis mesh manufacturing equipment and method
CN117057296A (en) Method for automatically generating characteristic line width of metal layer
US11361482B2 (en) Triangle element division method, modeling apparatus, computer readable medium storing program, and data defining two-dimensional planar figure

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080805