v20181119

package
v3.0.357+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// File download failed.
	FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"

	// The image is empty.
	FAILEDOPERATION_EMPTYIMAGEERROR = "FailedOperation.EmptyImageError"

	// Recognition by the engine timed out.
	FAILEDOPERATION_ENGINERECOGNIZETIMEOUT = "FailedOperation.EngineRecognizeTimeout"

	// The image is blurry.
	FAILEDOPERATION_IMAGEBLUR = "FailedOperation.ImageBlur"

	// Image decoding failed.
	FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"

	// No text is detected in the image.
	FAILEDOPERATION_IMAGENOTEXT = "FailedOperation.ImageNoText"

	// The image is too large. Please see the description of image size limit in the output parameters.
	FAILEDOPERATION_IMAGESIZETOOLARGE = "FailedOperation.ImageSizeTooLarge"

	// The input language is not supported.
	FAILEDOPERATION_LANGUAGENOTSUPPORT = "FailedOperation.LanguageNotSupport"

	// Not a Hong Kong identity card.
	FAILEDOPERATION_NOHKIDCARD = "FailedOperation.NoHKIDCard"

	// Non-Malaysian ID cards
	FAILEDOPERATION_NOMASIDCARD = "FailedOperation.NoMASIDCard"

	// Not a passport.
	FAILEDOPERATION_NOPASSPORT = "FailedOperation.NoPassport"

	// OCR failed.
	FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"

	// Unknown error.
	FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"

	// The service is not activated.
	FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"

	// Image decoding failed.
	INVALIDPARAMETER_ENGINEIMAGEDECODEFAILED = "InvalidParameter.EngineImageDecodeFailed"

	// Incorrect parameter value.
	INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"

	// The file is too large.
	LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"

	// Exceptional billing status.
	RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"
)
View Source
const APIVersion = "2018-11-19"

Variables

This section is empty.

Functions

This section is empty.

Types

type BankCardOCRRequest

type BankCardOCRRequest struct {
	*tchttp.BaseRequest

	// Base64-encoded value of the image. The image cannot exceed 7 MB after being Base64-encoded. A resolution above 500 x 800 is recommended. PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupy more than 2/3 area of the image.
	// Either the `ImageUrl` or `ImageBase64` of the image must be provided. If both are provided, only `ImageUrl` will be used.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// URL address of image. (This field is not supported outside Chinese mainland)
	// Supported image formats: PNG, JPG, JPEG. GIF is currently not supported.
	// Supported image size: the downloaded image cannot exceed 7 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
	// We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability.
	// The download speed and stability of non-Tencent Cloud URLs may be low.
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`

	// Whether to return the bank card image data after preprocessing (precise cropping and alignment). Default value: `false`
	RetBorderCutImage *bool `json:"RetBorderCutImage,omitempty" name:"RetBorderCutImage"`

	// Whether to return the card number image data after slicing. Default value: `false`
	RetCardNoImage *bool `json:"RetCardNoImage,omitempty" name:"RetCardNoImage"`

	// Whether to enable photocopy check. If the input image is a bank card photocopy, an alarm will be returned. Default value: `false`
	EnableCopyCheck *bool `json:"EnableCopyCheck,omitempty" name:"EnableCopyCheck"`

	// Whether to enable photograph check. If the input image is a bank card photograph, an alarm will be returned. Default value: `false`
	EnableReshootCheck *bool `json:"EnableReshootCheck,omitempty" name:"EnableReshootCheck"`

	// Whether to enable obscured border check. If the input image is a bank card with obscured border, an alarm will be returned. Default value: `false`
	EnableBorderCheck *bool `json:"EnableBorderCheck,omitempty" name:"EnableBorderCheck"`

	// Whether to return the image quality value, which measures how clear an image is. Default value: `false`
	EnableQualityValue *bool `json:"EnableQualityValue,omitempty" name:"EnableQualityValue"`
}

func NewBankCardOCRRequest

func NewBankCardOCRRequest() (request *BankCardOCRRequest)

func (*BankCardOCRRequest) FromJsonString

func (r *BankCardOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*BankCardOCRRequest) ToJsonString

func (r *BankCardOCRRequest) ToJsonString() string

type BankCardOCRResponse

type BankCardOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Card number
		CardNo *string `json:"CardNo,omitempty" name:"CardNo"`

		// Bank information
		BankInfo *string `json:"BankInfo,omitempty" name:"BankInfo"`

		// Expiration date. Format: 07/2023
		ValidDate *string `json:"ValidDate,omitempty" name:"ValidDate"`

		// Card type
		CardType *string `json:"CardType,omitempty" name:"CardType"`

		// Card name
		CardName *string `json:"CardName,omitempty" name:"CardName"`

		// Sliced image data
		// Note: this field may return `null`, indicating that no valid values can be obtained.
		BorderCutImage *string `json:"BorderCutImage,omitempty" name:"BorderCutImage"`

		// Card number image data
		// Note: this field may return `null`, indicating that no valid values can be obtained.
		CardNoImage *string `json:"CardNoImage,omitempty" name:"CardNoImage"`

		// Warning code:
		// -9110: the bank card date is invalid.
		// -9111: the bank card border is incomplete.
		// -9112: the bank card image is reflective.
		// -9113: the bank card image is a photocopy.
		// -9114: the bank card image is a photograph.
		// Multiple warning codes may be returned at a time.
		// Note: this field may return `null`, indicating that no valid values can be obtained.
		WarningCode []*int64 `json:"WarningCode,omitempty" name:"WarningCode"`

		// Image quality value, which is returned when `EnableQualityValue` is set to `true`. The smaller the value, the less clear the image is. Value range: 0−100 (a threshold greater than or equal to 50 is recommended.)
		// Note: This field may return `null`, indicating that no valid values can be obtained.
		QualityValue *int64 `json:"QualityValue,omitempty" name:"QualityValue"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewBankCardOCRResponse

func NewBankCardOCRResponse() (response *BankCardOCRResponse)

func (*BankCardOCRResponse) FromJsonString

func (r *BankCardOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*BankCardOCRResponse) ToJsonString

func (r *BankCardOCRResponse) ToJsonString() string

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error)

