Created
November 1, 2015 12:26
-
-
Save kaorun55/28c7613759479d413d6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Face | |
| if ( IsSenseOptionSet( SenseOption.SenseOptionID.Face, true ) ) { | |
| var faceModule = SenseManager.QueryFace(); | |
| var faceConfiguration = faceModule.CreateActiveConfiguration(); | |
| if ( faceConfiguration == null ) throw new UnityException( "CreateActiveConfiguration returned null" ); | |
| faceConfiguration.Update(); | |
| faceConfiguration.detection.isEnabled = true; | |
| faceConfiguration.detection.smoothingLevel = PXCMFaceConfiguration.SmoothingLevelType.SMOOTHING_DISABLED; | |
| faceConfiguration.landmarks.isEnabled = true; | |
| faceConfiguration.landmarks.smoothingLevel = PXCMFaceConfiguration.SmoothingLevelType.SMOOTHING_DISABLED; | |
| // poseはR200で使えない | |
| //faceConfiguration.pose.isEnabled = true; | |
| faceConfiguration.pose.isEnabled = false; | |
| faceConfiguration.pose.smoothingLevel = PXCMFaceConfiguration.SmoothingLevelType.SMOOTHING_DISABLED; | |
| faceConfiguration.DisableAllAlerts(); | |
| faceConfiguration.strategy = PXCMFaceConfiguration.TrackingStrategyType.STRATEGY_APPEARANCE_TIME; | |
| if ( (NumberOfDetectedFaces < 1) || (NumberOfDetectedFaces > 15) ) { | |
| Debug.Log( "Ilegal value for Number Of Detected Faces, value is set to 1" ); | |
| NumberOfDetectedFaces = 1; | |
| } | |
| faceConfiguration.detection.maxTrackedFaces = NumberOfDetectedFaces; | |
| faceConfiguration.landmarks.maxTrackedFaces = NumberOfDetectedFaces; | |
| faceConfiguration.pose.maxTrackedFaces = NumberOfDetectedFaces; | |
| // R200では表情は未サポート | |
| //PXCMFaceConfiguration.ExpressionsConfiguration expressionConfig = faceConfiguration.QueryExpressions(); | |
| //expressionConfig.Enable(); | |
| //expressionConfig.EnableAllExpressions(); | |
| faceConfiguration.ApplyChanges(); | |
| faceConfiguration.Dispose(); | |
| FaceModuleOutput = faceModule.CreateOutput(); | |
| UnsetSenseOption( SenseOption.SenseOptionID.VideoColorStream ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment