I am new to Google Cloud Vision API. I am doing OCR on images primarily for bills and receipts.
For a few images it is working fine, but when I try some other images it gives me this error:
Error: { [Error: Request Admission Denied.]
code: 400,
errors:
[ { message: 'Request Admission Denied.',
domain: 'global',
reason: 'badRequest' } ] }
This is my code:
// 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);
}