Just started exploring Google Cloud Vision APIs. From their guide:
const client = new vision.ImageAnnotatorClient();
const fileName = 'Local image file, e.g. /path/to/image.png';
const [result] = await client.textDetection(fileName);
However, I wanna use base64 representation of binary image data, since they claim that it's possible to use.
I found this reference on SO: Google Vision API Text Detection with Node.js set Language hint
Instead of imageUri
I used "content": string
as mentioned here. But the SO sample uses const [result] = await client.batchAnnotateImages(request);
method. I tried using same technique on const [result] = await client.textDetection(
method and it gave me an error.
So my question is: Is it possible to use base64 encoded string to represent image in order to perform TEXT_DETECTION ? And if so, how?
Any kind of help is highly appreciated.