Skip to content

Instantly share code, notes, and snippets.

@thesandlord
Created April 7, 2016 00:37
Show Gist options
  • Save thesandlord/86c433f1bc71e069816d6f85e2a9378d to your computer and use it in GitHub Desktop.
Save thesandlord/86c433f1bc71e069816d6f85e2a9378d to your computer and use it in GitHub Desktop.
var gcloud = require('gcloud')({
keyFilename: '/path/to/keyfile.json',
projectId: '<YOUR-PROJECT-HERE>'
});
var vision = gcloud.vision();
var image = 'image.jpg';
vision.detectText('image.jpg', function(err, text, apiResponse) {
// text = ['This was text found in the image']
});
@milapj
Copy link

milapj commented Sep 26, 2016

How do i print out the detected text in the terminal. I am new to node.js.

@giandrea77
Copy link

I did in this way:

const fullTextAnnotation = response[0].fullTextAnnotation;
console.log(fullTextAnnotation.text);

Check this: https://stackoverflow.com/questions/47641619/image-detection-with-google-vison-and-nodejs/47657567#47657567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment