zoukankan      html  css  js  c++  java
  • 接入腾讯云的OCR识别身份证信息

    在公司用到这个功能在这里进行总结一下

    1 导入Pom

        <dependency>
                <groupId>com.tencentcloudapi</groupId>
                <artifactId>tencentcloud-sdk-java</artifactId>
                <version>3.1.94</version>
            </dependency>
    

    2 测试类

    public class CertificationTest {
    
        @Test
        public void  CertificationTest(){
            String tsecretId="xxxxx";
            String tsecretKey="xxxx";
            String image="xxxx";
            try{
                Credential cred = new Credential(tsecretId, tsecretKey);
                HttpProfile httpProfile = new HttpProfile();
                httpProfile.setEndpoint("ocr.tencentcloudapi.com");
                ClientProfile clientProfile = new ClientProfile();
                clientProfile.setHttpProfile(httpProfile);
                OcrClient client = new OcrClient(cred, "ap-beijing", clientProfile);
                IDCardOCRRequest req = new IDCardOCRRequest();
                req.setImageUrl(image);
                IDCardOCRResponse resp = client.IDCardOCR(req);
    
                System.out.println(IDCardOCRResponse.toJsonString(resp));
            } catch (TencentCloudSDKException e) {
                System.out.println(e.toString());
            }
        }
    }
    
    
  • 相关阅读:
    浅谈线段树
    浅谈KMP
    20200729线上模拟题解
    20200727线上模拟题解
    声明
    tarjan--割点,缩点
    20201029模拟
    高精模板
    二分图--二分图的几种模型
    树的直径与树的重心
  • 原文地址:https://www.cnblogs.com/HezhenbinGoGo/p/14986481.html
Copyright © 2011-2022 走看看