MeiCam SDK For Android  3.1.2
Usage Method of Human Face Detection Effect

The Usage Method of Human Face Detection Effect for the Meishe SDK is used as follows:

1.Initializes AR Face,it only need to be initialized once. NvsFaceEffectV1 is a face effect class of SDK, "NvFaceData.asset" is a kind of face data file package,and "authpack.java" is a class of authorization file. The function of setMaxFaces() can set the max count of face detection after starting detecting. It can detect up to 8 faces at the same time,the default is 1 face. Initialization codes are as follows:

        NvsFaceEffectV1.setup("assets:/NvFaceData.asset", com.meishe.arface.authpack.A());
        NvsFaceEffectV1.setMaxFaces(2);
  1. Adds the face effect with name of "Face Effect". By default, it has the beauty. The revelant codes are as follows:
         m_ARFace = m_streamingContext.appendBuiltinCaptureVideoFx("Face Effect");
         m_ARFace.setStringVal("Beautification Package", "assets:/NvBeautification.asset");
    
  2. Sets the face prop for face effect. The codes are as follows:
         m_ARFace.setStringVal("Face Ornament", "assets:/" + packageName);//"packageName" is a props package with the suffix .asset.
    
  3. Choose the type of face shape, including the default, goddess, internet celebrity and natural. Users can choose one of them when capturing. The corresponding codes are as follows:
          m_ARFace.setMenuVal("Face Type", "Default");               //Default
          m_ARFace.setMenuVal("Face Type", "Goddness");              //Goddess
          m_ARFace.setMenuVal("Face Type", "Internet Celebrity");    //Internet celebrity
          m_ARFace.setMenuVal("Face Type", "Natural");               //Natural
    
  4. Sets parameters for each face type, including "Face Shape Level", "Eye Enlarging" and "Cheek Thinning". The corresponding code is as follows:
         m_ARFace.setFloatVal("Face Shape Level", val);//Specifies the basic face shape level.
         m_ARFace.setFloatVal("Eye Enlarging", val);   //Eye enlarging for controlling the size of eyes.
         m_ARFace.setFloatVal("Cheek Thinning", val);  //Face thinning for adjusting the size of face.
    
  5. After using, please destroy the face effect. The codes are as follows:
         NvsFaceEffectV1.done();