New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tims-ocr-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tims-ocr-api

OCR for TIMS-server API

latest
Source
npmnpm
Version
3.2.0
Version published
Weekly downloads
15
36.36%
Maintainers
1
Weekly downloads
 
Created
Source

TIMS-OCR-API For Nodejs

NPM version Build Status Coveralls Status

Downloads

intro

TIMS OCR提供两种接口:

  • Socket
  • HTTP(已废弃)

将Socket接口封装成OCR.scan()这样的Node.js接口。

API Document: https://yyssc.github.io/tims-ocr-api/jsdoc/

Advantages

  • 支持本地图片 外部图片(速度取决图片大小)
  • 用扫描仪扫描出的发票,识别率基本能达到 95%
  • 支持 shell/nodejs 全局安装可在控制台直接运行
  • bluebird/promise 接口操作灵活

识别发票类型

  • 增值税专用发票(票样

依赖

  • 安装ocr_srv并启动./start.sh

Install & Usage

1. Global

npm install tims-ocr-api -g

ocr --help

# 远程图片
ocr http://7pun4e.com1.z0.glb.clouddn.com/test.jpg

# 本地图片
ocr ./test.jpg
OCR识别输入和输出

ocr example

2. Nodejs

npm install tims-ocr-api --save

FYI examples

var host = '127.0.0.1';
var port = '39456';
var ocr = require('tims-ocr-api').create(host, port);
// 本地图片
ocr.upload('/tmp/test.jpg').then(function (result) {
  return console.log(result)
}).catch(function (err) {
  console.log('err', err);
})

Run UnitTest

make test
DEBUG=* make test # show debug log
mocha --ui tdd -g 'utils' # only test 'utils', and use TDD interface
make cov # Coverage rate

Note: travis-ci.org will run this test https://travis-ci.org/yyssc/tims-ocr-api

Build API document

grunt [jsdoc]

Publish API doc to github project pages

The generated API document is located in out/ dir.

.utility/push-jsdoc-to-gh-pages.sh will called when travis-ci finished Unittest, to push out/ dir to branch gh-pages of current repo.

TODO: out/ should generated automatically.

Mock server

You could use a mock test for testing.

https://github.com/yyssc/mock-tims-ocr

test data

ocr_srv API

OCR server socket API

License MIT

Keywords

ocr

FAQs

Package last updated on 12 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts