照片比对的部分代码,你参考一下吧
If FileSys.FileExists(ProjectPath & "\Attachments\" & Vars("idcard") & ".bmp") Then
Else
Return "身份证照片获取失败,请重刷!"
End If
Dim score As String
Dim client = New Baidu.Aip.Face.Face(Vars("Api_Key"), Vars("Secret_Key"))
Dim image1 = System.IO.File.ReadAllBytes(ProjectPath + "SignPhoto.jpg")
Dim image2 = System.IO.File.ReadAllBytes(ProjectPath & "\Attachments\" & Vars("idcard") & ".bmp" )
Dim images = New Byte()() {image1, image2}
Dim result = client.FaceMatch(images)
Dim json As String = result.Tostring
Dim jo As JObject = JObject.Parse(json)
For Each jt As JToken In jo("result")
score=jt("score").ToString
Next
If score >70 Then
Return "比对值:" + score +".比对成功"
Else
Return "签到失败,请重刷身份证或咨询现场工作人员人工报到!"
End If
[此贴子已经被作者于2018/11/29 10:14:47编辑过]