Documentation ¶
Overview ¶
Package ocr OCR
Index ¶
- func Bankcard(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
- func BusinessLicense(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
- func DriverLicense(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
- func Idcard(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
- func PrintedText(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
- func VehicleLicense(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bankcard ¶
func Bankcard(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
本接口提供基于小程序的银行卡 OCR 识别
See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.bankcard.html
POST https://api.weixin.qq.com/cv/ocr/bankcard?type=MODE&img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "net/url" "github.com/Lead-NorthStar/miniprogram" "github.com/Lead-NorthStar/miniprogram/apis/ocr" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") params := url.Values{} resp, err := ocr.Bankcard(ctx, payload, params) fmt.Println(resp, err) }
Output:
func BusinessLicense ¶
func BusinessLicense(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
本接口提供基于小程序的营业执照 OCR 识别
See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.businessLicense.html
POST https://api.weixin.qq.com/cv/ocr/bizlicense?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "net/url" "github.com/Lead-NorthStar/miniprogram" "github.com/Lead-NorthStar/miniprogram/apis/ocr" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") params := url.Values{} resp, err := ocr.BusinessLicense(ctx, payload, params) fmt.Println(resp, err) }
Output:
func DriverLicense ¶
func DriverLicense(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
本接口提供基于小程序的驾驶证 OCR 识别
See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.driverLicense.html
POST https://api.weixin.qq.com/cv/ocr/drivinglicense?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "net/url" "github.com/Lead-NorthStar/miniprogram" "github.com/Lead-NorthStar/miniprogram/apis/ocr" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") params := url.Values{} resp, err := ocr.DriverLicense(ctx, payload, params) fmt.Println(resp, err) }
Output:
func Idcard ¶
func Idcard(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
本接口提供基于小程序的身份证 OCR 识别
See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.idcard.html
POST https://api.weixin.qq.com/cv/ocr/idcard?type=MODE&img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "net/url" "github.com/Lead-NorthStar/miniprogram" "github.com/Lead-NorthStar/miniprogram/apis/ocr" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") params := url.Values{} resp, err := ocr.Idcard(ctx, payload, params) fmt.Println(resp, err) }
Output:
func PrintedText ¶
func PrintedText(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
本接口提供基于小程序的通用印刷体 OCR 识别
See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.printedText.html
POST https://api.weixin.qq.com/cv/ocr/comm?img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "net/url" "github.com/Lead-NorthStar/miniprogram" "github.com/Lead-NorthStar/miniprogram/apis/ocr" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") params := url.Values{} resp, err := ocr.PrintedText(ctx, payload, params) fmt.Println(resp, err) }
Output:
func VehicleLicense ¶
func VehicleLicense(ctx *miniprogram.Miniprogram, payload []byte, params url.Values) (resp []byte, err error)
本接口提供基于小程序的行驶证 OCR 识别
See: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.vehicleLicense.html
POST https://api.weixin.qq.com/cv/ocr/driving?type=MODE&img_url=ENCODE_URL&access_token=ACCESS_TOCKEN
Example ¶
package main import ( "fmt" "net/url" "github.com/Lead-NorthStar/miniprogram" "github.com/Lead-NorthStar/miniprogram/apis/ocr" ) func main() { var ctx *miniprogram.Miniprogram payload := []byte("{}") params := url.Values{} resp, err := ocr.VehicleLicense(ctx, payload, params) fmt.Println(resp, err) }
Output:
Types ¶
This section is empty.