Search in sources :

Example 1 with VinOCRResponse

use of com.tencentcloudapi.ocr.v20181119.models.VinOCRResponse in project cloud-sdk by mizhousoft.

the class TencentOCRServiceImpl method imageUrlOCR.

/**
 * {@inheritDoc}
 */
@Override
public String imageUrlOCR(String imageUrl) throws CloudSDKException {
    VinOCRRequest req = new VinOCRRequest();
    req.setImageUrl(imageUrl);
    try {
        VinOCRResponse resp = ocrClient.VinOCR(req);
        return resp.getVin();
    } catch (TencentCloudSDKException e) {
        throw new CloudSDKException(e.getMessage(), e);
    }
}
Also used : TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) CloudSDKException(com.mizhousoft.cloudsdk.CloudSDKException) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) VinOCRResponse(com.tencentcloudapi.ocr.v20181119.models.VinOCRResponse) VinOCRRequest(com.tencentcloudapi.ocr.v20181119.models.VinOCRRequest)

Example 2 with VinOCRResponse

use of com.tencentcloudapi.ocr.v20181119.models.VinOCRResponse in project cloud-sdk by mizhousoft.

the class TencentOCRServiceImpl method imageBase64OCR.

/**
 * {@inheritDoc}
 */
@Override
public String imageBase64OCR(String imageBase64) throws CloudSDKException {
    VinOCRRequest req = new VinOCRRequest();
    req.setImageBase64(imageBase64);
    try {
        VinOCRResponse resp = ocrClient.VinOCR(req);
        return resp.getVin();
    } catch (TencentCloudSDKException e) {
        throw new CloudSDKException(e.getMessage(), e);
    }
}
Also used : TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) CloudSDKException(com.mizhousoft.cloudsdk.CloudSDKException) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) VinOCRResponse(com.tencentcloudapi.ocr.v20181119.models.VinOCRResponse) VinOCRRequest(com.tencentcloudapi.ocr.v20181119.models.VinOCRRequest)

Aggregations

CloudSDKException (com.mizhousoft.cloudsdk.CloudSDKException)2 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)2 VinOCRRequest (com.tencentcloudapi.ocr.v20181119.models.VinOCRRequest)2 VinOCRResponse (com.tencentcloudapi.ocr.v20181119.models.VinOCRResponse)2