baidu_ocr 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -0
- data/lib/baidu_ocr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c519c767783e3197dddedf726025c2495c345ca0
|
4
|
+
data.tar.gz: a1d887adee28b9e3c565e51d67304f10b89a60ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67bcab9e1affbe8d7630fac02f700787282b13a3c3e6a3a4143456936be41a19611b22771a4b98fc5cb795c188c84ba7d6c9e44669567c4e70c03a059343bdfb
|
7
|
+
data.tar.gz: 68dd9157ffe82aa5ce97752ff771a5337025f438b70717309f13a9897c4a16de3a84ef613c72b7b3ce203117c28949f1df3a6b297ae4d671c32adcfeaf247f72
|
data/README.md
CHANGED
@@ -10,6 +10,12 @@ Add this line to your application's Gemfile:
|
|
10
10
|
gem 'baidu_ocr', :git => 'https://github.com/rudyboy/baidu_ocr'
|
11
11
|
```
|
12
12
|
|
13
|
+
or
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem install baidu_ocr
|
17
|
+
```
|
18
|
+
|
13
19
|
And then execute:
|
14
20
|
|
15
21
|
$ bundle
|
@@ -20,6 +26,19 @@ And then execute:
|
|
20
26
|
``` ruby
|
21
27
|
require 'baidu_ocr'
|
22
28
|
|
29
|
+
# 参数说明
|
30
|
+
# 1. detectType
|
31
|
+
# LocateRecognize: 整图文字检测、识别,以行为单位(默认)
|
32
|
+
# Locate:整图文字行定位
|
33
|
+
# Recognize:整图文字识别
|
34
|
+
# SingleCharRecognize:单字图像识别
|
35
|
+
|
36
|
+
# 2. languageType
|
37
|
+
# CHN_ENG(中英)(默认)
|
38
|
+
# ENG(英文)
|
39
|
+
# JAP(日文)
|
40
|
+
# KOR(韩文)
|
41
|
+
|
23
42
|
# local image && imagetype = 1
|
24
43
|
BaiduOcr.init_baidu_ocr(apikey: 'your api',
|
25
44
|
image: 'bit.jpg',
|
@@ -44,6 +63,17 @@ BaiduOcr.init_baidu_ocr(apikey: 'your api',
|
|
44
63
|
imagetype: 2)
|
45
64
|
puts BaiduOcr.recognize
|
46
65
|
|
66
|
+
# 完全自定义参数
|
67
|
+
BaiduOcr.init_baidu_ocr(fromdevice:'your device',
|
68
|
+
clientip: 'your clientip',
|
69
|
+
detecttype: 'your detecttype',
|
70
|
+
languagetype: 'your languagetype',
|
71
|
+
imagetype: 'your imagetype',
|
72
|
+
image: 'your image path',
|
73
|
+
apikey: 'your api'
|
74
|
+
)
|
75
|
+
puts BaiduOcr.recognize
|
76
|
+
|
47
77
|
```
|
48
78
|
|
49
79
|
## 结果对比
|
data/lib/baidu_ocr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baidu_ocr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rudyboy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|