Reason for this document:

When you register user profile image in the G-SDK. The regular version(1.4) does not contain that function.




How to use & detailed explaination :


Please download device gate way and imageuser folder, Create a folder location as shown below.


 

Program.cs

private const string USER_PROFILE_IMAGE = "c:/profile.jpg";

TestImageUser.cs

 public void EnrollFaceUser(uint deviceID, ref ByteString warpedImageData, string profileImageFileName)
    {
      Console.WriteLine("Enroll user");

      byte[] profileBytes;
      getImageData(profileImageFileName, out profileBytes);
      ByteString profileImage = ByteString.CopyFrom(profileBytes);

      string userID10 = "10";
      UserInfo userInfo10 = new UserInfo{Hdr = new UserHdr{ID = userID10}};
      userInfo10.Name = "testProfileUser";
      userInfo10.Setting = new UserSetting{StartTime = 978307200, EndTime = 1924991999};
      userInfo10.Photo = profileImage;

      const uint Bs2FaceFlagF2Warped = 0x1;
      FaceData faceData = new FaceData();
      faceData.Flag = (uint)Face.FaceFlag.Bs2FaceFlagF2 | Bs2FaceFlagF2Warped;
      faceData.ImageData = warpedImageData;
      userInfo10.Faces.Add(faceData);

      string userID11 = "11";
      UserInfo userInfo11 = new UserInfo{Hdr = new UserHdr{ID = userID11}};
      userInfo11.Name = "testNonProfileUser";
      userInfo11.Setting = new UserSetting{StartTime = 978307200, EndTime = 1924991999};
      // userInfo11.Photo = profileImage;

      FaceData faceData11 = new FaceData();
      faceData11.Flag = (uint)Face.FaceFlag.Bs2FaceFlagF2 | Bs2FaceFlagF2Warped;
      faceData11.ImageData = warpedImageData;
      userInfo11.Faces.Add(faceData11);

      userSvc.Enroll(deviceID, new UserInfo[]{userInfo10, userInfo11});

      Console.WriteLine("Enroll user finished");
    }

device_gateway_V1.4.5B_20220506 1.7z