質問編集履歴

1

コード追加

2017/04/26 13:23

投稿

takaxs
takaxs

スコア11

test CHANGED
@@ -1 +1 @@
1
- PDF等の画像の文字の文字サイズを取得する方法
1
+ PDF等の画像の文字の文字サイズを取得できず困っていま
test CHANGED
@@ -12,6 +12,68 @@
12
12
 
13
13
 
14
14
 
15
+ 文字認識で試したソース一応載せておきます。
16
+
17
+ 何の文字なのかまでは認識できてませんが動いたものです。
18
+
19
+
20
+
21
+ このソースに修正や追加を行って対応可能でしょうか?
22
+
23
+
24
+
25
+
26
+
27
+ ```python
28
+
29
+
30
+
31
+ from PIL import Image
32
+
33
+ import sys
34
+
35
+ import pyocr
36
+
37
+ import pyocr.builders
38
+
39
+
40
+
41
+ tools = pyocr.get_available_tools()
42
+
43
+ if len(tools) == 0:
44
+
45
+ print("No OCR tool found")
46
+
47
+ sys.exit(1)
48
+
49
+ # The tools are returned in the recommended order of usage
50
+
51
+ tool = tools[0]
52
+
53
+
54
+
55
+ txt = tool.image_to_string(
56
+
57
+ Image.open('D:/sample.png'),
58
+
59
+ lang="jpn+eng",
60
+
61
+ builder=pyocr.builders.TextBuilder(tesseract_layout=6)
62
+
63
+ )
64
+
65
+
66
+
67
+ print(txt)
68
+
69
+
70
+
71
+ ```
72
+
73
+
74
+
75
+
76
+
15
77
  やり方が分かる方、是非教えていただければ幸いです。
16
78
 
17
79
  何卒宜しくお願い申し上げます。