com.baidubce.services.ocr
Class OcrClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.ocr.OcrClient

public class OcrClient
extends AbstractBceClient

Created by lvsiyuan on 16/11/18.


Field Summary
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
OcrClient(BceClientConfiguration ocrConfig)
          Constructs a new client using the client configuration.
 
Method Summary
 BankcardRecognitionResponse bankcardRecognition(BankcardRecognitionRequest request)
          Gets the bankcard recognition properties of specific image resource.
 BankcardRecognitionResponse bankcardRecognition(String image)
          Gets the bankcard recognition properties of specific image resource.
 GeneralRecognitionResponse generalRecognition(GeneralRecognitionRequest request)
          Gets the general recognition properties of specific image resource.
 GeneralRecognitionResponse generalRecognition(String image)
          Gets the general recognition properties of specific image resource.
 GeneralRecognitionResponse generalRecognition(String image, String granularity, String mask, String langType, Boolean direction)
          Gets the general recognition properties of specific image resource.
 IdcardRecognitionResponse idcardRecognition(IdcardRecognitionRequest request)
          Gets the idcard recognition properties of specific image resource.
 IdcardRecognitionResponse idcardRecognition(String image, String side)
          Gets the idcard recognition properties of specific image resource.
 IdcardRecognitionResponse idcardRecognition(String image, String side, Boolean direction)
          Gets the idcard recognition properties of specific image resource.
 
Methods inherited from class com.baidubce.AbstractBceClient
getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OcrClient

public OcrClient(BceClientConfiguration ocrConfig)
Constructs a new client using the client configuration.

Parameters:
ocrConfig - The client configuration options controlling how this client connects to Ocr services (e.g. proxy settings, retry counts, etc).
Method Detail

bankcardRecognition

public BankcardRecognitionResponse bankcardRecognition(String image)
Gets the bankcard recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
image - The image data which needs to be base64
Returns:
The bankcard recognition properties of the image resource

bankcardRecognition

public BankcardRecognitionResponse bankcardRecognition(BankcardRecognitionRequest request)
Gets the bankcard recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
request - The request wrapper object containing all options.
Returns:
The bankcard recognition properties of the image resource

idcardRecognition

public IdcardRecognitionResponse idcardRecognition(String image,
                                                   String side)
Gets the idcard recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
image - The image data which needs to be base64
side - The side of idcard image. (front/back)
Returns:
The idcard recognition properties of the image resource

idcardRecognition

public IdcardRecognitionResponse idcardRecognition(String image,
                                                   String side,
                                                   Boolean direction)
Gets the idcard recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
image - The image data which needs to be base64
side - The side of idcard image. (front/back)
direction - Decide if the image has been rotated (true/false)
Returns:
The idcard recognition properties of the image resource

idcardRecognition

public IdcardRecognitionResponse idcardRecognition(IdcardRecognitionRequest request)
Gets the idcard recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
request - The request wrapper object containing all options.
Returns:
The idcard recognition properties of the image resource

generalRecognition

public GeneralRecognitionResponse generalRecognition(String image)
Gets the general recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
image - The image data which needs to be base64
Returns:
The general recognition properties of the image resource

generalRecognition

public GeneralRecognitionResponse generalRecognition(String image,
                                                     String granularity,
                                                     String mask,
                                                     String langType,
                                                     Boolean direction)
Gets the general recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
image - The image data which needs to be base64
granularity - Decide if recognize single character (big/small)
mask - Represent the gray/white/black shade image area (base64 data)
langType - Language type, detail to be CHN_ENG (ENG/POR/FRE/GER/ITA/SPA/RUS/JAP)
direction - Decide if the image has been rotated (true/false)
Returns:
The general recognition properties of the image resource

generalRecognition

public GeneralRecognitionResponse generalRecognition(GeneralRecognitionRequest request)
Gets the general recognition properties of specific image resource.

The caller must authenticate with a valid BCE Access Key / Private Key pair.

Parameters:
request - The request wrapper object containing all options.
Returns:
The general recognition properties of the image resource


Copyright © 2018. All rights reserved.