ocr

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

OCR

Documentation

Index

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 NewOCRClient(apiKey, secretKey string) *OCRClient

func (*OCRClient) BankcardRecognize

func (oc *OCRClient) BankcardRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

func (*OCRClient) DriverLicenseRecognize

func (oc *OCRClient) DriverLicenseRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

func (*OCRClient) FromdataRecognize

func (oc *OCRClient) FromdataRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

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 (oc *OCRClient) IdcardRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

func (*OCRClient) LicensePlateRecognize

func (oc *OCRClient) LicensePlateRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

func (*OCRClient) VehicleLicenseRecognize

func (oc *OCRClient) VehicleLicenseRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

func (*OCRClient) WebImageRecognize

func (oc *OCRClient) WebImageRecognize(imageReader io.Reader, params ...RequestParam) ([]byte, error)

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 DetectLanguage

func DetectLanguage() RequestParam

是否检测语言,默认不检测。 当前支持(中文、英语、日语、韩语)

func DetectRisk

func DetectRisk() RequestParam

是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能,默认不开启,即:false。 可选值:true-开启;false-不开启

func IDCardSide

func IDCardSide(side string) RequestParam

front:身份证含照片的一面;back:身份证带国徽的一面

func LanguageType

func LanguageType(lang string) RequestParam

识别语言类型,默认为CHN_ENG。

func MultiDetect

func MultiDetect() RequestParam

是否检测多张车牌,默认为false,当置为true的时候可以对一张图片内的多张车牌进行识别

func RecognizeGranularity

func RecognizeGranularity() RequestParam

是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置

func UnifiedValidPeriod

func UnifiedValidPeriod() RequestParam

true: 归一化格式输出;false 或无此参数按非归一化格式输出

func WithProbability

func WithProbability() RequestParam

是否返回识别结果中每一行的置信度

func WithVertexesLocation

func WithVertexesLocation() RequestParam

是否返回文字外接多边形顶点位置,不支持单字位置。默认为false

type Size

type Size struct {
	Height int
	Width  int
}

Jump to

Keyboard shortcuts

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