Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetAccessTokenUrl = "https://aip.baidubce.com/oauth/2.0/token"
View Source
var OcrAccurateBasicUrl = "https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic"
Functions ¶
func GetImage64ByFile ¶
Types ¶
type GetAccessTokenResponse ¶
type GetAccessTokenResponse struct { AccessToken string `json:"access_token"` ExpiresIn int `json:"expires_in"` }
func GetAccessToken ¶
func GetAccessToken(apiKey string, secretKey string) (res *GetAccessTokenResponse, err error)
type OcrAccurateBasicResponse ¶
type OcrAccurateBasicResponse struct { LogId uint64 `json:"log_id"` // 唯一的log id,用于问题定位 Direction int32 `json:"direction"` // 图像方向,当 detect_direction=true 时返回该字段。 - 1:未定义, 0:正向, 1:逆时针90度, 2:逆时针180度, 3:逆时针270度 WordsResultNum uint32 `json:"words_result_num"` // 识别结果数,表示words_result的元素个数 WordsResult []*Words `json:"words_result"` //识别结果数组 }
func OcrAccurateBasicImage ¶
func OcrAccurateBasicImage(accessToken string, imageBase64 string) (res *OcrAccurateBasicResponse, err error)
func OcrAccurateBasicImageByFile ¶
func OcrAccurateBasicImageByFile(accessToken string, filePath string) (res *OcrAccurateBasicResponse, err error)
Click to show internal directories.
Click to hide internal directories.