ocr

package
v3.6.17 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CardTypeFront = "Front" // 正面
	CardTypeBack  = "Back"  // 背面
)

所有卡片方向

Variables

This section is empty.

Functions

This section is empty.

Types

type BankcardResponse

type BankcardResponse struct {
	request.CommonError
	Number string `json:"number"` // 银行卡号
}

type BusinessLicenseResponse

type BusinessLicenseResponse struct {
	request.CommonError
	RegNum              string `json:"reg_num"`              //	注册号
	Serial              string `json:"serial"`               //	编号
	LegalRepresentative string `json:"legal_representative"` //	法定代表人姓名
	EnterpriseName      string `json:"enterprise_name"`      //	企业名称
	TypeOfOrganization  string `json:"type_of_organization"` //	组成形式
	Address             string `json:"address"`              //	经营场所/企业住所
	TypeOfEnterprise    string `json:"type_of_enterprise"`   //	公司类型
	BusinessScope       string `json:"business_scope"`       //	经营范围
	RegisteredCapital   string `json:"registered_capital"`   //	注册资本
	PaidInCapital       string `json:"paid_in_capital"`      //	实收资本
	ValidPeriod         string `json:"valid_period"`         //	营业期限
	RegisteredDate      string `json:"registered_date"`      //	注册日期/成立日期
	CertPosition        struct {
		Position LicensePosition `json:"pos"`
	} `json:"cert_position"` //	营业执照位置
	ImgSize Size `json:"img_size"` //	图片大小
}

type CardType

type CardType = string

CardType 卡片方向

type DriverLicenseResponse

type DriverLicenseResponse struct {
	request.CommonError
	IDNum        string `json:"id_num"`        // 证号
	Name         string `json:"name"`          // 姓名
	Nationality  string `json:"nationality"`   // 国家
	Sex          string `json:"sex"`           // 性别
	Address      string `json:"address"`       // 地址
	BirthDate    string `json:"birth_date"`    // 出生日期
	IssueDate    string `json:"issue_date"`    // 初次领证日期
	CarClass     string `json:"car_class"`     // 准驾车型
	ValidFrom    string `json:"valid_from"`    // 有效期限起始日
	ValidTo      string `json:"valid_to"`      // 有效期限终止日
	OfficialSeal string `json:"official_seal"` // 印章文构
}

type IDCardResponse

type IDCardResponse struct {
	request.CommonError
	Type      CardType `json:"type"`       // 正面或背面,Front / Back
	ValidDate string   `json:"valid_date"` // 有效期
}

type LicensePosition

type LicensePosition struct {
	LeftTop     Point `json:"left_top"`
	RightTop    Point `json:"right_top"`
	RightBottom Point `json:"right_bottom"`
	LeftBottom  Point `json:"left_bottom"`
}

LicensePosition 证件位置

type OCR

type OCR struct {
	// contains filtered or unexported fields
}

func NewOCR

func NewOCR(request *request.Request, conbineURI func(url string, req interface{}, withToken bool) (string, error)) *OCR

func (*OCR) BankcardByFile

func (cli *OCR) BankcardByFile(filename string, mode RecognizeMode) (*BankcardResponse, error)

本接口提供基于小程序的银行卡 OCR 识别 通过图片文件识别

func (*OCR) BankcardByURL

func (cli *OCR) BankcardByURL(cardURL string, mode RecognizeMode) (*BankcardResponse, error)

本接口提供基于小程序的银行卡 OCR 识别 通过图片链接识别

func (*OCR) BusinessLicenseByFile

func (cli *OCR) BusinessLicenseByFile(filename string, mode RecognizeMode) (*BusinessLicenseResponse, error)

本接口提供基于小程序的营业执照 OCR 识别 通过图片文件识别

func (*OCR) BusinessLicenseByURL

func (cli *OCR) BusinessLicenseByURL(cardURL string, mode RecognizeMode) (*BusinessLicenseResponse, error)

本接口提供基于小程序的营业执照 OCR 识别 通过图片链接识别

func (*OCR) DriverLicenseByFile

func (cli *OCR) DriverLicenseByFile(filename string, mode RecognizeMode) (*DriverLicenseResponse, error)

本接口提供基于小程序的驾驶证 OCR 识别 通过图片文件识别

func (*OCR) DriverLicenseByURL

func (cli *OCR) DriverLicenseByURL(cardURL string, mode RecognizeMode) (*DriverLicenseResponse, error)

本接口提供基于小程序的驾驶证 OCR 识别 通过图片链接识别

func (*OCR) IDCardByFile

func (cli *OCR) IDCardByFile(filename string, mode RecognizeMode) (*IDCardResponse, error)

本接口提供基于小程序的身份证 OCR 识别 通过图片文件识别

func (*OCR) IDCardByURL

func (cli *OCR) IDCardByURL(cardURL string, mode RecognizeMode) (*IDCardResponse, error)

本接口提供基于小程序的身份证 OCR 识别 通过图片链接识别

func (*OCR) PrintedTextByFile

func (cli *OCR) PrintedTextByFile(filename string, mode RecognizeMode) (*PrintedTextResponse, error)

本接口提供基于小程序的通用印刷体 OCR 识别 通过图片文件识别

func (*OCR) PrintedTextByURL

func (cli *OCR) PrintedTextByURL(cardURL string, mode RecognizeMode) (*PrintedTextResponse, error)

本接口提供基于小程序的通用印刷体 OCR 识别 通过图片链接识别

func (*OCR) VehicleLicenseByFile

func (cli *OCR) VehicleLicenseByFile(filename string, mode RecognizeMode) (*VehicleLicenseResponse, error)

本接口提供基于小程序的行驶证 OCR 识别 通过图片文件识别

func (*OCR) VehicleLicenseByURL

func (cli *OCR) VehicleLicenseByURL(cardURL string, mode RecognizeMode) (*VehicleLicenseResponse, error)

本接口提供基于小程序的行驶证 OCR 识别 通过图片链接识别

type Point

type Point struct {
	X uint `json:"x"`
	Y uint `json:"y"`
}

证件点位

type PrintedTextResponse

type PrintedTextResponse struct {
	request.CommonError
	Items []struct {
		Text     string          `json:"text"`
		Position LicensePosition `json:"pos"`
	} `json:"items"` //	识别结果
	ImgSize Size `json:"img_size"` //	图片大小
}

type RecognizeMode

type RecognizeMode = string

RecognizeMode 图片识别模式

const (
	RecognizeModePhoto RecognizeMode = "photo" // 拍照模式
	RecognizeModeScan  RecognizeMode = "scan"  // 扫描模式
)

所有图片识别模式

type Size

type Size struct {
	H uint `json:"h"`
	W uint `json:"w"`
}

证件尺寸

type VehicleLicenseResponse

type VehicleLicenseResponse struct {
	request.CommonError
	VehicleType                string `json:"vehicle_type"`
	Owner                      string `json:"owner"`
	Addr                       string `json:"addr"`
	UseCharacter               string `json:"use_character"`
	Model                      string `json:"model"`
	Vin                        string `json:"vin"`
	EngineNum                  string `json:"engine_num"`
	RegisterDate               string `json:"register_date"`
	IssueDate                  string `json:"issue_date"`
	PlateNumB                  string `json:"plate_num_b"`
	Record                     string `json:"record"`
	PassengersNum              string `json:"passengers_num"`
	TotalQuality               string `json:"total_quality"`
	TotalprepareQualityQuality string `json:"totalprepare_quality_quality"`
}

Jump to

Keyboard shortcuts

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