質問するログイン新規登録

質問編集履歴

1

ソースコードの修正

2020/05/05 01:01

投稿

ponponta
ponponta

スコア1

title CHANGED
File without changes
body CHANGED
@@ -32,6 +32,12 @@
32
32
  with open(filepath, 'rb') as img:
33
33
  img_byte = img.read()
34
34
  return base64.b64encode(img_byte)
35
+ # 文字認識させたい画像を設定
36
+ img_base64 = img_to_base64('./test.png')
37
+ result = request_cloud_vison_api(img_base64)
38
+ # 認識した文字を出力
39
+ text_r = result["responses"][0]["textAnnotations"][1]["description"]
40
+ print(text_r)
35
41
  ```
36
42
 
37
43
  ### 試したこと