5 Replies Latest reply on Oct 19, 2017 1:17 AM by MartyG

    face module in Realsense 2016 R2/R3 seems not exists.

    bryechaq

      Dear all:

       

        I installed F200 driver, Realsense 2016 R3 SDK essentials,

       

      and 2016 R2 SDK ( https://registrationcenter.intel.com/en/products/download/2508/

       

      but when I compiled the following code,  lots of .h not exits, such as:

      "pxcfacemodule.h",  "pxcfacedata.h",  "pxcfaceconfiguration.h".

       

      The code was listed below, (Retrieving Facial Landmarks using Intel RealSense SDK):

       

      -------------------------------------------------------

       

        #include<iostream>

      #include "pxccapturemanager.h"

      #include "pxcsensemanager.h"

      #include "pxcstatus.h"

      #include "pxcfacemodule.h"

      #include "pxcfacedata.h"

      #include "pxcfaceconfiguration.h"

       

      using namespace std;

       

      int MAX_FACES = 4;

      pxcI32 m_numLandmarks;

      PXCFaceData::LandmarkPoint* m_landmarkPoints;

      static const int LANDMARK_ALIGNMENT = -3;

       

      void main(int argc, char** argv)

      {

          PXCSenseManager *sm = PXCSenseManager::CreateInstance();

          pxcStatus sts;

       

       

          if(!sm){

              printf("Unable to create sense manager\n");

              return;

          }

       

          sts = sm->EnableFace();

          if(sts<PXC_STATUS_NO_ERROR) {

              printf("Unable to enable face Analysis\n");

          }

       

          sm->Init();

       

          PXCFaceModule *face=sm->QueryFace();

          PXCFaceData *fdata = face->CreateOutput();

       

          PXCFaceConfiguration* config = face->CreateActiveConfiguration();

          config->detection.isEnabled = true;

          config->detection.maxTrackedFaces = MAX_FACES;

          config->landmarks.isEnabled = true;

          m_numLandmarks = config->landmarks.numLandmarks;

          config->ApplyChanges();

       

          m_landmarkPoints = new PXCFaceData::LandmarkPoint[m_numLandmarks];

         

          for(;;)

          {

              sts=sm->AcquireFrame(true);

      //        if(sts<PXC_STATUS_NO_ERROR) break;

       

              fdata->Update();

              pxcI32 numFaces =  fdata->QueryNumberOfDetectedFaces();

       

              for(pxcI32 i =0; i< numFaces; i++)

              {

                  PXCFaceData::Face *singleFdata =  fdata->QueryFaceByIndex(i);

                  const PXCFaceData::LandmarksData* landmarkData = singleFdata->QueryLandmarks();

                  if (landmarkData == NULL)

                      break;

       

                  pxcI32 numPoints = landmarkData->QueryNumPoints();

                  if (numPoints != m_numLandmarks) {

                      break;

                  }

       

                  landmarkData->QueryPoints(m_landmarkPoints);

       

                  for (int j = 0; j < numPoints; ++j)

                  {

                      int x = (int)m_landmarkPoints[j].image.x + LANDMARK_ALIGNMENT;

                      int y = (int)m_landmarkPoints[j].image.y + LANDMARK_ALIGNMENT;

                     

                      if (m_landmarkPoints[j].confidenceImage)

                      {

                          cout<< "point : "<< j << "\t x : " << x << "\t y : " << y <<endl;

                      }

                  }

              }

              sm->ReleaseFrame();

          }

          return;

      }