jp.nyatla.nyar4psg
クラス SingleNyIdMarker

java.lang.Object
  上位を拡張 jp.nyatla.nyar4psg.SingleNyIdMarker

public class SingleNyIdMarker
extends java.lang.Object

このクラスは、1個のNyIdマーカを認識することができます。 映像からマーカを1個検出し、そのID番号と行列を返します。

 

EN: -

作成者:
nyatla

フィールドの概要
 processing.core.PVector angle
          マーカのx,y,zの傾き角度です。
static int CS_LEFT
          LeftHand座標系であることを示します。
static int CS_RIGHT
          RightHand座標系であることを示します。
 int markerid
          検知しているNyIdマーカのIDです。
 int[][] pos2d
          検出したマーカの4隅の2次元画像上の位置です。
 double[] projection
          OpenGLスタイルのProjectionMatrixです。
static int ST_NEWMARKER
          detectの返すステータス値です。
static int ST_NOMARKER
          detectの返すステータス値です。
static int ST_REMOVEMARKER
          detectの返すステータス値です。
static int ST_UPDATEMARKER
          detectの返すステータス値です。
 processing.core.PVector trans
          マーカのx,y,zの平行移動量です。
 double[] transmat
          検出したマーカの変換行列です。
 java.lang.String VERSION
          バージョン文字列です。
 
コンストラクタの概要
SingleNyIdMarker(processing.core.PApplet parent, int i_width, int i_height, java.lang.String i_cparam, int i_projection_coord_system)
          
EN: -
 
メソッドの概要
 void beginTransform(processing.opengl.PGraphicsOpenGL i_pgl)
          座標変換を実行したMatrixを準備します。
 int detect(processing.core.PImage i_image)
          
EN: -
 void endTransform()
          beginTransformによる座標変換を解除して元に戻します。
 void setIdMarkerSize(double i_width)
          Idマーカノサイズを設定します。
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

ST_NOMARKER

public static final int ST_NOMARKER
detectの返すステータス値です。
EN: -

関連項目:
定数フィールド値

ST_NEWMARKER

public static final int ST_NEWMARKER
detectの返すステータス値です。
EN: -

関連項目:
定数フィールド値

ST_UPDATEMARKER

public static final int ST_UPDATEMARKER
detectの返すステータス値です。
EN: -

関連項目:
定数フィールド値

ST_REMOVEMARKER

public static final int ST_REMOVEMARKER
detectの返すステータス値です。
EN: -

関連項目:
定数フィールド値

markerid

public int markerid
検知しているNyIdマーカのIDです。
EN: -


angle

public processing.core.PVector angle
マーカのx,y,zの傾き角度です。
EN: The angle value in radian unit of "x,y,z" .


trans

public processing.core.PVector trans
マーカのx,y,zの平行移動量です。
EN: The translation value in radian unit of "x,y,z".


pos2d

public int[][] pos2d
検出したマーカの4隅の2次元画像上の位置です。
EN: The position of 4 corner of marker.


transmat

public double[] transmat
検出したマーカの変換行列です。
EN: The transform matrix of detected marker.


CS_RIGHT

public static final int CS_RIGHT
RightHand座標系であることを示します。 この値はコンストラクタで使います。
EN: -

関連項目:
定数フィールド値

CS_LEFT

public static final int CS_LEFT
LeftHand座標系であることを示します。 この値はコンストラクタで使います。
EN: -

関連項目:
定数フィールド値

VERSION

public final java.lang.String VERSION
バージョン文字列です。
EN: version string.

関連項目:
定数フィールド値

projection

public final double[] projection
OpenGLスタイルのProjectionMatrixです。
EN: OpenGL form projection matrix.

コンストラクタの詳細

SingleNyIdMarker

public SingleNyIdMarker(processing.core.PApplet parent,
                        int i_width,
                        int i_height,
                        java.lang.String i_cparam,
                        int i_projection_coord_system)

EN: -

パラメータ:
parent -
EN: -
i_width -
EN: -
i_height -
EN: -
i_cparam -
EN: -
i_projection_coord_system -
EN: -
メソッドの詳細

setIdMarkerSize

public void setIdMarkerSize(double i_width)
Idマーカノサイズを設定します。
EN: This function sets size of marker.

パラメータ:
i_width - [mm]単位でのマーカサイズ
EN: size of marker in [mm] unit.

detect

public int detect(processing.core.PImage i_image)

EN: -

パラメータ:
i_image -
EN: -
戻り値:
ステータスコードを返します。
 ST_NOMARKER:
 マーカが認識されていない事を示します。
 マーカパラメータのメンバ変数は使用不可能です。
 
 ST_NEWMARKER:
 マーカが発見された事を示します。
 transmat,angle,trans,markeridメンバ変数が利用可能です。
 
 ST_UPDATEMARKER:
 マーカ座標が更新されたことを示します。
 transmat,angle,trans,markeridメンバ変数が利用可能です。
 
 ST_REMOVEMARKER:
 マーカが消失したことを示します。
 マーカパラメータのメンバ変数は使用不可能です。
 

EN: -

beginTransform

public void beginTransform(processing.opengl.PGraphicsOpenGL i_pgl)
座標変換を実行したMatrixを準備します。 この関数を実行すると、processingの座標系がマーカ表面に設定されます。 描画終了後には、必ずendTransform関数を呼び出して座標系を戻してください。
EN: This function sets corresponding transform matrix to the surface of the marker to OpenGL. The coordinate system of processing moves to the surface of the marker when this function is executed. Must return the coordinate system by using endTransform function at the end.

パラメータ:
i_pgl - PGraphicsOpenGLインスタンスを設定します。processingのgメンバをキャストして設定してください。
EN: Specify PGraphicsOpenGL instance. Set cast "g" member of processing graphics object.

endTransform

public void endTransform()
beginTransformによる座標変換を解除して元に戻します。
EN: This function recover coordinate system that was changed by beginTransform function.