public abstract class NyARSingleDetectMarker
extends java.lang.Object
簡単な使い方
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
関数に画像と敷居値を入力して、マーカを検出します。
getConfidence()
等の関数を使って、取得したマーカの状態を得ます。
修飾子とタイプ | フィールドと説明 |
---|---|
static int |
PF_ARTOOLKIT_COMPATIBLE
ARToolKit互換のアルゴリズムを選択します。
|
static int |
PF_NYARTOOLKIT
NyARToolKitのアルゴリズムを選択します。
|
static int |
PF_NYARTOOLKIT_ARTOOLKIT_FITTING
ARToolKit互換アルゴリズムと、NyARToolKitのアルゴリズムの混合です。
|
static int |
PF_TEST2
開発用定数値
|
修飾子とタイプ | メソッドと説明 |
---|---|
static NyARSingleDetectMarker |
createInstance(NyARParam i_param,
NyARCode i_code,
double i_marker_width) |
static NyARSingleDetectMarker |
createInstance(NyARParam i_param,
NyARCode i_code,
double i_marker_width,
int i_profile_id)
処理プロファイルを指定して、
NyARSingleDetectoMarker オブジェクトを生成します。 |
boolean |
detectMarkerLite(INyARRgbRaster i_raster,
int i_th)
この関数は、画像から登録済のマーカ検出を行います。
|
double |
getConfidence()
この関数は、検出したマーカーと登録済パターンとの、一致度を返します。
|
void |
getTransmat(NyARDoubleMatrix44 o_result)
この関数は、検出したマーカーの変換行列を計算して、o_resultへ値を返します。
|
void |
getTransmationMatrix(NyARDoubleMatrix44 o_result)
|
NyARSquare |
refSquare()
この関数は、マーカーの画像上の位置を格納する、
NyARSquare への参照値を返します。 |
void |
setContinueMode(boolean i_is_continue)
この関数は、変換行列の計算モードを切り替えます。
|
public static final int PF_ARTOOLKIT_COMPATIBLE
public static final int PF_NYARTOOLKIT
public static final int PF_NYARTOOLKIT_ARTOOLKIT_FITTING
public static final int PF_TEST2
public NyARSquare refSquare()
NyARSquare
への参照値を返します。
直前に実行したdetectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
が成功していないと使えません。
返却値の内容は、次にdetectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
を実行するまで有効です。public double getConfidence()
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
が成功していないと使えません。
値は、0<=n<1の間の数値を取ります。
一般的に、一致度が低い場合は、マーカを誤認識しています。public void setContinueMode(boolean i_is_continue)
i_is_continue
- TRUEなら、transMatCont互換の計算をします。 FALSEなら、transMat互換の計算をします。public void getTransmat(NyARDoubleMatrix44 o_result)
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
が成功していないと使えません。o_result
- 変換行列を受け取るオブジェクト。setContinueMode(boolean)
でtrueを設定した場合は、履歴行列としても使われます。NyARRuntimeException
public void getTransmationMatrix(NyARDoubleMatrix44 o_result)
public boolean detectMarkerLite(INyARRgbRaster i_raster, int i_th)
getTransmationMatrix(jp.nyatla.nyartoolkit.core.types.matrix.NyARDoubleMatrix44)
とgetConfidence()
から得ることができます。i_raster
- マーカーを検出する画像。画像のサイズは、コンストラクタに指定したNyARParam
オブジェクトと一致していなければなりません。i_th
- 2値化敷居値。0から256までの値を指定します。NyARRuntimeException
public static NyARSingleDetectMarker createInstance(NyARParam i_param, NyARCode i_code, double i_marker_width, int i_profile_id)
NyARSingleDetectoMarker
オブジェクトを生成します。i_param
- カメラパラメータを指定します。このサイズは、detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
に入力する画像と同じである必要があります。i_code
- 検出するマーカパターンを指定します。i_marker_width
- 正方形マーカの物理サイズをmm単位で指定します。i_input_raster_type
- detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
に入力するラスタの画素形式を指定します。
この値は、INyARRaster.getBufferType()
関数の戻り値を利用します。i_profile_id
- 計算アルゴリズムの選択値です。以下の定数のいずれかを指定します。
NyARRuntimeException
NyARRuntimeException
public static NyARSingleDetectMarker createInstance(NyARParam i_param, NyARCode i_code, double i_marker_width)