0.0.5 • Published 1 year ago

macos-ocr.js v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

WIP macos-ocr.js

NPM version CI Test coverage node version npm download

Powered by https://developer.apple.com/documentation/vision/vnrecognizetextrequest

Quick start

$ npm i macos-ocr.js -g

$ ocr path/to/image.png
// result
[
  {
    word: 'Hello world',
    rect: { left: 126, top: 54, width: 326, height: 60 },
    confidence: 0.5
  },
  ...
]

Build swift project

bash ./scripts/build.sh

Run sample

node ./sample/ocr.js

Installment

$ npm i macos-ocr.js --save

Usage

const { macosOcr } = require('macos-ocr.js');
const path = require('path');

(async function main() {
  const result = await macosOcr({
    imageUrl: path.join(__dirname, 'img.png'),
  });
  console.log(result);
})();
// result
[
  {
    word: 'Hello world',
    rect: { left: 126, top: 54, width: 326, height: 60 },
    confidence: 0.5
  },
  ...
]
0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago