41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.IO;
 | |
| using System.Linq;
 | |
| using System.Net;
 | |
| using System.Net.Http;
 | |
| using System.Text;
 | |
| using System.Threading.Tasks;
 | |
| 
 | |
| namespace SgManager.AI
 | |
| {
 | |
|   public  class IDCardClass
 | |
|     {
 | |
| 
 | |
| 
 | |
|         // Distinguish(pb_SidePic.ImageLocation, "back", false, "true");
 | |
|         // Distinguish(pb_PositivePic.ImageLocation, "front", false, "true");
 | |
|         /// <summary>
 | |
|         /// 识别操作
 | |
|         /// </summary>
 | |
|         /// <param name="filePath"></param>
 | |
|         /// <param name="id_card_side">身份证 正面还是背面</param>
 | |
|         /// <param name="detect_direction"></param>
 | |
|         /// <param name="detect_risk"></param>
 | |
|         public static APIBaseModel<IDCardRecognitionModel> idcard(string filePath, string id_card_side = "front", bool detect_direction = false, string detect_risk = "false")
 | |
|         {
 | |
|             var temp = IDCardToken.GetAccessToken();
 | |
|             if (temp.IsSuccess)
 | |
|             {
 | |
|                 string data = "";
 | |
|                 string error = "";
 | |
|                 string token = temp.SuccessModel.access_token;
 | |
|                 var result = IDCardRecognition.GetIdcardRecognitionString(temp.SuccessModel.access_token, filePath, ref data, out error, id_card_side, detect_direction, detect_risk);
 | |
|                 return result;
 | |
|             }           
 | |
|             return null;
 | |
| 
 | |
|         }
 | |
|     }
 | |
| }
 |