Documentation ¶
Index ¶
- Constants
- type OCRClient
- func (oc *OCRClient) BankcardRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) DriverLicenseRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) FromdataRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) GeneralRecognizeBasic(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) GeneralRecognizeEnhanced(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) GeneralRecognizeWithLocation(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) IdcardRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) LicensePlateRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) VehicleLicenseRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- func (oc *OCRClient) WebImageRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)
- 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
- type Size
Constants ¶
View Source
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" )
View Source
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 (*OCRClient) DriverLicenseRecognize ¶
func (*OCRClient) FromdataRecognize ¶
func (*OCRClient) GeneralRecognizeBasic ¶
func (oc *OCRClient) GeneralRecognizeBasic(imageReader io.Reader, params ...RequestParam) ([]byte, error)
GeneralRecognizeBasic 通用文字识别 img 图片二进制数据 conf 请求参数
func (*OCRClient) GeneralRecognizeEnhanced ¶
func (oc *OCRClient) GeneralRecognizeEnhanced(imageReader io.Reader, params ...RequestParam) ([]byte, error)
GeneralRecognizeEnhanced 通用文字识别(含生僻字)
func (*OCRClient) GeneralRecognizeWithLocation ¶
func (oc *OCRClient) GeneralRecognizeWithLocation(imageReader io.Reader, params ...RequestParam) ([]byte, error)
GeneralRecognizeWithLocation 通用文字识别(含位置信息)
func (*OCRClient) IdcardRecognize ¶
func (*OCRClient) LicensePlateRecognize ¶
func (*OCRClient) VehicleLicenseRecognize ¶
func (*OCRClient) WebImageRecognize ¶
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
Click to show internal directories.
Click to hide internal directories.