func NewClientWithSecretId

func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error)

Deprecated

func (*Client) BankCardOCR

func (c *Client) BankCardOCR(request *BankCardOCRRequest) (response *BankCardOCRResponse, err error)

BankCardOCR This API is used to detect and recognize key fields such as the card number, bank information, and expiration date on mainstream bank cards in Mainland China.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETER_ENGINEIMAGEDECODEFAILED = "InvalidParameter.EngineImageDecodeFailed"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"

func (*Client) GeneralAccurateOCR

func (c *Client) GeneralAccurateOCR(request *GeneralAccurateOCRRequest) (response *GeneralAccurateOCRResponse, err error)

GeneralAccurateOCR This API is used to detect and recognize characters in an image. It can recognize Chinese, English, Chinese-English, digits, and special symbols and return the text box positions and characters.

It is suitable for scenarios with a lot of characters in complex layouts and requiring high recognition accuracy, such as examination papers, online images, signboards, and legal documents.

Strengths: compared with general print recognition, it provides higher-precision character recognition services. Its accuracy and recall rate are higher in difficult scenarios such as a large number of characters, long strings of digits, small characters, blurry characters, and tilted text.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_EMPTYIMAGEERROR = "FailedOperation.EmptyImageError"
FAILEDOPERATION_ENGINERECOGNIZETIMEOUT = "FailedOperation.EngineRecognizeTimeout"
FAILEDOPERATION_IMAGEBLUR = "FailedOperation.ImageBlur"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_IMAGENOTEXT = "FailedOperation.ImageNoText"
FAILEDOPERATION_IMAGESIZETOOLARGE = "FailedOperation.ImageSizeTooLarge"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETER_ENGINEIMAGEDECODEFAILED = "InvalidParameter.EngineImageDecodeFailed"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"

func (*Client) GeneralBasicOCR

func (c *Client) GeneralBasicOCR(request *GeneralBasicOCRRequest) (response *GeneralBasicOCRResponse, err error)

GeneralBasicOCR This API is used to detect and recognize characters in an image in the following 20 languages: Chinese, English, Japanese, Korean, Spanish, French, German, Portuguese, Vietnamese, Malay, Russian, Italian, Dutch, Swedish, Finnish, Danish, Norwegian, Hungarian, Thai, and Arabic. Mixed characters in English and each supported language can be recognized together.

It can recognize printed text in paper documents, online images, ads, signboards, menus, video titles, profile photos, etc.

