C# Class Kinect.KinectInterop

KinectInterop is a class that contains utility and interop functions and deals with different kinds of sensor interfaces.
Mostra file Open project: BrainProject/UnityTemp Class Usage Examples

Public Properties

Property Type Description
JointBaseDir Vector3[]
SensorInterfaceOrder System.Type[]

Public Methods

Method Description
CloseSensor ( SensorData sensorData ) : void
CopyFile ( string sourceFilePath, string targetFilePath, bool &bOneCopied, bool &bAllCopied ) : bool
CopyResourceFile ( string targetFilePath, string resFileName, bool &bOneCopied, bool &bAllCopied ) : bool
DeleteNativeLib ( string sLibName, bool bUnloadLib ) : void
DrawLine ( Texture2D a_Texture, int x1, int y1, int x2, int y2, Color a_Color ) : void
FinishBackgroundRemoval ( SensorData sensorData ) : void
FreeMultiSourceFrame ( SensorData sensorData ) : void
GetBodyFrameAsCsv ( SensorData sensorData, BodyFrameData &bodyFrame, long &liRelTime, float &fUnityTime ) : string
GetForegroundFrameLength ( SensorData sensorData, bool isHiResPrefered ) : int
GetForegroundFrameRect ( SensorData sensorData, bool isHiResPrefered ) : Rect
GetMirrorJoint ( JointType joint ) : JointType
GetMultiSourceFrame ( SensorData sensorData ) : bool
GetSensorType ( ) : string
GetTargetDllPath ( string sAppPath, bool bIs64bitApp ) : string
GetUnzippedEntrySize ( string resZipFileName, string sEntryName ) : long
InitBackgroundRemoval ( SensorData sensorData, bool isHiResPrefered ) : bool
InitSensorInterfaces ( bool bOnceRestarted, bool &bNeedRestart ) : List
Is64bitArchitecture ( ) : bool
IsDirectX11Available ( ) : bool
IsOpenCvAvailable ( bool &bNeedRestart ) : bool
LoadNativeLib ( string sLibName ) : bool
MapColorFrameToDepthCoords ( SensorData sensorData, Vector2 &vDepthCoords ) : bool
MapDepthFrameToColorCoords ( SensorData sensorData, Vector2 &vColorCoords ) : bool
MapDepthPointToColorCoords ( SensorData sensorData, Vector2 depthPos, ushort depthVal ) : Vector2
MapDepthPointToSpaceCoords ( SensorData sensorData, Vector2 depthPos, ushort depthVal ) : Vector3
MapSpacePointToDepthCoords ( SensorData sensorData, Vector3 kinectPos ) : Vector2
OpenDefaultSensor ( List listInterfaces, FrameSource dwFlags, float sensorAngle, bool bUseMultiSource ) : SensorData
PollBodyFrame ( SensorData sensorData, BodyFrameData &bodyFrame, Matrix4x4 &kinectToWorld ) : bool
PollColorFrame ( SensorData sensorData ) : bool
PollDepthFrame ( SensorData sensorData, bool bLimitedUsers, ICollection alTrackedIndexes ) : bool
PollForegroundFrame ( SensorData sensorData, bool isHiResPrefered, Color32 defaultColor, bool bLimitedUsers, ICollection alTrackedIndexes, byte &fgImageFrame ) : bool
PollInfraredFrame ( SensorData sensorData ) : bool
RecalcBoneDirs ( SensorData sensorData, BodyData &bodyData ) : void
RenderDepth2ColorTex ( SensorData sensorData ) : bool
RenderTex2Tex2D ( RenderTexture rt, Texture2D &tex ) : bool
RestartLevel ( GameObject parentObject, string callerName ) : void
SetBodyFrameFromCsv ( string sCsvLine, SensorData sensorData, BodyFrameData &bodyFrame, Matrix4x4 &kinectToWorld ) : bool
UnzipResourceDirectory ( string targetDirPath, string resZipFileName, string checkForDir ) : bool
UnzipResourceFiles ( string>.Dictionary dictFilesToUnzip, string resZipFileName, bool &bOneCopied, bool &bAllCopied ) : bool
UpdateBackgroundRemoval ( SensorData sensorData, bool isHiResPrefered, Color32 defaultColor ) : bool
UpdateSensorData ( SensorData sensorData ) : bool

Private Methods

