zoukankan      html  css  js  c++  java
  • 字体识别

     1 from aip import AipOcr
     2 
     3 """ 你的 APPID AK SK """
     4 APP_ID =
     5 API_KEY =
     6 SECRET_KEY =
     7 
     8 client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
     9 """ 读取图片 """
    10 def get_file_content(filePath):
    11     with open(filePath, 'rb') as fp:
    12         return fp.read()
    13 
    14 image = get_file_content(r'D:数学.png')
    15 
    16 """ 调用通用文字识别, 图片参数为本地图片 """
    17 client.basicGeneral(image);
    18 
    19 """ 如果有可选参数 """
    20 options = {}
    21 options["language_type"] = "CHN_ENG"
    22 options["detect_direction"] = "true"
    23 options["detect_language"] = "true"
    24 options["probability"] = "true"
    25 
    26 """ 带参数调用通用文字识别, 图片参数为本地图片 """
    27 a=client.basicGeneral(image, options)
    28 b=a[ 'words_result']
    29 for  i in b:
    30     print(i['words'])
  • 相关阅读:
    Python基础知识
    Oracle 总结
    Linux基本命令
    测试理论
    计算机基础
    http常见的状态码,400,401,403状态码分别代表什么?
    html
    day21 包
    day20 模块引入的一些说明
    我又回来了???
  • 原文地址:https://www.cnblogs.com/luckiness/p/13080464.html
Copyright © 2011-2022 走看看