ocr

package
v0.3.1-alpha.1 Latest Latest
Warning

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

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

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(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 OCRResponse struct {
	*req.Resp
}

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

Jump to

Keyboard shortcuts

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