Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaiDuAI ¶
type BaiDuAI struct { AppId string AppKey string SecretKey string AccessToken string OcrResult *OcrReturn IorcIn *IocrInput // contains filtered or unexported fields }
func NewBaiDuAI ¶
func (*BaiDuAI) GetAccessToken ¶
func (this *BaiDuAI) GetAccessToken()
func (*BaiDuAI) IocrNewInput ¶
func (this *BaiDuAI) IocrNewInput()
func (*BaiDuAI) IocrRecogniseFinance ¶
func (*BaiDuAI) OcrReceipt ¶
func (*BaiDuAI) StructInit ¶
func (this *BaiDuAI) StructInit()
type CharResult ¶
type CharResult struct { Location OcrLocation `json:"location"` // location 是 object{} 位置数组(坐标0点为左上角) Char string `json:"char"` //words 是 string 识别结果字符串 }
type IocrInput ¶
type IocrInput struct { Image string `json:"image"` //image true string - 图像数据,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式 Template string `json:"templateSign,omitempty"` //false string - 自定义模板的ID,举例:Nsdax2424asaAS791823112 Dectid int `json:"detectorId,omitempty"` //" false int 0 检测器ID,可选值仅有0。detectorId = 0时,启用混贴票据识别功能,可对发票粘贴单上的多张不同种类票据进行分类检测和识别 ClassId int `json:"classifierId"` //" false int - 分类器Id,用于指定使用哪个分类器。 }
type IocrJsonObject ¶
type IocrJsonObject struct { }
type OcrLocation ¶
type OcrReturn ¶
type OcrReturn struct { LogId uint64 `json:"log_id"` // log_id 是 uint64 唯一的log id,用于问题定位 WordsResultNum uint32 `json:"words_result_num"` //words_result_num 是 uint32 识别结果数,表示words_result的元素个数 WordsResult []WordReulst `json:"words_result"` //words_result 是 array[] 定位和识别结果数组 Chars []CharResult `json:"chars"` //chars 否 array[] 单字符结果,recognize_granularity=small时存在 Probability float32 `json:"probability"` //probability 否 float 识别结果中每一行的置信度值,包含average:行置信度平均值,variance:行置信度方差,min:行置信度最小值 }
type WordReulst ¶
type WordReulst struct { Location OcrLocation `json:"location"` // location 是 object{} 位置数组(坐标0点为左上角) Words string `json:"words"` //words 是 string 识别结果字符串 }
Click to show internal directories.
Click to hide internal directories.