Strengths: it can automatically recognize the text language, return the text box coordinate information, and automatically rotate tilted text to the upright direction.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_EMPTYIMAGEERROR = "FailedOperation.EmptyImageError"
FAILEDOPERATION_ENGINERECOGNIZETIMEOUT = "FailedOperation.EngineRecognizeTimeout"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_IMAGENOTEXT = "FailedOperation.ImageNoText"
FAILEDOPERATION_LANGUAGENOTSUPPORT = "FailedOperation.LanguageNotSupport"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"

func (*Client) HKIDCardOCR

func (c *Client) HKIDCardOCR(request *HKIDCardOCRRequest) (response *HKIDCardOCRResponse, err error)

HKIDCardOCR This API is used to recognize key fields on the photo side of a Hong Kong (China) identity card, including name in Chinese, name in English, telecode for name, date of birth, gender, document symbol, date of the first issue, date of the last receipt, identity card number, and permanent residency attribute. It can check for card authenticity and crop the identity photo.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_NOHKIDCARD = "FailedOperation.NoHKIDCard"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"

func (*Client) MLIDCardOCR

func (c *Client) MLIDCardOCR(request *MLIDCardOCRRequest) (response *MLIDCardOCRResponse, err error)

MLIDCardOCR This API is used to recognize a Malaysian identity card. Recognizable fields include identity card number, name, gender, and address. It has the features of cropping identity photos and alarming for photographed or photocopied documents.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_NOMASIDCARD = "FailedOperation.NoMASIDCard"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETER_ENGINEIMAGEDECODEFAILED = "InvalidParameter.EngineImageDecodeFailed"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"

func (*Client) MLIDPassportOCR

func (c *Client) MLIDPassportOCR(request *MLIDPassportOCRRequest) (response *MLIDPassportOCRResponse, err error)

MLIDPassportOCR This API is used to recognize a passport issued in Hong Kong/Macao/Taiwan (China) or other countries/regions. Recognizable fields include passport ID, name, date of birth, gender, expiration date, issuing country/region, and nationality. It has the features of cropping identity photos and alarming for photographed or photocopied documents.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_NOPASSPORT = "FailedOperation.NoPassport"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"

func (*Client) TableOCR

func (c *Client) TableOCR(request *TableOCRRequest) (response *TableOCRResponse, err error)

TableOCR This API is used to detect and recognize Chinese and English forms in images. It can return the text content of each cell and save the recognition result as Excel.

