Class TofArHandManager
Manage the connection with TofAr Hand component
Has the following functions
- Hand recognition settings
- Get hand data
- Event for stream start
- Event for stream end
- Event for frame arrival
- Event for gesture estimation result
- Playback of recording file
Inheritance
Inherited Members
Namespace: TofAr.V0.Hand
Assembly: TofArHandAssembly.dll
Syntax
public class TofArHandManager : Singleton<TofArHandManager>, IStreamStoppable, IDisposable, IStreamHolder, IDependManager
Fields
autoRotate
true: Automatically rotate
false: Not automatically rotate
Default: true
Declaration
public bool autoRotate
Field Value
Type |
---|
System.Boolean |
autoStart
If true, Hand data stream will automatically start when the application is started
Declaration
public bool autoStart
Field Value
Type |
---|
System.Boolean |
autoStartGestureEstimation
If true, gesture estimation process will automatically start when the application is started
Declaration
public bool autoStartGestureEstimation
Field Value
Type |
---|
System.Boolean |
enableBothHandsGesture
If true, both hands gesture is recognized by gesture recognition process
Default: false
Declaration
[HideInInspector]
public bool enableBothHandsGesture
Field Value
Type |
---|
System.Boolean |
HandCalc
Object to process hand coordinates
Declaration
public HandCalc HandCalc
Field Value
Type |
---|
HandCalc |
HandLibraryLoadFailed
Event for when hand library load failed
Declaration
public TofArHandManager.HandLibraryLoadFailedEventHandler HandLibraryLoadFailed
Field Value
Type |
---|
TofArHandManager.HandLibraryLoadFailedEventHandler |
maxStreamStartRetry
Maximum stream start retry count
Declaration
public uint maxStreamStartRetry
Field Value
Type |
---|
System.UInt32 |
transformToColorSpace
true: Convert hand points to color space
false: Do not convert
Default: false
Declaration
public bool transformToColorSpace
Field Value
Type |
---|
System.Boolean |
Properties
BothHandsGestures
Both hands gesture index
Declaration
public GestureIndex[] BothHandsGestures { get; }
Property Value
Type |
---|
GestureIndex[] |
DetectionThreshold
Hand detection threshold. The higher the value is, the harder hands are detected. Set the threshold higher if false detection of hands occurs frequently.
Range: 0-1.0
Default value: 0.5
Declaration
public double DetectionThreshold { get; set; }
Property Value
Type |
---|
System.Double |
FrameRate
Actual FPS
Declaration
public float FrameRate { get; }
Property Value
Type |
---|
System.Single |
FramesForDetectNoHands
When NoHands is detected consecutively in this number of frames, the interval operation specified in intervalFramesNotRecognized will start (Default: 3)
Declaration
public int FramesForDetectNoHands { get; set; }
Property Value
Type |
---|
System.Int32 |
FramesPerSec
FPS of gesture estimation
Declaration
public int FramesPerSec { get; set; }
Property Value
Type |
---|
System.Int32 |
HandData
Latest Hand data
Declaration
public HandData HandData { get; }
Property Value
Type |
---|
HandData |
IntervalFramesNotRecognized
Number of recognition processing interval frames when no hand is detected
Declaration
public int IntervalFramesNotRecognized { get; set; }
Property Value
Type |
---|
System.Int32 |
IsGestureEstimating
If true, gesture estimation is enabled
Declaration
public bool IsGestureEstimating { get; }
Property Value
Type |
---|
System.Boolean |
IsPlaying
True if recording file is being played
Declaration
public bool IsPlaying { get; }
Property Value
Type |
---|
System.Boolean |
IsStreamActive
If true, it is streaming
Declaration
public bool IsStreamActive { get; }
Property Value
Type |
---|
System.Boolean |
NoiseReductionLevel
Noise reduction level
Default value: Low
Declaration
public NoiseReductionLevel NoiseReductionLevel { get; set; }
Property Value
Type |
---|
NoiseReductionLevel |
NPointThreads
Number of Point threads. Effective when NNLibrary=TFLite.
Declaration
public int NPointThreads { get; set; }
Property Value
Type |
---|
System.Int32 |
NRegionThreads
Number of Region threads. Effective when NNLibrary=TFLite.
Declaration
public int NRegionThreads { get; set; }
Property Value
Type |
---|
System.Int32 |
ProcessLevel
Recognition step setting
Declaration
public ProcessLevel ProcessLevel { get; set; }
Property Value
Type |
---|
ProcessLevel |
RecogMode
Recognition mode setting
Declaration
public RecogMode RecogMode { get; set; }
Property Value
Type |
---|
RecogMode |
RotCorrection
Correction of hand rotation toggle
Declaration
[Obsolete("RotCorrection is obsolete and will be removed in a future version")]
public RotCorrection RotCorrection { get; set; }
Property Value
Type |
---|
RotCorrection |
RuntimeMode
Runtime mode (Early-stage processing) setting
Declaration
public RuntimeMode RuntimeMode { get; set; }
Property Value
Type |
---|
RuntimeMode |
RuntimeModeAfter
Runtime mode (Late-stage processing) setting
Declaration
public RuntimeMode RuntimeModeAfter { get; set; }
Property Value
Type |
---|
RuntimeMode |
RuntimeModeAutoSet
Toggle for automatically setting runtime mode
Declaration
public bool RuntimeModeAutoSet { get; set; }
Property Value
Type |
---|
System.Boolean |
Stream
Stream
Declaration
public Stream Stream { get; }
Property Value
Type |
---|
SensCord.Stream |
StreamPlay
Playback stream
Declaration
public Stream StreamPlay { get; }
Property Value
Type |
---|
SensCord.Stream |
SupportedProcessLevels
List of supported process levels
Declaration
public ProcessLevel[] SupportedProcessLevels { get; }
Property Value
Type |
---|
ProcessLevel[] |
SupportedRecogModes
List of supported recognition modes
Declaration
public RecogMode[] SupportedRecogModes { get; }
Property Value
Type |
---|
RecogMode[] |
SupportedRuntimeModes
List of supported runtime modes
Declaration
public RuntimeMode[] SupportedRuntimeModes { get; }
Property Value
Type |
---|
RuntimeMode[] |
TemporalRecognitionMode
Temporal recognition mode
Declaration
public bool TemporalRecognitionMode { get; set; }
Property Value
Type |
---|
System.Boolean |
TrackingMode
Tracking mode
Declaration
public bool TrackingMode { get; set; }
Property Value
Type |
---|
System.Boolean |
Version
Component version No.
Declaration
public string Version { get; }
Property Value
Type |
---|
System.String |
Methods
Dispose()
Disposal method
Declaration
public void Dispose()
FinalizeRestartStreamByDependManager(Object)
Post-processing of stream restart requested by dependent managers
Declaration
public void FinalizeRestartStreamByDependManager(object requestSource)
Parameters
Type | Name | Description |
---|---|---|
System.Object | requestSource | Requester |
GetProperty<T>()
Get component property
Declaration
public T GetProperty<T>()
where T : class, IBaseProperty, new()
Returns
Type | Description |
---|---|
T | Property class |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
GetProperty<T>(T, Int32)
Set the size of the serialization buffer and get component properties. Input parameter value may be designated.
Declaration
public T GetProperty<T>(T value, int buffersize)
where T : class, IBaseProperty, new()
Parameters
Type | Name | Description |
---|---|---|
T | value | Input parameter |
System.Int32 | buffersize | Serialization buffer size |
Returns
Type | Description |
---|---|
T | Property class |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
GetProperty<T>(String, T)
Get property of Component. Input parameter value may be designated.
Declaration
public T GetProperty<T>(string key, T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Property key |
T | value | Input parameter |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
GetPropertyList()
Get property list
Declaration
public string[] GetPropertyList()
Returns
Type | Description |
---|---|
System.String[] | Property list |
GetRuntimeMode(String)
Get runtime mode
Declaration
public RuntimeMode GetRuntimeMode(string mode)
Parameters
Type | Name | Description |
---|---|---|
System.String | mode | Name of mode |
Returns
Type | Description |
---|---|
RuntimeMode | Runtime mode |
RegisterHandPreProcessing(IPreProcessHandData)
Register hand preprocessing
Declaration
public void RegisterHandPreProcessing(IPreProcessHandData preProcessHand)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessHandData | preProcessHand | Data processing class that implements IPreProcessHandData |
RestartStreamByDependManager(Object)
Restart stream as requested by dependent managers
Declaration
public void RestartStreamByDependManager(object requestSource)
Parameters
Type | Name | Description |
---|---|---|
System.Object | requestSource | Requester |
SetProperty<T>(T)
Set component property
Declaration
public void SetProperty<T>(T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | Input parameter |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty inherited class |
SetTransformFunction(Func<Vector3[], Vector3[]>)
Set joint position transform function
Declaration
public void SetTransformFunction(Func<Vector3[], Vector3[]> transformFunction)
Parameters
Type | Name | Description |
---|---|---|
System.Func<UnityEngine.Vector3[], UnityEngine.Vector3[]> | transformFunction | Function that takes in a Vector3 array of coordinates and returns the transformed Vector3 array |
StartGestureEstimation()
Starts gesture estimation process
Declaration
public void StartGestureEstimation()
StartPlayback()
Start playback using ToF stream from recording file being played as source
Declaration
public void StartPlayback()
StartPlayback(String)
Start playback of the recording file from the specified path
Declaration
public void StartPlayback(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Directory path of recording file to playback |
StartStream()
Start streaming
Declaration
public void StartStream()
StartStream(RecognizeConfigProperty)
Start streaming
Declaration
public void StartStream(RecognizeConfigProperty configuration)
Parameters
Type | Name | Description |
---|---|---|
RecognizeConfigProperty | configuration | Hand recognition config |
StopGestureEstimation()
Stops gesture estimation process
Declaration
public void StopGestureEstimation()
StopPlayback()
Stop playback of recording file
Declaration
public void StopPlayback()
StopStream(Object)
Stop streaming
Declaration
public void StopStream(object sender = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Caller object |
UnregisterHandPreProcessing(IPreProcessHandData)
Unregister hand preprocessing
Declaration
public void UnregisterHandPreProcessing(IPreProcessHandData preProcessHand)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessHandData | preProcessHand | Data processing class that implements IPreProcessHandData |
Events
OnApplicationPausing
Application pausing
Declaration
public static event TofArHandManager.ApplicationPausingEventHandler OnApplicationPausing
Event Type
Type | Description |
---|---|
TofArHandManager.ApplicationPausingEventHandler |
OnApplicationResuming
Application resuming
Declaration
public static event TofArHandManager.ApplicationResumingEventHandler OnApplicationResuming
Event Type
Type | Description |
---|---|
TofArHandManager.ApplicationResumingEventHandler |
OnFrameArrived
Notice on arrival of new frame
Declaration
public static event TofArHandManager.FrameArrivedEventHandler OnFrameArrived
Event Type
Type | Description |
---|---|
TofArHandManager.FrameArrivedEventHandler |
OnGestureEstimated
Sends a GestureResultProperty notice upon completion of gesture estimation.
Declaration
public static event TofArHandManager.GestureEstimatedEventHandler OnGestureEstimated
Event Type
Type | Description |
---|---|
TofArHandManager.GestureEstimatedEventHandler |
OnGestureEstimatedDefault
Result of gesture estimation, invokes a GestureResultProperty event when no gestures are detected.
Declaration
public static event TofArHandManager.GestureEstimatedEventHandler OnGestureEstimatedDefault
Event Type
Type | Description |
---|---|
TofArHandManager.GestureEstimatedEventHandler |
OnLeftGestureDataRead
Right hand gesture estimation data read started event
Declaration
public static event TofArHandManager.GestureDataReadEventHandler OnLeftGestureDataRead
Event Type
Type | Description |
---|---|
TofArHandManager.GestureDataReadEventHandler |
OnReplacedModelFile
Gesture estimation model file replaced event
Declaration
public static event TofArHandManager.ModelFileReplacedEventHandler OnReplacedModelFile
Event Type
Type | Description |
---|---|
TofArHandManager.ModelFileReplacedEventHandler |
OnRightGestureDataRead
Right hand gesture estimation data read started event
Declaration
public static event TofArHandManager.GestureDataReadEventHandler OnRightGestureDataRead
Event Type
Type | Description |
---|---|
TofArHandManager.GestureDataReadEventHandler |
OnStreamStarted
Notice on starting of streaming
Declaration
public static event TofArHandManager.StreamStartedEventHandler OnStreamStarted
Event Type
Type | Description |
---|---|
TofArHandManager.StreamStartedEventHandler |
OnStreamStopped
Notice on ending of streaming
Declaration
public static event TofArHandManager.StreamStoppedEventHandler OnStreamStopped
Event Type
Type | Description |
---|---|
TofArHandManager.StreamStoppedEventHandler |