OSDN Git Service

[NyARToolKit for java]update document
[nyartoolkit-and/nyartoolkit-and.git] / lib / src.rpf / jp / nyatla / nyartoolkit / rpf / tracker / nyartk / INyARVectorReader.java
1 /* \r
2  * PROJECT: NyARToolkit(Extension)\r
3  * --------------------------------------------------------------------------------\r
4  * The NyARToolkit is Java edition ARToolKit class library.\r
5  * Copyright (C)2008-2009 Ryo Iizuka\r
6  *\r
7  * This program is free software: you can redistribute it and/or modify\r
8  * it under the terms of the GNU General Public License as published by\r
9  * the Free Software Foundation, either version 3 of the License, or\r
10  * (at your option) any later version.\r
11  * \r
12  * This program is distributed in the hope that it will be useful,\r
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15  * GNU General Public License for more details.\r
16  *\r
17  * You should have received a copy of the GNU General Public License\r
18  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
19  * \r
20  * For further information please contact.\r
21  *      http://nyatla.jp/nyatoolkit/\r
22  *      <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
23  * \r
24  */\r
25 package jp.nyatla.nyartoolkit.rpf.tracker.nyartk;\r
26 \r
27 import jp.nyatla.nyartoolkit.NyARException;\r
28 import jp.nyatla.nyartoolkit.core.types.*;\r
29 import jp.nyatla.nyartoolkit.rpf.utils.VecLinearCoordinates;\r
30 \r
31 /**\r
32  * グレイスケールラスタに対する、特殊な画素アクセス手段を提供します。\r
33  *\r
34  */\r
35 public interface INyARVectorReader\r
36 {\r
37         /**\r
38          * RECT範囲内の画素ベクトルの合計値と、ベクトルのエッジ中心を取得します。 320*240の場合、\r
39          * RECTの範囲は(x>=0 && x<319 x+w>=0 && x+w<319),(y>=0 && y<239 x+w>=0 && x+w<319)となります。\r
40          * @param ix\r
41          * ピクセル取得を行う位置を設定します。\r
42          * @param iy\r
43          * ピクセル取得を行う位置を設定します。\r
44          * @param iw\r
45          * ピクセル取得を行う範囲を設定します。\r
46          * @param ih\r
47          * ピクセル取得を行う範囲を設定します。\r
48          * @param o_posvec\r
49          * エッジ中心とベクトルを返します。\r
50          * @return\r
51          * ベクトルの強度を返します。強度値は、差分値の二乗の合計です。\r
52          */\r
53         public int getAreaVector33(int ix, int iy, int iw, int ih,NyARVecLinear2d o_posvec);\r
54         public int getAreaVector22(int ix, int iy, int iw, int ih,NyARVecLinear2d o_posvec);\r
55 \r
56         public boolean traceConture(int i_th,\r
57                         NyARIntPoint2d i_entry, VecLinearCoordinates o_coord)\r
58                         throws NyARException;\r
59 \r
60         /**\r
61          * 点1と点2の間に線分を定義して、その線分上のベクトルを得ます。点は、画像の内側でなければなりません。 320*240の場合、(x>=0 &&\r
62          * x<320 x+w>0 && x+w<320),(y>0 && y<240 y+h>=0 && y+h<=319)となります。\r
63          * \r
64          * @param i_pos1\r
65          *            点1の座標です。\r
66          * @param i_pos2\r
67          *            点2の座標です。\r
68          * @param i_area\r
69          *            ベクトルを検出するカーネルサイズです。1の場合(n*2-1)^2のカーネルになります。 点2の座標です。\r
70          * @param o_coord\r
71          *            結果を受け取るオブジェクトです。\r
72          * @return\r
73          * @throws NyARException\r
74          */\r
75         public boolean traceLine(NyARIntPoint2d i_pos1, NyARIntPoint2d i_pos2,int i_edge, VecLinearCoordinates o_coord);\r
76 \r
77         public boolean traceLine(NyARDoublePoint2d i_pos1,NyARDoublePoint2d i_pos2, int i_edge, VecLinearCoordinates o_coord);\r
78 \r
79         /**\r
80          * 輪郭線を取得します。\r
81          * 取得アルゴリズムは、以下の通りです。\r
82          * 1.輪郭座標(n)の画素周辺の画素ベクトルを取得。\r
83          * 2.輪郭座標(n+1)周辺の画素ベクトルと比較。\r
84          * 3.差分が一定以下なら、座標と強度を保存\r
85          * 4.3点以上の集合になったら、最小二乗法で直線を計算。\r
86          * 5.直線の加重値を個々の画素ベクトルの和として返却。\r
87          */\r
88         public boolean traceConture(NyARIntCoordinates i_coord, int i_pos_mag,int i_cell_size, VecLinearCoordinates o_coord);\r
89         /**\r
90          * クリッピング付きのライントレーサです。\r
91          * \r
92          * @param i_pos1\r
93          * @param i_pos2\r
94          * @param i_edge\r
95          * @param o_coord\r
96          * @return\r
97          * @throws NyARException\r
98          */\r
99         public boolean traceLineWithClip(NyARDoublePoint2d i_pos1,\r
100                 NyARDoublePoint2d i_pos2, int i_edge, VecLinearCoordinates o_coord)\r
101                 throws NyARException;\r
102 }