Method Description
ApplyErodeDilate ( RenderTexture source, RenderTexture destination, Material erodeMaterial, Material dilateMaterial, int erodeIterations, int dilateIterations ) : void
ApplyImageBlur ( RenderTexture source, RenderTexture destination, Material blurMaterial ) : void
CalcBodyFrameBoneDirs ( SensorData sensorData, BodyFrameData &bodyFrame ) : void
FreeLibrary ( IntPtr hModule ) : bool
GetForegroundAlphaFrame ( SensorData sensorData, bool bLimitedUsers, ICollection alTrackedIndexes, byte &fgAlphaFrame ) : bool
LoadLibrary ( [ lpFileName ) : IntPtr

Method Details

CloseSensor() public static method

public static CloseSensor ( SensorData sensorData ) : void
sensorData SensorData
return void

CopyFile() public static method

public static CopyFile ( string sourceFilePath, string targetFilePath, bool &bOneCopied, bool &bAllCopied ) : bool
sourceFilePath string
targetFilePath string
bOneCopied bool
bAllCopied bool
return bool

CopyResourceFile() public static method

public static CopyResourceFile ( string targetFilePath, string resFileName, bool &bOneCopied, bool &bAllCopied ) : bool
targetFilePath string
resFileName string
bOneCopied bool
bAllCopied bool
return bool

DeleteNativeLib() public static method

public static DeleteNativeLib ( string sLibName, bool bUnloadLib ) : void
sLibName string
bUnloadLib bool
return void

DrawLine() public static method

public static DrawLine ( Texture2D a_Texture, int x1, int y1, int x2, int y2, Color a_Color ) : void
a_Texture UnityEngine.Texture2D
x1 int
y1 int
x2 int
y2 int
a_Color Color
return void

FinishBackgroundRemoval() public static method

public static FinishBackgroundRemoval ( SensorData sensorData ) : void
sensorData SensorData
return void

FreeMultiSourceFrame() public static method

public static FreeMultiSourceFrame ( SensorData sensorData ) : void
sensorData SensorData
return void

GetBodyFrameAsCsv() public static method

public static GetBodyFrameAsCsv ( SensorData sensorData, BodyFrameData &bodyFrame, long &liRelTime, float &fUnityTime ) : string
sensorData SensorData
bodyFrame BodyFrameData
liRelTime long
fUnityTime float
return string

GetForegroundFrameLength() public static method

public static GetForegroundFrameLength ( SensorData sensorData, bool isHiResPrefered ) : int
sensorData SensorData
isHiResPrefered bool
return int

GetForegroundFrameRect() public static method

public static GetForegroundFrameRect ( SensorData sensorData, bool isHiResPrefered ) : Rect
sensorData SensorData
isHiResPrefered bool
return UnityEngine.Rect

GetMirrorJoint() public static method

public static GetMirrorJoint ( JointType joint ) : JointType
joint JointType
return JointType

GetMultiSourceFrame() public static method

public static GetMultiSourceFrame ( SensorData sensorData ) : bool
sensorData SensorData
return bool

GetSensorType() public static method

public static GetSensorType ( ) : string
return string

GetTargetDllPath() public static method

public static GetTargetDllPath ( string sAppPath, bool bIs64bitApp ) : string
sAppPath string
bIs64bitApp bool
return string

GetUnzippedEntrySize() public static method

public static GetUnzippedEntrySize ( string resZipFileName, string sEntryName ) : long
resZipFileName string
sEntryName string
return long

InitBackgroundRemoval() public static method

public static InitBackgroundRemoval ( SensorData sensorData, bool isHiResPrefered ) : bool
sensorData SensorData
isHiResPrefered bool
return bool

InitSensorInterfaces() public static method

public static InitSensorInterfaces ( bool bOnceRestarted, bool &bNeedRestart ) : List
bOnceRestarted bool
bNeedRestart bool
return List

Is64bitArchitecture() public static method

public static Is64bitArchitecture ( ) : bool
return bool

IsDirectX11Available() public static method

public static IsDirectX11Available ( ) : bool
return bool

IsOpenCvAvailable() public static method

public static IsOpenCvAvailable ( bool &bNeedRestart ) : bool
bNeedRestart bool
return bool

LoadNativeLib() public static method

public static LoadNativeLib ( string sLibName ) : bool
sLibName string
return bool

MapColorFrameToDepthCoords() public static method

public static MapColorFrameToDepthCoords ( SensorData sensorData, Vector2 &vDepthCoords ) : bool
sensorData SensorData
vDepthCoords Vector2
return bool

MapDepthFrameToColorCoords() public static method

public static MapDepthFrameToColorCoords ( SensorData sensorData, Vector2 &vColorCoords ) : bool
sensorData SensorData
vColorCoords Vector2
return bool

MapDepthPointToColorCoords() public static method

public static MapDepthPointToColorCoords ( SensorData sensorData, Vector2 depthPos, ushort depthVal ) : Vector2
sensorData SensorData
depthPos Vector2
depthVal ushort
return Vector2

MapDepthPointToSpaceCoords() public static method

public static MapDepthPointToSpaceCoords ( SensorData sensorData, Vector2 depthPos, ushort depthVal ) : Vector3
sensorData SensorData
depthPos Vector2
depthVal ushort
return Vector3

MapSpacePointToDepthCoords() public static method

public static MapSpacePointToDepthCoords ( SensorData sensorData, Vector3 kinectPos ) : Vector2
sensorData SensorData
kinectPos Vector3
return Vector2

OpenDefaultSensor() public static method

public static OpenDefaultSensor ( List listInterfaces, FrameSource dwFlags, float sensorAngle, bool bUseMultiSource ) : SensorData
listInterfaces List
dwFlags OpenCvSharp.FrameSource
sensorAngle float
bUseMultiSource bool
return SensorData

PollBodyFrame() public static method

public static PollBodyFrame ( SensorData sensorData, BodyFrameData &bodyFrame, Matrix4x4 &kinectToWorld ) : bool
sensorData SensorData
bodyFrame BodyFrameData
kinectToWorld UnityEngine.Matrix4x4
return bool

PollColorFrame() public static method

public static PollColorFrame ( SensorData sensorData ) : bool
sensorData SensorData
return bool

PollDepthFrame() public static method

public static PollDepthFrame ( SensorData sensorData, bool bLimitedUsers, ICollection alTrackedIndexes ) : bool
sensorData SensorData
bLimitedUsers bool
alTrackedIndexes ICollection
return bool

PollForegroundFrame() public static method

public static PollForegroundFrame ( SensorData sensorData, bool isHiResPrefered, Color32 defaultColor, bool bLimitedUsers, ICollection alTrackedIndexes, byte &fgImageFrame ) : bool
sensorData SensorData
isHiResPrefered bool
defaultColor UnityEngine.Color32
bLimitedUsers bool
alTrackedIndexes ICollection
fgImageFrame byte
return bool

PollInfraredFrame() public static method

public static PollInfraredFrame ( SensorData sensorData ) : bool
sensorData SensorData
return bool

RecalcBoneDirs() public static method

public static RecalcBoneDirs ( SensorData sensorData, BodyData &bodyData ) : void
sensorData SensorData
bodyData BodyData
return void

RenderDepth2ColorTex() public static method

public static RenderDepth2ColorTex ( SensorData sensorData ) : bool
sensorData SensorData
return bool

RenderTex2Tex2D() public static method

public static RenderTex2Tex2D ( RenderTexture rt, Texture2D &tex ) : bool
rt UnityEngine.RenderTexture
tex UnityEngine.Texture2D
return bool

RestartLevel() public static method

public static RestartLevel ( GameObject parentObject, string callerName ) : void
parentObject UnityEngine.GameObject
callerName string
return void

SetBodyFrameFromCsv() public static method

public static SetBodyFrameFromCsv ( string sCsvLine, SensorData sensorData, BodyFrameData &bodyFrame, Matrix4x4 &kinectToWorld ) : bool
sCsvLine string
sensorData SensorData
bodyFrame BodyFrameData
kinectToWorld UnityEngine.Matrix4x4
return bool

UnzipResourceDirectory() public static method

public static UnzipResourceDirectory ( string targetDirPath, string resZipFileName, string checkForDir ) : bool
targetDirPath string
resZipFileName string
checkForDir string
return bool

UnzipResourceFiles() public static method

public static UnzipResourceFiles ( string>.Dictionary dictFilesToUnzip, string resZipFileName, bool &bOneCopied, bool &bAllCopied ) : bool
dictFilesToUnzip string>.Dictionary
resZipFileName string
bOneCopied bool
bAllCopied bool
return bool

UpdateBackgroundRemoval() public static method

public static UpdateBackgroundRemoval ( SensorData sensorData, bool isHiResPrefered, Color32 defaultColor ) : bool
sensorData SensorData
isHiResPrefered bool
defaultColor UnityEngine.Color32
return bool

UpdateSensorData() public static method

public static UpdateSensorData ( SensorData sensorData ) : bool
sensorData SensorData
return bool

Property Details

JointBaseDir public_oe static_oe property

public static Vector3[] JointBaseDir
return Vector3[]

SensorInterfaceOrder public_oe static_oe property

public static Type[],System SensorInterfaceOrder
return System.Type[]