纯JavaScript实现的OCR库:okrabyte
jopen
10年前
okrabyte是一个 OCR 库,采用纯JavaScript实现。用于node.js应用,基于 ocrad.js开发。
Install
$ npm install okrabyte -S
How to use
Simple :
var okrabyte = require("okrabyte"); okrabyte.decodeFile("test/fixture/hello_world.png", function(error, data){ console.log(data); // Hello World! });
From Buffer:
var okrabyte = require("okrabyte"); var fs = require("fs"); var buffer = fs.readFileSync("test/fixture/hello_world.png"); okrabyte.decodeBuffer(buffer, function(error, data){ console.log(data); // Hello World! });
From Stream:
var okrabyte = require("okrabyte"); var fs = require("fs"); var stream = fs.createReadStream("test/fixture/hello_world.png"); okrabyte.decodeStream(stream, function(error, data){ console.log(data); // Hello World! });