https://github.com/calibr/node-cognitive-vision-ocr
Microsoft Cognitive Services Vision OCR Client
https://github.com/calibr/node-cognitive-vision-ocr
Last synced: 5 months ago
JSON representation
Microsoft Cognitive Services Vision OCR Client
- Host: GitHub
- URL: https://github.com/calibr/node-cognitive-vision-ocr
- Owner: calibr
- Created: 2016-12-07T20:46:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-25T16:41:44.000Z (over 8 years ago)
- Last Synced: 2025-09-22T00:21:13.621Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 85.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Microsoft Cognitive Services Vision OCR Client
### Install
`npm i cognitive-vision-ocr`
### Usage
In the example below image is sent for recognition as a buffer and response is returned in gcloud vision format(if you don't need to convert a response to gcloud format just remove `gcloud` option from request as well as `imageSize` because it is used only for converting)
```js
var ocr = require("./index");
var fs = require("fs");
var image = fs.readFileSync("./test.jpg");
ocr({
key: "PUT YOUR API KEY HERE",
image: image,
gcloud: true,
imageSize: {
width: 728,
height: 546
}
}).then((data) => {
console.log(JSON.stringify(data[1].responses[0].textAnnotations));
}).catch((err) => {
console.log(err);
});
```