This API is not fully available for the time being. For more information, please contact your [Tencent Cloud sales rep](https://intl.cloud.tencent.com/contact-sales).

error code that may be returned:

FAILEDOPERATION_DOWNLOADERROR = "FailedOperation.DownLoadError"
FAILEDOPERATION_EMPTYIMAGEERROR = "FailedOperation.EmptyImageError"
FAILEDOPERATION_IMAGEDECODEFAILED = "FailedOperation.ImageDecodeFailed"
FAILEDOPERATION_IMAGENOTEXT = "FailedOperation.ImageNoText"
FAILEDOPERATION_LANGUAGENOTSUPPORT = "FailedOperation.LanguageNotSupport"
FAILEDOPERATION_OCRFAILED = "FailedOperation.OcrFailed"
FAILEDOPERATION_UNKNOWERROR = "FailedOperation.UnKnowError"
FAILEDOPERATION_UNOPENERROR = "FailedOperation.UnOpenError"
INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit"
LIMITEXCEEDED_TOOLARGEFILEERROR = "LimitExceeded.TooLargeFileError"
RESOURCESSOLDOUT_CHARGESTATUSEXCEPTION = "ResourcesSoldOut.ChargeStatusException"

type Coord

type Coord struct {

	// Horizontal coordinate
	X *int64 `json:"X,omitempty" name:"X"`

	// Vertical coordinate
	Y *int64 `json:"Y,omitempty" name:"Y"`
}

type DetectedWordCoordPoint

type DetectedWordCoordPoint struct {

	// Coordinates of a word’s four corners in a clockwise order on the input image, starting from the upper-left corner
	WordCoordinate []*Coord `json:"WordCoordinate,omitempty" name:"WordCoordinate"`
}

type DetectedWords

type DetectedWords struct {

	// Confidence. Value range: 0–100
	Confidence *int64 `json:"Confidence,omitempty" name:"Confidence"`

	// A possible character
	Character *string `json:"Character,omitempty" name:"Character"`
}

type GeneralAccurateOCRRequest

type GeneralAccurateOCRRequest struct {
	*tchttp.BaseRequest

	// Base64-encoded value of image.
	// The image cannot exceed 7 MB in size after being Base64-encoded. A resolution above 600x800 is recommended. PNG, JPG, JPEG, and BMP formats are supported.
	// Either `ImageUrl` or `ImageBase64` of the image must be provided; if both are provided, only `ImageUrl` will be used.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// URL address of image. (This field is not supported outside Chinese mainland)
	// The image cannot exceed 7 MB after being Base64-encoded. A resolution above 600x800 is recommended. PNG, JPG, JPEG, and BMP formats are supported.
	// We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability. The download speed and stability of non-Tencent Cloud URLs may be low.
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`

	// Whether to return the character information. Default value: `false`
	IsWords *bool `json:"IsWords,omitempty" name:"IsWords"`

	// Whether to slice the input image to enhance the recognition effects for scenarios where the whole image is big, but the size of a single character is small (e.g., test papers). This feature is disabled by default.
	EnableDetectSplit *bool `json:"EnableDetectSplit,omitempty" name:"EnableDetectSplit"`

	// Whether to enable PDF recognition. Default value: `false`. If you enable this feature, both images and PDF files can be recognized.
	IsPdf *bool `json:"IsPdf,omitempty" name:"IsPdf"`

	// Number of a PDF page that needs to be recognized. Currently, only one single page can be recognized. This parameter takes effect only if a PDF file is uploaded and `IsPdf` is set to `true`. Default value: `1`
	PdfPageNumber *uint64 `json:"PdfPageNumber,omitempty" name:"PdfPageNumber"`
}

func NewGeneralAccurateOCRRequest

func NewGeneralAccurateOCRRequest() (request *GeneralAccurateOCRRequest)

func (*GeneralAccurateOCRRequest) FromJsonString

func (r *GeneralAccurateOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*GeneralAccurateOCRRequest) ToJsonString

func (r *GeneralAccurateOCRRequest) ToJsonString() string

type GeneralAccurateOCRResponse

type GeneralAccurateOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Information on recognized text, including the text line content, confidence, text line coordinates, and text line coordinates after rotation correction. For more information, please click the link on the left.
		TextDetections []*TextDetection `json:"TextDetections,omitempty" name:"TextDetections"`

		// Image rotation angle in degrees. 0° indicates horizontal text. A positive value indicates clockwise rotation. A negative value indicates anticlockwise rotation. For more information, please see <a href="https://intl.cloud.tencent.com/document/product/866/45139?from_cn_redirect=1">How to Correct Tilted Text</a>.
		Angel *float64 `json:"Angel,omitempty" name:"Angel"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewGeneralAccurateOCRResponse

func NewGeneralAccurateOCRResponse() (response *GeneralAccurateOCRResponse)

func (*GeneralAccurateOCRResponse) FromJsonString

func (r *GeneralAccurateOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*GeneralAccurateOCRResponse) ToJsonString

func (r *GeneralAccurateOCRResponse) ToJsonString() string

type GeneralBasicOCRRequest

type GeneralBasicOCRRequest struct {
	*tchttp.BaseRequest

	// Base64-encoded value of image/PDF.
	// The image/PDF cannot exceed 7 MB after being Base64-encoded. A resolution above 600x800 is recommended. PNG, JPG, JPEG, BMP, and PDF formats are supported.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// URL address of image/PDF. (This field is not supported outside Chinese mainland)
	// The image/PDF cannot exceed 7 MB after being Base64-encoded. A resolution above 600x800 is recommended. PNG, JPG, JPEG, BMP, and PDF formats are supported.
	// We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability. The download speed and stability of non-Tencent Cloud URLs may be low.
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`

	// Reserved field.
	Scene *string `json:"Scene,omitempty" name:"Scene"`

	// Language to recognize
	// The language can be automatically recognized or manually specified. Chinese-English mix (`zh`) is selected by default. Mixed characters in English and each supported language can be recognized together.
	// Valid values:
	// `zh`: Chinese-English mix
	// `zh_rare`: supports letters, digits, rare Chinese characters, Traditional Chinese characters, special characters, etc.
	// `auto`
	// `mix`: language mix
	// `jap`: Japanese
	// `kor`: Korean
	// `spa`: Spanish
	// `fre`: French
	// `ger`: German
	// `por`: Portuguese
	// `vie`: Vietnamese
	// `may`: Malay
	// `rus`: Russian
	// `ita`: Italian
	// `hol`: Dutch
	// `swe`: Swedish
	// `fin`: Finnish
	// `dan`: Danish
	// `nor`: Norwegian
	// `hun`: Hungarian
	// `tha`: Thai
	// `hi`: Hindi
	// `ara`: Arabic
	LanguageType *string `json:"LanguageType,omitempty" name:"LanguageType"`

	// Whether to enable PDF recognition. Default value: false. After this feature is enabled, both images and PDF files can be recognized at the same time.
	IsPdf *bool `json:"IsPdf,omitempty" name:"IsPdf"`

	// Page number of the PDF page that needs to be recognized. Only one single PDF page can be recognized. This parameter is valid if the uploaded file is a PDF and the value of the `IsPdf` parameter is `true`. Default value: 1.
	PdfPageNumber *uint64 `json:"PdfPageNumber,omitempty" name:"PdfPageNumber"`

	// Whether to return the character information. Default value: `false`
	IsWords *bool `json:"IsWords,omitempty" name:"IsWords"`
}

func NewGeneralBasicOCRRequest

func NewGeneralBasicOCRRequest() (request *GeneralBasicOCRRequest)

func (*GeneralBasicOCRRequest) FromJsonString

func (r *GeneralBasicOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*GeneralBasicOCRRequest) ToJsonString

func (r *GeneralBasicOCRRequest) ToJsonString() string

type GeneralBasicOCRResponse

type GeneralBasicOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Information of recognized text, including the text line content, confidence, text line coordinates, and text line coordinates after rotation correction. For more information, please click the link on the left.
		TextDetections []*TextDetection `json:"TextDetections,omitempty" name:"TextDetections"`

		// Detected language. For more information on the supported languages, please see the description of the `LanguageType` input parameter.
		Language *string `json:"Language,omitempty" name:"Language"`

		// Image rotation angle in degrees. 0° indicates horizontal text, a positive value indicates clockwise rotation, and a negative value indicates anticlockwise rotation. For more information, please see <a href="https://intl.cloud.tencent.com/document/product/866/45139?from_cn_redirect=1">How to Correct Tilted Text</a>.
		Angel *float64 `json:"Angel,omitempty" name:"Angel"`

		// Total number of PDF pages to be returned if the image is a PDF. Default value: 0.
		PdfPageSize *int64 `json:"PdfPageSize,omitempty" name:"PdfPageSize"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewGeneralBasicOCRResponse

func NewGeneralBasicOCRResponse() (response *GeneralBasicOCRResponse)

func (*GeneralBasicOCRResponse) FromJsonString

func (r *GeneralBasicOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*GeneralBasicOCRResponse) ToJsonString

func (r *GeneralBasicOCRResponse) ToJsonString() string

type HKIDCardOCRRequest

type HKIDCardOCRRequest struct {
	*tchttp.BaseRequest

	// Whether to check for authenticity.
	DetectFake *bool `json:"DetectFake,omitempty" name:"DetectFake"`

	// Whether to return identity photo.
	ReturnHeadImage *bool `json:"ReturnHeadImage,omitempty" name:"ReturnHeadImage"`

	// Base64 string of the image
	// Supported image formats: PNG, JPG, JPEG. GIF is not supported yet.
	// Supported image size: The downloaded image cannot exceed 7 MB after being Base64-encoded, and it cannot take longer than 3 seconds to download the image.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// URL address of image. (This field is not supported outside Chinese mainland)
	// Supported image formats: PNG, JPG, JPEG. GIF is currently not supported.
	// Supported image size: the downloaded image cannot exceed 3 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
	// We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability.
	// The download speed and stability of non-Tencent Cloud URLs may be low.
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`
}

func NewHKIDCardOCRRequest

func NewHKIDCardOCRRequest() (request *HKIDCardOCRRequest)

func (*HKIDCardOCRRequest) FromJsonString

func (r *HKIDCardOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*HKIDCardOCRRequest) ToJsonString

func (r *HKIDCardOCRRequest) ToJsonString() string

type HKIDCardOCRResponse

type HKIDCardOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Name in Chinese
		CnName *string `json:"CnName,omitempty" name:"CnName"`

		// Name in English
		EnName *string `json:"EnName,omitempty" name:"EnName"`

		// Telecode for the name in Chinese
		TelexCode *string `json:"TelexCode,omitempty" name:"TelexCode"`

		// Gender. Valid values: Male, Female
		Sex *string `json:"Sex,omitempty" name:"Sex"`

		// Date of birth
		Birthday *string `json:"Birthday,omitempty" name:"Birthday"`

		// Permanent identity card.
		// 0: non-permanent;
		// 1: permanent;
		// -1: unknown.
		Permanent *int64 `json:"Permanent,omitempty" name:"Permanent"`

		// Identity card number
		IdNum *string `json:"IdNum,omitempty" name:"IdNum"`

		// Document symbol, i.e., the symbol under the date of birth, such as "***AZ"
		Symbol *string `json:"Symbol,omitempty" name:"Symbol"`

		// First issue date
		FirstIssueDate *string `json:"FirstIssueDate,omitempty" name:"FirstIssueDate"`

		// Last receipt date
		CurrentIssueDate *string `json:"CurrentIssueDate,omitempty" name:"CurrentIssueDate"`

		// Authenticity check.
		// 0: unable to judge (because the image is blurred, incomplete, reflective, too dark, etc.);
		// 1: forged;
		// 2: authentic.
		// Note: this field may return null, indicating that no valid values can be obtained.
		FakeDetectResult *int64 `json:"FakeDetectResult,omitempty" name:"FakeDetectResult"`

		// Base64-encoded identity photo
		// Note: this field may return null, indicating that no valid values can be obtained.
		HeadImage *string `json:"HeadImage,omitempty" name:"HeadImage"`

		// Multiple alarm codes. If the ID card is spoofed, photocopied, or doctored, the corresponding alarm code will be returned.
		// -9102: alarm for photocopied document
		// -9103: alarm for spoofed document
		// -9104: alarm for doctored document
		// -9105: alarm for forged document
		WarningCode []*int64 `json:"WarningCode,omitempty" name:"WarningCode"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewHKIDCardOCRResponse

func NewHKIDCardOCRResponse() (response *HKIDCardOCRResponse)

func (*HKIDCardOCRResponse) FromJsonString

func (r *HKIDCardOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*HKIDCardOCRResponse) ToJsonString

func (r *HKIDCardOCRResponse) ToJsonString() string

type ItemCoord

type ItemCoord struct {

	// X-coordinate of top-left point.
	X *int64 `json:"X,omitempty" name:"X"`

	// Y-coordinate of top-left point.
	Y *int64 `json:"Y,omitempty" name:"Y"`

	// Width
	Width *int64 `json:"Width,omitempty" name:"Width"`

	// Height
	Height *int64 `json:"Height,omitempty" name:"Height"`
}

type MLIDCardOCRRequest

type MLIDCardOCRRequest struct {
	*tchttp.BaseRequest

	// Base64-encoded value of an image.
	// Supported image formats: PNG, JPG, JPEG. GIF is currently not supported.
	// Supported image size: the downloaded image cannot exceed 7 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// URL of an image. (This field is not supported outside the Chinese mainland)
	// Supported image formats: PNG, JPG, JPEG. GIF is currently not supported.
	// Supported image size: the downloaded image cannot exceed 7 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
	// We recommend storing the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability.
	// The download speed and stability of non-Tencent Cloud URLs may be low.
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`

	// Whether to return an image
	RetImage *bool `json:"RetImage,omitempty" name:"RetImage"`
}

func NewMLIDCardOCRRequest

func NewMLIDCardOCRRequest() (request *MLIDCardOCRRequest)

func (*MLIDCardOCRRequest) FromJsonString

func (r *MLIDCardOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*MLIDCardOCRRequest) ToJsonString

func (r *MLIDCardOCRRequest) ToJsonString() string

type MLIDCardOCRResponse

type MLIDCardOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Identity card number
		ID *string `json:"ID,omitempty" name:"ID"`

		// Name
		Name *string `json:"Name,omitempty" name:"Name"`

		// Address
		Address *string `json:"Address,omitempty" name:"Address"`

		// Gender
		Sex *string `json:"Sex,omitempty" name:"Sex"`

		// Alarm code
		// -9103	Alarm for photographed document
		// -9102	Alarm for photocopied document
		// -9106       Alarm for covered card
		Warn []*int64 `json:"Warn,omitempty" name:"Warn"`

		// Identity photo
		Image *string `json:"Image,omitempty" name:"Image"`

		// Extended field:
		// {
		//     ID:{
		//         Confidence:0.9999
		//     },
		//     Name:{
		//         Confidence:0.9996
		//     }
		// }
		AdvancedInfo *string `json:"AdvancedInfo,omitempty" name:"AdvancedInfo"`

		// Certificate type
		// MyKad  ID card
		// MyPR    Permanent resident card
		// MyTentera   Military identity card
		// MyKAS    Temporary ID card
		// POLIS  Police card
		// IKAD   Work permit
		// MyKid   Kid card
		Type *string `json:"Type,omitempty" name:"Type"`

		// Date of birth (currently, this field is only supported for IKAD).
		Birthday *string `json:"Birthday,omitempty" name:"Birthday"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewMLIDCardOCRResponse

func NewMLIDCardOCRResponse() (response *MLIDCardOCRResponse)

func (*MLIDCardOCRResponse) FromJsonString

func (r *MLIDCardOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*MLIDCardOCRResponse) ToJsonString

func (r *MLIDCardOCRResponse) ToJsonString() string

type MLIDPassportOCRRequest

type MLIDPassportOCRRequest struct {
	*tchttp.BaseRequest

	// Base64-encoded value of image. The image cannot exceed 7 MB in size after being Base64-encoded. A resolution above 500x800 is recommended. PNG, JPG, JPEG, and BMP formats are supported. It is recommended that the card part occupies more than 2/3 area of the image.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// Whether to return an image. Default value: false.
	RetImage *bool `json:"RetImage,omitempty" name:"RetImage"`
}

func NewMLIDPassportOCRRequest

func NewMLIDPassportOCRRequest() (request *MLIDPassportOCRRequest)

func (*MLIDPassportOCRRequest) FromJsonString

func (r *MLIDPassportOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*MLIDPassportOCRRequest) ToJsonString

func (r *MLIDPassportOCRRequest) ToJsonString() string

type MLIDPassportOCRResponse

type MLIDPassportOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Passport ID
		ID *string `json:"ID,omitempty" name:"ID"`

		// Name
		Name *string `json:"Name,omitempty" name:"Name"`

		// Date of birth
		DateOfBirth *string `json:"DateOfBirth,omitempty" name:"DateOfBirth"`

		// Gender (F: female, M: male)
		Sex *string `json:"Sex,omitempty" name:"Sex"`

		// Expiration date
		DateOfExpiration *string `json:"DateOfExpiration,omitempty" name:"DateOfExpiration"`

		// Issuing country
		IssuingCountry *string `json:"IssuingCountry,omitempty" name:"IssuingCountry"`

		// Nationality
		Nationality *string `json:"Nationality,omitempty" name:"Nationality"`

		// Alarm code
		// -9103 Alarm for spoofed card
		// -9102 Alarm for photocopied card
		// -9106 Alarm for covered card
		Warn []*int64 `json:"Warn,omitempty" name:"Warn"`

		// Identity photo
		Image *string `json:"Image,omitempty" name:"Image"`

		// Extended field:
		// {
		//     ID:{
		//         Confidence:0.9999
		//     },
		//     Name:{
		//         Confidence:0.9996
		//     }
		// }
		AdvancedInfo *string `json:"AdvancedInfo,omitempty" name:"AdvancedInfo"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewMLIDPassportOCRResponse

func NewMLIDPassportOCRResponse() (response *MLIDPassportOCRResponse)

func (*MLIDPassportOCRResponse) FromJsonString

func (r *MLIDPassportOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*MLIDPassportOCRResponse) ToJsonString

func (r *MLIDPassportOCRResponse) ToJsonString() string

type TableOCRRequest

type TableOCRRequest struct {
	*tchttp.BaseRequest

	// Base64-encoded value of image.
	// Supported image formats: PNG, JPG, JPEG. GIF is not supported at present.
	// Supported image size: the downloaded image cannot exceed 3 MB in size after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
	// Either `ImageUrl` or `ImageBase64` of the image must be provided; if both are provided, only `ImageUrl` will be used.
	ImageBase64 *string `json:"ImageBase64,omitempty" name:"ImageBase64"`

	// URL address of image. (This field is not supported outside Chinese mainland)
	// Supported image formats: PNG, JPG, JPEG. GIF is currently not supported.
	// Supported image size: the downloaded image cannot exceed 3 MB after being Base64-encoded. The download time of the image cannot exceed 3 seconds.
	// We recommend you store the image in Tencent Cloud, as a Tencent Cloud URL can guarantee higher download speed and stability.
	// The download speed and stability of non-Tencent Cloud URLs may be low.
	ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"`
}

func NewTableOCRRequest

func NewTableOCRRequest() (request *TableOCRRequest)

func (*TableOCRRequest) FromJsonString

func (r *TableOCRRequest) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*TableOCRRequest) ToJsonString

func (r *TableOCRRequest) ToJsonString() string

type TableOCRResponse

type TableOCRResponse struct {
	*tchttp.BaseResponse
	Response *struct {

		// Recognized text. For more information, please click the link on the left
		TextDetections []*TextTable `json:"TextDetections,omitempty" name:"TextDetections"`

		// Base64-encoded Excel data.
		Data *string `json:"Data,omitempty" name:"Data"`

		// The unique request ID, which is returned for each request. RequestId is required for locating a problem.
		RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
	} `json:"Response"`
}

func NewTableOCRResponse

func NewTableOCRResponse() (response *TableOCRResponse)

func (*TableOCRResponse) FromJsonString

func (r *TableOCRResponse) FromJsonString(s string) error

FromJsonString It is highly **NOT** recommended to use this function because it has no param check, nor strict type check

func (*TableOCRResponse) ToJsonString

func (r *TableOCRResponse) ToJsonString() string

type TextDetection

type TextDetection struct {

	// Recognized text line content.
	DetectedText *string `json:"DetectedText,omitempty" name:"DetectedText"`

	// Confidence. Value range: 0–100.
	Confidence *int64 `json:"Confidence,omitempty" name:"Confidence"`

	// Text line coordinates, which are represented as 4 vertex coordinates.
	// Note: this field may return null, indicating that no valid values can be obtained.
	Polygon []*Coord `json:"Polygon,omitempty" name:"Polygon"`

	// Extended field.
	// The paragraph information `Parag` returned by the `GeneralBasicOcr` API contains `ParagNo`.
	AdvancedInfo *string `json:"AdvancedInfo,omitempty" name:"AdvancedInfo"`

	// Pixel coordinates of the text line in the image after rotation correction, which is in the format of `(X-coordinate of top-left point, Y-coordinate of top-left point, width, height)`.
	ItemPolygon *ItemCoord `json:"ItemPolygon,omitempty" name:"ItemPolygon"`

	// Information about a character, including the character itself and its confidence. Supported APIs: `GeneralBasicOCR`, `GeneralAccurateOCR`
	Words []*DetectedWords `json:"Words,omitempty" name:"Words"`

	// Coordinates of a word’s four corners on the input image. Supported APIs: `GeneralBasicOCR`, `GeneralAccurateOCR`
	WordCoordPoint []*DetectedWordCoordPoint `json:"WordCoordPoint,omitempty" name:"WordCoordPoint"`
}

type TextTable

type TextTable struct {

	// Column index of the top-left corner of the cell.
	ColTl *int64 `json:"ColTl,omitempty" name:"ColTl"`

	// Row index of the top-left corner of the cell.
	RowTl *int64 `json:"RowTl,omitempty" name:"RowTl"`

	// Column index of the bottom-right corner of the cell.
	ColBr *int64 `json:"ColBr,omitempty" name:"ColBr"`

	// Row index of the bottom-right corner of the cell.
	RowBr *int64 `json:"RowBr,omitempty" name:"RowBr"`

	// Cell text
	Text *string `json:"Text,omitempty" name:"Text"`

	// Cell type. Valid values: body, header, footer
	Type *string `json:"Type,omitempty" name:"Type"`

	// Confidence. Value range: 0–100
	Confidence *int64 `json:"Confidence,omitempty" name:"Confidence"`

	// Text line coordinates, which are represented as 4 vertex coordinates.
	Polygon []*Coord `json:"Polygon,omitempty" name:"Polygon"`

	// Extended field
	AdvancedInfo *string `json:"AdvancedInfo,omitempty" name:"AdvancedInfo"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL