차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
ko:bs2_enrolluserfaceex [2021/12/29 16:16]
mark [샘플코드]
ko:bs2_enrolluserfaceex [2021/12/30 10:54] (현재)
mark [샘플코드]
줄 27: 줄 27:
 \\ \\
 ==== 샘플코드 ==== ==== 샘플코드 ====
 +C++
 +<code cpp>
 +
 +sdkResult = BS2_EnrollUserFaceEx(context_,​ id, &​userBlob,​ 1, 1);
 +if (BS_SDK_SUCCESS != sdkResult)
 + TRACE("​BS2_EnrollUserFaceEx call failed: %d", sdkResult);
 +
 +if (userBlob.cardObjs)
 + delete[] userBlob.cardObjs;​
 +
 +if (userBlob.fingerObjs)
 + delete[] userBlob.fingerObjs;​
 +
 +if (userBlob.faceObjs)
 + delete[] userBlob.faceObjs;​
 +
 +if (userBlob.faceExObjs)
 +{
 + //for (uint32_t index = 0; index < user.numFaces;​ index++)
 + //{
 + // if (userBlob.faceExObjs[index].flag == 0) // raw image
 + delete[] userBlob.faceExObjs;​
 + //}
 +}
 +
 +</​code>​
 +
 C# C#
 <code cpp> <code cpp>
줄 34: 줄 61:
 cbFaceOnReadyToScan = new API.OnReadyToScan(ReadyToScanForFace);​ cbFaceOnReadyToScan = new API.OnReadyToScan(ReadyToScanForFace);​
 BS2User user = userList[selection];​ BS2User user = userList[selection];​
-BS2UserBlob[] userBlob11 = Util.AllocateStructureArray<​BS2UserBlob>​(1);​ +BS2UserBlob[] userBlob11 = Util.AllocateStructureArray<​BS2UserBlob>​(1); ​
-if (dbHandler.GetUserBlobTest(ref deviceInfo, ref user, ref userBlob11[0])) +
-+
-                if (BS2ErrorCode.BS_SDK_SUCCESS != sdkResult) +
-                    Console.WriteLine("​BS2_EnrollUserFaceEx call failed {0}", sdkResult);​ +
- +
-                if (userBlob[0].cardObjs != IntPtr.Zero) +
-                    Marshal.FreeHGlobal(userBlob[0].cardObjs);​ +
- +
-                if (userBlob[0].fingerObjs != IntPtr.Zero) +
-                    Marshal.FreeHGlobal(userBlob[0].fingerObjs);​ +
- +
-                if (userBlob[0].faceObjs != IntPtr.Zero) +
-                    Marshal.FreeHGlobal(userBlob[0].faceObjs);​ +
- +
-                if (userBlob[0].faceExObjs != IntPtr.Zero) +
-                { +
-                    //if (unwarpedMemory) +
-                    Marshal.FreeHGlobal(userBlob[0].faceExObjs);​ +
-                } +
-            }+
 </​code>​ </​code>​