public class NyARDetectMarker
extends java.lang.Object
簡単な使い方
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
関数に画像と敷居値を入力して、マーカを検出します。
getARCodeIndex(int)
関数を使って、検出番号をマーカのインデクス番号に変換します。
getConfidence(int)
等の関数を使って、取得したマーカの状態を得ます。
コンストラクタと説明 |
---|
NyARDetectMarker(NyARParam i_param,
NyARCode[] i_code,
double[] i_marker_width,
int i_number_of_code)
コンストラクタです。
|
修飾子とタイプ | メソッドと説明 |
---|---|
int |
detectMarkerLite(INyARRgbRaster i_raster,
int i_threshold)
この関数は、画像からマーカを検出します。
|
int |
getARCodeIndex(int i_index)
この関数は、i_index番目に検出したマーカの、ID番号を返します。
|
double |
getConfidence(int i_index)
この関数は、i_index番目に検出したマーカの、一致度を返します。
|
void |
getTransmationMatrix(int i_index,
NyARDoubleMatrix44 o_result)
この関数は、i_index番目に検出したマーカの、変換行列を計算します。
|
void |
setContinueMode(boolean i_is_continue)
この関数は、変換行列の計算モードを切り替えます。
|
public NyARDetectMarker(NyARParam i_param, NyARCode[] i_code, double[] i_marker_width, int i_number_of_code) throws NyARException
i_param
- カメラパラメータを指定します。このサイズは、detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
に入力する画像と同じである必要があります。i_code
- 検出するマーカーパターンを格納した、NyARCode
の配列を指定します。配列には、先頭から、0から始まるID番号が割り当てられます。
このIDは、getARCodeIndex(int)
で取得できるID値であり、マーカパターンの識別に使います。
配列要素のNyARCode
は、全て同じ解像度にしてください。i_marker_width
- 正方形マーカの物理サイズをmm単位で指定します。i_number_of_code
- i_codeの有効な個数を指定します。NyARException
public int detectMarkerLite(INyARRgbRaster i_raster, int i_threshold) throws NyARException
i_raster
- マーカーを検出するイメージを指定します。i_threshold
- 検出閾値を指定します。0~255の範囲で指定してください。 通常は100~130くらいを指定します。NyARException
public void getTransmationMatrix(int i_index, NyARDoubleMatrix44 o_result) throws NyARException
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
が成功していないと使えません。i_index
- 検出結果のインデックス番号を指定します。
この値は、0からdetectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
関数の戻り値-1の数です。o_result
- 結果値を受け取るオブジェクトNyARException
public double getConfidence(int i_index)
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
が成功していないと使えません。i_index
- 検出結果のインデックス番号を指定します。
この値は、0からdetectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
関数の戻り値-1の数です。NyARException
public int getARCodeIndex(int i_index)
detectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
が成功していないと使えません。i_index
- 検出結果のインデックス番号を指定します。
この値は、0からdetectMarkerLite(jp.nyatla.nyartoolkit.core.raster.rgb.INyARRgbRaster, int)
関数の戻り値-1の数です。NyARException
public void setContinueMode(boolean i_is_continue)
i_is_continue
- TRUEなら、transMatCont互換の計算をします。 FALSEなら、transMat互換の計算をします。