3 Replies Latest reply on Feb 24, 2017 1:36 AM by MartyG

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


      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 "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;




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




          sts = sm->EnableFace();

          if(sts<PXC_STATUS_NO_ERROR) {

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





          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;



          m_landmarkPoints = new PXCFaceData::LandmarkPoint[m_numLandmarks];





      //        if(sts<PXC_STATUS_NO_ERROR) break;



              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)



                  pxcI32 numPoints = landmarkData->QueryNumPoints();

                  if (numPoints != m_numLandmarks) {






                  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;








        • 1. Re: face module in Realsense 2016 R2/R3 seems not exists.

          The first question I would ask is if you are compiling in C++ or C#.  From looking at the list of includes at the top of the script, it looks like a C++ script, as the C# language does not need includes.  So if you are compiling this script in a C# compiler program then it would not work, as it is like putting diesel fuel into the fuel tank of a vehicle that runs on unleaded. 


          The 'Code-Sample.Zip' example script attached to the Intel article below on face recognition is likely in C#, if C# is indeed what you need, as the author lists knowledge of C# as a requirement in their article.


          RealSense - Code Sample: Facial Recognition Using Intel® RealSense™ SDK | Intel® Software

          • 2. Re: face module in Realsense 2016 R2/R3 seems not exists.

            Dear MartyG:


            1.    The code above I listed was compiled with visual studio  2015 in C++  console mode ( for testing).


            2.   C# sample you pointed is good for me.


            I build  'Code-Sample.Zip' . with C# in Visual Studio 2015.

            It were built in  Debug version sucessfully.

            Its output directory contains FaceID.exe FaceID.exe.config  FaceID.pdb, FaceID.vshost.exe FaceID.vshost.exe.config

            FaceID.vshost.exe.manifest  libpxcclr.cs.dll  libpxccpp2c.dll.



            After running it in debugging mode,  it comes with the message:


            The program '[6244] FaceID.vshost.exe: Program Trace' has exited with code 0 (0x0).

            The program '[6244] FaceID.vshost.exe' has exited with code -1073741795 (0xc000001d) 'Illegal Instruction'.




            I felt puzzled about  'Illegal Instruction'.

            • 3. Re: face module in Realsense 2016 R2/R3 seems not exists.

              I would recommend only having one RealSense SDK installed at a time to avoid conflict between them (you said in your original message that you had installed R2 and R3). 


              I also note that you are using a face related function.  From R3 onwards, the RealSense SDK was split into a main module (Essentials) and a series of optional modules.  Face functions are one of those optional modules that is not inside Essentials.  If you have not done so already, I recommend returning to the SDK download page and downloading and installing the 'Face Tracking And Recognition' module that is listed below the Essentials module.


              Intel® RealSense™ SDK | Intel® Software