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'])
  • 相关阅读:
    Ceph
    linux五天光速入门
    shell编程
    Docker&K8S&持续集成与容器管理--系列教程
    openstack系列
    爬虫快速入门
    python奇闻杂技
    机器学习
    数据分析
    量化分析
  • 原文地址:https://www.cnblogs.com/energetic/p/13038620.html
Copyright © 2011-2022 走看看