亚洲 激情 ,欧美精品,亚洲18色成人网站www,色综合天天综合高清网国产在线,婷婷六月综合缴情在线,无码一区二区三区视频

您是否正受到短信簽名報備的困擾?互億無線解決方案讓您最快15分鐘內(nèi)恢復(fù)信息傳遞,馬上 注冊體驗。

互億無線 · 文檔中心

身份證OCR識別 - 代碼示例


Java對接身份證OCR識別DEMO示例
本文為您提供了Java語言版本的身份證OCR識別的DEMO示例,快速對接調(diào)用,輕松完成系統(tǒng)集成,智能識別身份證圖片中的文字內(nèi)容。

身份證OCR識別API接口文檔 點擊下載

身份證OCR識別接入指南 點擊訪問



// 接口類型:互億無線OCR識別接口
// 賬戶注冊:https://user.ihuyi.com/register.html
// 注意事項:
// DEMO僅作參考

import java.io.IOException;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;

import util.StringUtil;

public class test {
	
	private static String Url = "https://api.ihuyi.com/ocr/idcard/Submit.json";
	
	public static void main(String [] args) {
		
		HttpClient client = new HttpClient();
		PostMethod method = new PostMethod(Url);

		client.getParams().setContentCharset("UTF-8");
		method.setRequestHeader("ContentType","application/x-www-form-urlencoded;charset=UTF-8");

		String account = "APPID";
		String password = "APPKEY";
		String img_base64 = "";
		String img_url = "http://www.xx.com/xx.png";
		String _now = "" + (System.currentTimeMillis() / 1000L);
		String password_raw = account + password + _now;
		// System.out.println((password_raw)
		String password_md5 = util.StringUtil.MD5Encode(password_raw);
		// System.out.println((password_raw)

		NameValuePair[] data = {//提交認證
			    new NameValuePair("account", account),
			    // new NameValuePair("password", password),
			    new NameValuePair("password", password_md5),
			    new NameValuePair("img_base64", img_base64),
			    new NameValuePair("img_url", img_url),
			    new NameValuePair("time", _now),
		};
		method.setRequestBody(data);

		try {
			client.executeMethod(method);

			String res =method.getResponseBodyAsString();

			System.out.println(res);

		} catch (HttpException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}

現(xiàn)在注冊,即享新用戶禮包!

在線咨詢
電話咨詢

服務(wù)熱線:

4008 808 898

服務(wù)熱線(工作時間):

4008 808 898

業(yè)務(wù)咨詢(非工作時間):

售后咨詢(非工作時間):

驗證碼已發(fā)送到您的手機,請查收!

輸入驗證碼后,點擊“開通體驗賬戶”按鈕可立即開通體驗賬戶。

收不到短信驗證碼?
互億無線不提供接碼服務(wù),接碼用戶請勿點擊開通按鈕。
×