Documentation ¶
Index ¶
- Constants
- type OCRClient
- func (oc *OCRClient) BankcardRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) DriverLicenseRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) FormDataRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) GeneralRecognizeBasic(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) GeneralRecognizeEnhanced(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) GeneralRecognizeWithLocation(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) IdCardRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) LicensePlateRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) VehicleLicenseRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- func (oc *OCRClient) WebImageRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
- type OCRResponse
- type RequestParam
- func Accuracy(opt string) RequestParam
- func DetectDirection() RequestParam
- func DetectLanguage() RequestParam
- func DetectRisk() RequestParam
- func IDCardSide(side string) RequestParam
- func LanguageType(lang string) RequestParam
- func MultiDetect() RequestParam
- func RecognizeGranularity() RequestParam
- func UnifiedValidPeriod() RequestParam
- func WithProbability() RequestParam
- func WithVertexesLocation() RequestParam
Constants ¶
const ( OCR_GENERAL_BASIC_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic" OCR_GENERAL_WITH_LOCATION_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/general" OCR_GENERAL_ENHANCED_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_enhanced" )
const ( OCR_WEBIMAGE_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/webimage" OCR_IDCARD_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/idcard" OCR_BANKCARD_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/bankcard" OCR_DRIVERLICENSE_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/driving_license" OCR_VEHICLELICENSE_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_license" OCR_LICENSEPLATE_URL = "https://aip.baidubce.com/rest/2.0/ocr/v1/license_plate" OCR_FORM_URL = "https://aip.baidubce.com/rest/2.0/solution/v1/form_ocr/request" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OCRClient ¶
type OCRClient struct {
*gosdk.Client
}
func NewOCRClient ¶
func (*OCRClient) BankcardRecognize ¶
func (oc *OCRClient) BankcardRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
BankcardRecognize 银行卡识别 识别银行卡的卡号并返回发卡行和卡片性质信息
func (*OCRClient) DriverLicenseRecognize ¶
func (oc *OCRClient) DriverLicenseRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
DriverLicenseRecognize 驾驶证识别 识别机动车驾驶证所有关键字段
func (*OCRClient) FormDataRecognize ¶
func (oc *OCRClient) FormDataRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
FormDataRecognize 表格文字识别 自动识别表格线及表格内容,结构化输出表头、表尾及每个单元格的文字内容
func (*OCRClient) GeneralRecognizeBasic ¶
func (oc *OCRClient) GeneralRecognizeBasic(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
GeneralRecognizeBasic 通用文字识别 识别图片中的文字信息
func (*OCRClient) GeneralRecognizeEnhanced ¶
func (oc *OCRClient) GeneralRecognizeEnhanced(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
GeneralRecognizeEnhanced 通用文字识别(含生僻字) 识别图片中的文字信息(包含对常见字和生僻字的识别)
func (*OCRClient) GeneralRecognizeWithLocation ¶
func (oc *OCRClient) GeneralRecognizeWithLocation(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
GeneralRecognizeWithLocation 通用文字识别(含位置信息) 识别图片中的文字信息(包含文字区域的坐标信息)
func (*OCRClient) IdCardRecognize ¶
func (oc *OCRClient) IdCardRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
IdCardRecognize 身份证识别 识别身份证正反面的文字信息
func (*OCRClient) LicensePlateRecognize ¶
func (oc *OCRClient) LicensePlateRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
LicensePlateRecognize 车牌识别 对小客车的车牌进行识别
func (*OCRClient) VehicleLicenseRecognize ¶
func (oc *OCRClient) VehicleLicenseRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
VehicleLicenseRecognize 行驶证识别 识别机动车行驶证所有关键字段
func (*OCRClient) WebImageRecognize ¶
func (oc *OCRClient) WebImageRecognize(image *vision.Image, params ...RequestParam) (*OCRResponse, error)
WebImageRecognize 网络图片识别 识别一些网络上背景复杂,特殊字体的文字
type OCRResponse ¶
type RequestParam ¶
type RequestParam func(map[string]interface{})
func Accuracy ¶
func Accuracy(opt string) RequestParam
normal 使用快速服务,1200ms左右时延;缺省或其它值使用高精度服务,1600ms左右时延
func DetectDirection ¶
func DetectDirection() RequestParam
是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括: - true:检测朝向; - false:不检测朝向。
func DetectRisk ¶
func DetectRisk() RequestParam
是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能,默认不开启,即:false。 可选值:true-开启;false-不开启
func RecognizeGranularity ¶
func RecognizeGranularity() RequestParam
是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
func WithVertexesLocation ¶
func WithVertexesLocation() RequestParam
是否返回文字外接多边形顶点位置,不支持单字位置。默认为false