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
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
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
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
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
25 package jp.nyatla.nyartoolkit.rpf.tracker.nyartk;
\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
32 * グレイスケールラスタに対する、特殊な画素アクセス手段を提供します。
\r
35 public interface INyARVectorReader
\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
41 * ピクセル取得を行う位置を設定します。
\r
43 * ピクセル取得を行う位置を設定します。
\r
45 * ピクセル取得を行う範囲を設定します。
\r
47 * ピクセル取得を行う範囲を設定します。
\r
51 * ベクトルの強度を返します。強度値は、差分値の二乗の合計です。
\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
56 public boolean traceConture(int i_th,
\r
57 NyARIntPoint2d i_entry, VecLinearCoordinates o_coord)
\r
58 throws NyARException;
\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
69 * ベクトルを検出するカーネルサイズです。1の場合(n*2-1)^2のカーネルになります。 点2の座標です。
\r
73 * @throws NyARException
\r
75 public boolean traceLine(NyARIntPoint2d i_pos1, NyARIntPoint2d i_pos2,int i_edge, VecLinearCoordinates o_coord);
\r
77 public boolean traceLine(NyARDoublePoint2d i_pos1,NyARDoublePoint2d i_pos2, int i_edge, VecLinearCoordinates o_coord);
\r
81 * 取得アルゴリズムは、以下の通りです。
\r
82 * 1.輪郭座標(n)の画素周辺の画素ベクトルを取得。
\r
83 * 2.輪郭座標(n+1)周辺の画素ベクトルと比較。
\r
84 * 3.差分が一定以下なら、座標と強度を保存
\r
85 * 4.3点以上の集合になったら、最小二乗法で直線を計算。
\r
86 * 5.直線の加重値を個々の画素ベクトルの和として返却。
\r
88 public boolean traceConture(NyARIntCoordinates i_coord, int i_pos_mag,int i_cell_size, VecLinearCoordinates o_coord);
\r
90 * クリッピング付きのライントレーサです。
\r
97 * @throws NyARException
\r
99 public boolean traceLineWithClip(NyARDoublePoint2d i_pos1,
\r
100 NyARDoublePoint2d i_pos2, int i_edge, VecLinearCoordinates o_coord)
\r
101 throws NyARException;
\r