9 Replies Latest reply on Feb 20, 2017 12:24 AM by MartyG

    How do i set 60fps with SR300(Color Camera , FaceTracking)

    jazz_up_feeling_0809

      Hi.

      I'm trying to set 60fps with SR300(Color Camera , FaceTracking).

      I'm using Unity and C# Script.

      C# Script sets SR300.

      When I read the specification of SR300, it was written that 720p Mode is able to set 60fps.

      But, I don't know how to set it.

      Could you teach me it??

       

      I'm writting the code below.

       

          public GameObject colorPlane; //Object to display color feed texture on

          public Texture2D colorTexture2D; //Color Texture

          private PXCMImage colorImage = null;//PXCMImage for color

       

       

          private FaceRenderer faceRenderer; //Rendererer for Visualization

          private int MaxPoints = 78;

          private PXCMSenseManager psm; //SenseManager Instance

          private pxcmStatus sts; //Check error status

          private PXCMFaceModule faceAnalyzer; //FaceModule Instance

       

      void Start () {

       

              faceRenderer = gameObject.GetComponent<FaceRenderer>();

       

       

              /* Initialize a PXCMSenseManager instance */

              psm = PXCMSenseManager.CreateInstance();

              if (psm == null)

              {

                  Debug.LogError("SenseManager Initialization Failed");

                  return;

              }

       

       

              /* Enable the color stream of size 640x480 */

              psm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 640, 480, 60);

       

       

              /* Enable the face tracking module*/

              sts = psm.EnableFace();

              if (sts != pxcmStatus.PXCM_STATUS_NO_ERROR) Debug.LogError("PXCSenseManager.EnableFace: " + sts);

       

       

              /* Retrieve an instance of face to configure */

              faceAnalyzer = psm.QueryFace();

              if (faceAnalyzer == null) Debug.LogError("PXCSenseManager.QueryFace");

       

       

              /* Initialize the execution pipeline */

              sts = psm.Init();

              if (sts != pxcmStatus.PXCM_STATUS_NO_ERROR)

              {

                  Debug.LogError("PXCMSenseManager.Init Failed");

                  OnDisable();

                  return;

              }

       

       

              /* Retrieve a PXCMFaceConfiguration instance from a face to enable Gestures and Alerts */

              PXCMFaceConfiguration config = faceAnalyzer.CreateActiveConfiguration();

      config.detection.isEnabled = true; // 3D detection is the default tracking mode.
      config.landmarks.isEnabled = true;

              config.pose.isEnabled = true;

              config.QueryExpressions().Enable();

              config.QueryExpressions().EnableExpression(PXCMFaceData.ExpressionsData.FaceExpression.EXPRESSION_MOUTH_OPEN);

              config.EnableAllAlerts();

              config.ApplyChanges();

              config.Dispose();

       

       

      }