【发布时间】:2016-10-14 07:04:50
【问题描述】:
我是 Google Cloud Vision API 的新手。我主要针对账单和收据对图像进行 OCR。
对于一些图像,它工作正常,但是当我尝试其他一些图像时,它给了我这个错误:
Error: { [Error: Request Admission Denied.]
code: 400,
errors:
[ { message: 'Request Admission Denied.',
domain: 'global',
reason: 'badRequest' } ] }
这是我的代码:
// construct parameters
const req = new vision.Request({
image: new vision.Image('./uploads/reciept.png'),
features: [
new vision.Feature('TEXT_DETECTION', 1)
]
})
vision.annotate(req).then((res) => {
// handling response
//console.log(res.responses[0].textAnnotations);
var desc=res.responses[0].textAnnotations;
var descarr=[];
for (i = 0; i < desc.length; i++) {
descarr.push(desc[i].description);
}
【问题讨论】:
-
在对特定图像进行 OCR 时是否收到此错误?您能否继续对同一图像进行多次 OCR 以查看问题是否与图像规范或 API 本身有关?
标签: ocr gcloud google-cloud-vision google-vision