|
||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.nyatla.nyar4psg.NyARPsgBaseClass
jp.nyatla.nyar4psg.SingleMarkerBaseClass
class SingleMarkerBaseClass
単一マーカ認識ユースケースのベースクラス。同時に一つの座標変換行列を提供します。 座標変換行列の管理関数とプロパティ機能を提供します。
フィールドの概要 | |
---|---|
protected NyARParam |
_ar_param
ARToolkitパラメータのインスタンスです。 |
protected NyAR4PsgConfig |
_config
|
protected NyARFrustum |
_frustum
|
protected PMatrix3D |
_ps_projection
|
protected PImageRaster |
_src_raster
入力画像ラスタです。 |
PVector |
angle
推奨されていません。 この変数は互換性の為に残されています。 getMarkerMatrix() で得られる値から計算してください。 |
int[][] |
pos2d
推奨されていません。 この変数は互換性の為に残されています。 getMarkerVertex2D() の値を使用してください。 |
double[] |
projection
推奨されていません。 この変数は互換性の為に残されています。 getProjectionMatrix() で得られる値を使用してください。 |
PVector |
trans
推奨されていません。 この変数は互換性の為に残されています。 getMarkerMatrix() で得られる値から計算してください。 |
double[] |
transmat
推奨されていません。 この変数は互換性の為に残されています。 getMarkerMatrix() で得られる値を使用してください。 |
クラス jp.nyatla.nyar4psg.NyARPsgBaseClass から継承されたフィールド |
---|
_ps_background_mv, _ref_papplet, FRUSTUM_DEFAULT_FAR_CLIP, FRUSTUM_DEFAULT_NEAR_CLIP, VERSION |
コンストラクタの概要 | |
---|---|
protected |
SingleMarkerBaseClass()
|
メソッドの概要 | |
---|---|
void |
beginTransform()
この関数は、ProcessingのModelviewとProjectionをマーカ平面にセットします。 |
void |
beginTransform(PGraphics3D i_pgl)
推奨されていません。 |
void |
endTransform()
beginTransform(processing.core.PGraphics3D) でセットしたProjectionとModelViewを元に戻します。 |
PMatrix3D |
getMarkerMatrix()
この関数は、マーカの座標変換行列を返します。 |
PVector[] |
getMarkerVertex2D()
この関数は、マーカのスクリーン上の4頂点を返します。 |
PMatrix3D |
getProjectionMatrix()
[readonly]この関数は、Processing形式のProjectionMatrixの参照値を返します。 |
PMatrix3D |
getProjectionMatrix(PMatrix3D iBuf)
この関数は、ProjectionMatrixをi_bufへ複製して返します。 |
protected void |
initInstance(PApplet parent,
String i_cparam_file,
int i_width,
int i_height,
NyAR4PsgConfig i_config)
|
PImage |
pickupMarkerImage(int i_x1,
int i_y1,
int i_x2,
int i_y2,
int i_x3,
int i_y3,
int i_x4,
int i_y4,
int i_out_w_pix,
int i_out_h_pix)
この関数は、マーカの画像のXY平面上の4頂点でかこまれた領域から、画像を取得します。 |
protected PImage |
pickupMarkerImage(NyARDoubleMatrix44 i_mat,
int i_x1,
int i_y1,
int i_x2,
int i_y2,
int i_x3,
int i_y3,
int i_x4,
int i_y4,
int i_out_w_pix,
int i_out_h_pix)
PImageをラップしたラスタから画像を得ます。 |
PImage |
pickupRectMarkerImage(int i_l,
int i_t,
int i_w,
int i_h,
int i_out_w_pix,
int i_out_h_pix)
この関数は、マーカのXY平面上の矩形領域から、画像を取得します。 |
PVector |
screen2MarkerCoordSystem(int i_x,
int i_y)
この関数は、スクリーン座標を、idで指定したマーカ平面座標へ変換して返します。 |
void |
setARClipping(float i_near,
float i_far)
この関数は、視錐台のクリップ面を設定します。 |
protected void |
updateTransmat(NyARSquare i_square,
NyARDoubleMatrix44 i_src)
|
クラス jp.nyatla.nyar4psg.NyARPsgBaseClass から継承されたメソッド |
---|
drawBackground, initInstance, matResult2GLArray, matResult2PMatrix3D, nyarMat2PsMat, PMatrix2GLProjection, PMatrix2GLProjection, setARPerspective, setBackgroundOrtho, setPerspective |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
---|
protected final PMatrix3D _ps_projection
protected NyARParam _ar_param
protected final NyARFrustum _frustum
protected NyAR4PsgConfig _config
protected PImageRaster _src_raster
PImage
をラップします。継承クラスで入力画像をセットします。
public final PVector angle
getMarkerMatrix()
で得られる値から計算してください。
public final PVector trans
getMarkerMatrix()
で得られる値から計算してください。
public final int[][] pos2d
getMarkerVertex2D()
の値を使用してください。
public final double[] transmat
getMarkerMatrix()
で得られる値を使用してください。
public final double[] projection
getProjectionMatrix()
で得られる値を使用してください。
コンストラクタの詳細 |
---|
protected SingleMarkerBaseClass()
メソッドの詳細 |
---|
public PMatrix3D getProjectionMatrix()
NyARPsgBaseClass
の記述:
NyARPsgBaseClass
内の getProjectionMatrix
public PMatrix3D getProjectionMatrix(PMatrix3D iBuf)
NyARPsgBaseClass
の記述:
NyARPsgBaseClass
内の getProjectionMatrix
public void setARClipping(float i_near, float i_far)
NyARPsgBaseClass
の記述:NyARPsgBaseClass.FRUSTUM_DEFAULT_NEAR_CLIP
とNyARPsgBaseClass.FRUSTUM_DEFAULT_FAR_CLIP
です。
設定値は、次回のNyARPsgBaseClass.setARPerspective()
から影響を及ぼします。現在の設定値にただちに影響を及ぼすものではありません。
NyARPsgBaseClass
内の setARClipping
i_near
- NearPlaneの値を設定します。単位は[mm]です。i_far
- FarPlaneの値を設定します。単位は[mm]です。public PMatrix3D getMarkerMatrix()
public PVector[] getMarkerVertex2D()
public void beginTransform(PGraphics3D i_pgl)
beginTransform()
を使ってください。
i_pgl
- 通常は、PApplet.g
をキャストして指定します。public void beginTransform()
endTransform()
とペアで使います。
関数を実行すると、現在のModelView行列とProjection行列がインスタンスに保存され、新しい行列がセットされます。
これらを復帰するには、endTransform()
を使います。
public void endTransform()
beginTransform(processing.core.PGraphics3D)
でセットしたProjectionとModelViewを元に戻します。
この関数は、必ずbeginTransform(processing.core.PGraphics3D)
とペアで使います。
public PVector screen2MarkerCoordSystem(int i_x, int i_y)
i_x
- スクリーン座標を指定します。i_y
- スクリーン座標を指定します。
public PImage pickupMarkerImage(int i_x1, int i_y1, int i_x2, int i_y2, int i_x3, int i_y3, int i_x4, int i_y4, int i_out_w_pix, int i_out_h_pix)
#detect
関数に入力した画像を使います。
座標点は、[mm]単位です。出力解像度はo_outの解像度に伸縮します。
座標点の指定順序は、右手系#CS_RIGHT_HAND
なら右上から時計回りです。
座標点の指定順序は、左手系#CS_LEFT_HAND
なら左上から時計回りです。
i_x1
- 頂点座標1です。i_y1
- 頂点座標1です。i_x2
- 頂点座標2です。i_y2
- 頂点座標2です。i_x3
- 頂点座標3です。i_y3
- 頂点座標3です。i_x4
- 頂点座標4です。i_y4
- 頂点座標4です。i_out_w_pix
- 出力画像のピクセル幅です。i_out_h_pix
- 出力画像のピクセル高さです。
public PImage pickupRectMarkerImage(int i_l, int i_t, int i_w, int i_h, int i_out_w_pix, int i_out_h_pix)
i_l
- 左上の点を指定します。i_t
- 左上の点を指定します。i_w
- 矩形の幅を指定します。i_h
- 矩形の高さを指定します。i_out_w_pix
- 出力画像のピクセル幅です。i_out_h_pix
- 出力画像のピクセル高さです。
protected void updateTransmat(NyARSquare i_square, NyARDoubleMatrix44 i_src)
protected void initInstance(PApplet parent, String i_cparam_file, int i_width, int i_height, NyAR4PsgConfig i_config) throws NyARException
NyARException
protected PImage pickupMarkerImage(NyARDoubleMatrix44 i_mat, int i_x1, int i_y1, int i_x2, int i_y2, int i_x3, int i_y3, int i_x4, int i_y4, int i_out_w_pix, int i_out_h_pix)
i_mat
- i_x1
- i_y1
- i_x2
- i_y2
- i_x3
- i_y3
- i_x4
- i_y4
- i_out_w_pix
- i_out_h_pix
-
|
||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |