차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
ko:bs2_enrolluserfaceex [2021/12/29 16:23] mark [샘플코드] |
ko:bs2_enrolluserfaceex [2024/05/28 17:20] (현재) kkshin |
||
|---|---|---|---|
| 줄 5: | 줄 5: | ||
| ===== BS2_EnrollUserFaceEx ===== | ===== BS2_EnrollUserFaceEx ===== | ||
| - | [+ 2.7.1] 새로운 사용자를 등록합니다. 이 함수는 FaceStation F2 장치 지원을 포함합니다. | + | [+ 2.7.1] 새로운 사용자를 등록합니다. \\ |
| + | 이 API는 Visual Face 인증 수단을 등록할 수 있는 기능을 포함합니다. | ||
| \\ | \\ | ||
| ==== 함수 ==== | ==== 함수 ==== | ||
| 줄 27: | 줄 28: | ||
| \\ | \\ | ||
| ==== 샘플코드 ==== | ==== 샘플코드 ==== | ||
| - | C# | + | C++ |
| <code cpp> | <code cpp> | ||
| - | sdkResult = (BS2ErrorCode)API.BS2_EnrollUserFaceEx(sdkContext, deviceID, userBlob, 1, 1); | ||
| - | List<BS2User> userList = new List<BS2User>(); | ||
| - | Int32 selection = Util.GetInput(); | ||
| - | cbFaceOnReadyToScan = new API.OnReadyToScan(ReadyToScanForFace); | ||
| - | BS2User user = userList[selection]; | ||
| - | BS2UserBlob[] userBlob11 = Util.AllocateStructureArray<BS2UserBlob>(1); | ||
| - | if (dbHandler.GetUserBlobTest(ref deviceInfo, ref user, ref userBlob11[0])) | + | sdkResult = BS2_EnrollUserFaceEx(context_, id, &userBlob, 1, 1); |
| - | { | + | if (BS_SDK_SUCCESS != sdkResult) |
| - | if (BS2ErrorCode.BS_SDK_SUCCESS != sdkResult) | + | TRACE("BS2_EnrollUserFaceEx call failed: %d", sdkResult); |
| - | Console.WriteLine("BS2_EnrollUserFaceEx call failed {0}", sdkResult); | + | |
| - | if (userBlob[0].cardObjs != IntPtr.Zero) | + | if (userBlob.cardObjs) |
| - | Marshal.FreeHGlobal(userBlob[0].cardObjs); | + | delete[] userBlob.cardObjs; |
| - | if (userBlob[0].fingerObjs != IntPtr.Zero) | + | if (userBlob.fingerObjs) |
| - | Marshal.FreeHGlobal(userBlob[0].fingerObjs); | + | delete[] userBlob.fingerObjs; |
| - | if (userBlob[0].faceObjs != IntPtr.Zero) | + | if (userBlob.faceObjs) |
| - | Marshal.FreeHGlobal(userBlob[0].faceObjs); | + | delete[] userBlob.faceObjs; |
| - | if (userBlob[0].faceExObjs != IntPtr.Zero) | + | if (userBlob.faceExObjs) |
| - | { | + | { |
| - | //if (unwarpedMemory) | + | //for (uint32_t index = 0; index < user.numFaces; index++) |
| - | Marshal.FreeHGlobal(userBlob[0].faceExObjs); | + | //{ |
| - | } | + | // if (userBlob.faceExObjs[index].flag == 0) // raw image |
| + | delete[] userBlob.faceExObjs; | ||
| + | //} | ||
| } | } | ||
| + | |||
| + | </code> | ||
| + | |||
| + | C# | ||
| + | <code cpp> | ||
| + | sdkResult = (BS2ErrorCode)API.BS2_EnrollUserFaceEx(sdkContext, deviceID, userBlob, 1, 1); | ||
| + | List<BS2User> userList = new List<BS2User>(); | ||
| + | Int32 selection = Util.GetInput(); | ||
| + | cbFaceOnReadyToScan = new API.OnReadyToScan(ReadyToScanForFace); | ||
| + | BS2User user = userList[selection]; | ||
| + | BS2UserBlob[] userBlob11 = Util.AllocateStructureArray<BS2UserBlob>(1); | ||
| </code> | </code> | ||