All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aiwiown.face.request.OCRDriverLicenseV2Request Maven / Gradle / Ivy

There is a newer version: 3.0.9
Show newest version
package com.aiwiown.face.request;

import com.aiwiown.face.ApiMethod;
import com.aiwiown.face.ApiObject;
import com.aiwiown.face.ApiRequest;
import com.aiwiown.face.internal.util.RequestParamUtils;
import com.aiwiown.face.response.OCRDriverLicenseV2Response;

import java.util.Map;

/**
 * 描述
 * 检测和识别中华人民共和国机动车驾驶证(以下称“驾照”)图像,并转化为结构化的文字信息。只可识别驾照正本(main sheet)正面和副本(second sheet)正面,一张照片最多可识别一个正本正面和一个副本正面。
 *
 * 驾照图像须为正拍(垂直角度拍摄),但是允许有一定程度的旋转角度;
 * 图片最小 100*100 像素,长宽不得超过4096像素,否则会抛出错误;
 * 支持图像里有一个或多个驾照的正本正面或副本正面,仅返回置信度最高的一个正本识别结果和一个副本识别结果,如果没有则该项返回为空。
 * //https://api-cn.faceplusplus.com/cardpp/v2/ocrdriverlicense
 */
public class OCRDriverLicenseV2Request implements ApiRequest {

    private String apiVersion = "v2";
    private static String apiUrl = "/ocrdriverlicense";

    private String bizContent;
    private ApiObject bizModel = null;

    @Override
    public ApiMethod getApiMethod() {
        return ApiMethod.POST;
    }

    @Override
    public String getApiUrl() {
        return "/" + this.apiVersion + apiUrl;
    }

    @Override
    public Map getTextParams() throws IllegalAccessException {
        return RequestParamUtils.getTextParams(this.bizModel);
    }

    @Override
    public Map getByteArrayParams() throws IllegalAccessException {
        return RequestParamUtils.getByteArrayParams(this.bizModel);
    }

    @Override
    public Class getResponseClass() {
        return OCRDriverLicenseV2Response.class;
    }

    @Override
    public String getApiVersion() {
        return this.apiVersion;
    }

    @Override
    public String getBizContent() {
        return this.bizContent;
    }

    public void setBizModel(ApiObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String signVersion() {
        return null;
    }

    @Override
    public String getSignInfo(String apiKey, String secretKey) throws Exception {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy