Class TofArHandManager
TofAr Handコンポーネントとの接続を管理する
下記機能を有する
- 手認識設定
- Handデータの取得
- ストリーム開始イベント通知
- ストリーム終了イベント通知
- フレーム到着通知
- ジェスチャー推定結果通知
- 録画ファイルの再生
Inheritance
Inherited Members
Namespace: TofAr.V0.Hand
Assembly: TofArHandAssembly.dll
Syntax
public class TofArHandManager : Singleton<TofArHandManager>, IStreamStoppable, IDisposable, IStreamHolder, IDependManager
Fields
autoRotate
true: 自動回転を行う
false: 自動回転を行わない
デフォルト値: true
Declaration
public bool autoRotate
Field Value
Type |
---|
System.Boolean |
autoStart
trueの場合、アプリケーション開始時に自動的にHandデータのストリームを開始する
Declaration
public bool autoStart
Field Value
Type |
---|
System.Boolean |
autoStartGestureEstimation
trueの場合、アプリケーション開始時に自動的にジェスチャー推定処理を開始する
Declaration
public bool autoStartGestureEstimation
Field Value
Type |
---|
System.Boolean |
enableBothHandsGesture
trueの場合ジェスチャー認識処理で両手ジェスチャー推定を行う
デフォルト値:false
Declaration
[HideInInspector]
public bool enableBothHandsGesture
Field Value
Type |
---|
System.Boolean |
HandCalc
手の座標処理を行うオブジェクト
Declaration
public HandCalc HandCalc
Field Value
Type |
---|
HandCalc |
HandLibraryLoadFailed
手認識ライブラリー読み込み失敗通知
Declaration
public TofArHandManager.HandLibraryLoadFailedEventHandler HandLibraryLoadFailed
Field Value
Type |
---|
TofArHandManager.HandLibraryLoadFailedEventHandler |
maxStreamStartRetry
ストリーム開始時の最大リトライ回数
Declaration
public uint maxStreamStartRetry
Field Value
Type |
---|
System.UInt32 |
transformToColorSpace
true: 手の座標をColor空間に変換する
false: 変換しない
デフォルト値: false
Declaration
public bool transformToColorSpace
Field Value
Type |
---|
System.Boolean |
Properties
BothHandsGestures
両手ジェスチャーインデックス
Declaration
public GestureIndex[] BothHandsGestures { get; }
Property Value
Type |
---|
GestureIndex[] |
DetectionThreshold
手の検出閾値。高い値ほど手が検出されにくくなる。手の誤検出が多い場合、閾値を高めに設定する。
値域:0~1.0
デフォルト値:0.5
Declaration
public double DetectionThreshold { get; set; }
Property Value
Type |
---|
System.Double |
DetectorType
認識種別
Declaration
public HandDetectorType DetectorType { get; set; }
Property Value
Type |
---|
HandDetectorType |
FrameRate
実測FPS
Declaration
public float FrameRate { get; }
Property Value
Type |
---|
System.Single |
FramesForDetectNoHands
このフレーム数のNoHandsが連続して検出されると intervalFramesNotRecognized で指定されたインターバル動作を開始する (デフォルト:3)
Declaration
public int FramesForDetectNoHands { get; set; }
Property Value
Type |
---|
System.Int32 |
FramesPerSec
ジェスチャー推定のFPS
Declaration
public int FramesPerSec { get; set; }
Property Value
Type |
---|
System.Int32 |
HandData
最新のHandデータ
Declaration
public HandData HandData { get; }
Property Value
Type |
---|
HandData |
IntervalFramesNotRecognized
手が検出されていない時の認識処理間隔フレーム数
Declaration
public int IntervalFramesNotRecognized { get; set; }
Property Value
Type |
---|
System.Int32 |
IsGestureEstimating
trueの場合ジェスチャー認識機能が有効である
Declaration
public bool IsGestureEstimating { get; }
Property Value
Type |
---|
System.Boolean |
IsPlaying
trueの場合、録画ファイルを再生している
Declaration
public bool IsPlaying { get; }
Property Value
Type |
---|
System.Boolean |
IsStreamActive
trueの場合ストリーミングを行っている
Declaration
public bool IsStreamActive { get; }
Property Value
Type |
---|
System.Boolean |
NoiseReductionLevel
スムージングモード
デフォルト値:Low
Declaration
public NoiseReductionLevel NoiseReductionLevel { get; set; }
Property Value
Type |
---|
NoiseReductionLevel |
NPointThreads
Pointスレッド数。NNLibrary=TFLiteの時有効。
Declaration
public int NPointThreads { get; set; }
Property Value
Type |
---|
System.Int32 |
NRegionThreads
Regionスレッド数。NNLibrary=TFLiteの時有効。
Declaration
public int NRegionThreads { get; set; }
Property Value
Type |
---|
System.Int32 |
ProcessLevel
認識ステップの指定
Declaration
public ProcessLevel ProcessLevel { get; set; }
Property Value
Type |
---|
ProcessLevel |
RecogMode
認識モードの指定
Declaration
public RecogMode RecogMode { get; set; }
Property Value
Type |
---|
RecogMode |
RotCorrection
手の回転補正有無
Declaration
[Obsolete("RotCorrection is obsolete and will be removed in a future version")]
public RotCorrection RotCorrection { get; set; }
Property Value
Type |
---|
RotCorrection |
RuntimeMode
実行モード(前段処理)の指定
Declaration
public RuntimeMode RuntimeMode { get; set; }
Property Value
Type |
---|
RuntimeMode |
RuntimeModeAfter
実行モード(後段処理)の指定
Declaration
public RuntimeMode RuntimeModeAfter { get; set; }
Property Value
Type |
---|
RuntimeMode |
RuntimeModeAutoSet
実行モードの自動設定ON/OFF
Declaration
public bool RuntimeModeAutoSet { get; set; }
Property Value
Type |
---|
System.Boolean |
Stream
ストリーム
Declaration
public Stream Stream { get; }
Property Value
Type |
---|
SensCord.Stream |
StreamPlay
再生ストリーム
Declaration
public Stream StreamPlay { get; }
Property Value
Type |
---|
SensCord.Stream |
SupportedProcessLevels
サポートする処理レベルリスト
Declaration
public ProcessLevel[] SupportedProcessLevels { get; }
Property Value
Type |
---|
ProcessLevel[] |
SupportedRecogModes
サポートする認識モードリスト
Declaration
public RecogMode[] SupportedRecogModes { get; }
Property Value
Type |
---|
RecogMode[] |
SupportedRuntimeModes
サポートする実行モードリスト
Declaration
public RuntimeMode[] SupportedRuntimeModes { get; }
Property Value
Type |
---|
RuntimeMode[] |
TemporalRecognitionMode
一時的認識モード
Declaration
public bool TemporalRecognitionMode { get; set; }
Property Value
Type |
---|
System.Boolean |
TrackingMode
トラッキングモード
Declaration
public bool TrackingMode { get; set; }
Property Value
Type |
---|
System.Boolean |
Version
コンポーネントのバージョン番号
Declaration
public string Version { get; }
Property Value
Type |
---|
System.String |
Methods
Dispose()
破棄処理
Declaration
public void Dispose()
Dispose(Boolean)
破棄処理
Declaration
public void Dispose(bool ignoreEventRelease)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | ignoreEventRelease | trueの場合、イベントハンドラのクリアをスキップする |
FinalizeRestartStreamByDependManager(Object)
依存するManagerから要求されたストリーミング再スタート後処理
Declaration
public void FinalizeRestartStreamByDependManager(object requestSource)
Parameters
Type | Name | Description |
---|---|---|
System.Object | requestSource | 要求元 |
GetProperty<T>()
コンポーネントプロパティを取得する
Declaration
public T GetProperty<T>()
where T : class, IBaseProperty, new()
Returns
Type | Description |
---|---|
T | プロパティクラス |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
GetProperty<T>(T, Int32)
シリアライズ用バッファサイズを指定してコンポーネントプロパティを取得する。入力パラメータvalueを指定可能。
Declaration
public T GetProperty<T>(T value, int buffersize)
where T : class, IBaseProperty, new()
Parameters
Type | Name | Description |
---|---|---|
T | value | 入力パラメータ |
System.Int32 | buffersize | シリアライズ用バッファサイズ |
Returns
Type | Description |
---|---|
T | プロパティクラス |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
GetProperty<T>(String, T)
コンポーネントプロパティを取得する。入力パラメータvalueを指定可能。
Declaration
public T GetProperty<T>(string key, T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
System.String | key | プロパティキー |
T | value | 入力パラメータ |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
GetPropertyList()
Propertyリスト取得する
Declaration
public string[] GetPropertyList()
Returns
Type | Description |
---|---|
System.String[] | Propertyリスト |
GetRuntimeMode(String)
実行モードの取得
Declaration
public RuntimeMode GetRuntimeMode(string mode)
Parameters
Type | Name | Description |
---|---|---|
System.String | mode | モード名称 |
Returns
Type | Description |
---|---|
RuntimeMode | 実行モード |
RegisterHandPreProcessing(IPreProcessHandData)
Handデータ送出前処理を登録する
Declaration
public void RegisterHandPreProcessing(IPreProcessHandData preProcessHand)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessHandData | preProcessHand | IPreProcessHandDataを実装したデータ処理クラス |
RestartStreamByDependManager(Object)
依存するManagerから要求されたストリーミング再スタートを開始する
Declaration
public void RestartStreamByDependManager(object requestSource)
Parameters
Type | Name | Description |
---|---|---|
System.Object | requestSource | 要求元 |
SetProperty<T>(T)
コンポーネントプロパティを設定する
Declaration
public void SetProperty<T>(T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | 入力パラメータ |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
SetTransformFunction(Func<Vector3[], Vector3[]>)
関節座標値の変換関数を設定する
Declaration
public void SetTransformFunction(Func<Vector3[], Vector3[]> transformFunction)
Parameters
Type | Name | Description |
---|---|---|
System.Func<UnityEngine.Vector3[], UnityEngine.Vector3[]> | transformFunction | Vector3[]型の座標リストを受け取り、変換後のVector3[]型の座標リストをリターンする関数 |
StartGestureEstimation()
ジェスチャー推定処理を開始する
Declaration
public void StartGestureEstimation()
StartPlayback()
録画ファイル再生中のToFストリームをソースとして再生を開始する
Declaration
public void StartPlayback()
StartPlayback(String)
指定されたパス内の録画ファイルの再生を開始する
Declaration
public void StartPlayback(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | 再生する録画ファイルを含むディレクトリのパス |
StartStream()
ストリーミングを開始する
Declaration
public void StartStream()
StartStream(RecognizeConfigProperty)
ストリーミングを開始する
Declaration
public void StartStream(RecognizeConfigProperty configuration)
Parameters
Type | Name | Description |
---|---|---|
RecognizeConfigProperty | configuration | 手認識設定 |
StopGestureEstimation()
ジェスチャー推定処理を停止する
Declaration
public void StopGestureEstimation()
StopPlayback()
録画ファイルの再生を停止する
Declaration
public void StopPlayback()
StopStream(Object)
ストリーミングを停止する
Declaration
public void StopStream(object sender = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | 送信元オブジェクト |
UnregisterHandPreProcessing(IPreProcessHandData)
Handデータ送出前の処理を登録解除する
Declaration
public void UnregisterHandPreProcessing(IPreProcessHandData preProcessHand)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessHandData | preProcessHand | IPreProcessHandDataを実装したデータ処理クラス |
Events
OnApplicationPausing
アプリケーション一時停止開始時
Declaration
public static event TofArHandManager.ApplicationPausingEventHandler OnApplicationPausing
Event Type
Type | Description |
---|---|
TofArHandManager.ApplicationPausingEventHandler |
OnApplicationResuming
アプリケーション復帰開始時
Declaration
public static event TofArHandManager.ApplicationResumingEventHandler OnApplicationResuming
Event Type
Type | Description |
---|---|
TofArHandManager.ApplicationResumingEventHandler |
OnFrameArrived
新しいフレームの到着通知
Declaration
public static event TofArHandManager.FrameArrivedEventHandler OnFrameArrived
Event Type
Type | Description |
---|---|
TofArHandManager.FrameArrivedEventHandler |
OnGestureEstimated
OnGestureEstimated:ジェスチャー推定が完了した時に GestureResultProperty を通知する。
Declaration
public static event TofArHandManager.GestureEstimatedEventHandler OnGestureEstimated
Event Type
Type | Description |
---|---|
TofArHandManager.GestureEstimatedEventHandler |
OnGestureEstimatedDefault
OnGestureEstimatedDefault:ジェスチャー推定の結果、ジェスチャーが検出されなかった時に GestureResultProperty を通知する。
Declaration
public static event TofArHandManager.GestureEstimatedEventHandler OnGestureEstimatedDefault
Event Type
Type | Description |
---|---|
TofArHandManager.GestureEstimatedEventHandler |
OnLeftGestureDataRead
右手ジェスチャー推定データ読み取り開始通知
Declaration
public static event TofArHandManager.GestureDataReadEventHandler OnLeftGestureDataRead
Event Type
Type | Description |
---|---|
TofArHandManager.GestureDataReadEventHandler |
OnReplacedModelFile
ジェスチャー推定モデルファイル置換通知
Declaration
public static event TofArHandManager.ModelFileReplacedEventHandler OnReplacedModelFile
Event Type
Type | Description |
---|---|
TofArHandManager.ModelFileReplacedEventHandler |
OnRightGestureDataRead
右手ジェスチャー推定データ読み取り開始通知
Declaration
public static event TofArHandManager.GestureDataReadEventHandler OnRightGestureDataRead
Event Type
Type | Description |
---|---|
TofArHandManager.GestureDataReadEventHandler |
OnStreamStarted
ストリーミング開始通知
Declaration
public static event TofArHandManager.StreamStartedEventHandler OnStreamStarted
Event Type
Type | Description |
---|---|
TofArHandManager.StreamStartedEventHandler |
OnStreamStopped
ストリーミング終了通知
Declaration
public static event TofArHandManager.StreamStoppedEventHandler OnStreamStopped
Event Type
Type | Description |
---|---|
TofArHandManager.StreamStoppedEventHandler |