跳到主要内容
版本:v6.5.0

图像OCR识别

命令说明

对指定图像进行OCR识别,调用时需要访问互联网

命令原型

sText = GoogleOCR.ImageOCR(sFileName, sApiKey)

命令参数

参数必选类型默认值说明
sFileNameTruepathC:\Users被识别的图片路径,支持jpeg、png、gif、bmp、webp、raw、ico格式,图片大小必须小于20M
sApiKeyTruestring空字符串请从Google Cloud Platform上的 Credentials 中复制 API Key

返回结果

sText,将命令运行后的结果赋值给此变量

运行实例

/*********************************图像OCR识别*********************************
命令原型:
sText = GoogleOCR.ImageOCR(sFileName, sApiKey)
入参:
sFileName--识别图片。注:被识别的图片路径,支持jpeg、png、gif、bmp、webp、raw、ico格式,图片大小必须小于20M
sApiKey--API Key。注:请从Google Cloud Platform上的 Credentials 中复制 API Key

出参:

注意事项:

********************************************************************************/
sText = GoogleOCR.ImageOCR(sFileName, sApiKey)