吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 54021|回复: 580
收起左侧

[原创工具] 可识别手写字体的文字识别软件(附源码)

    [复制链接]
pwp 发表于 2019-6-11 14:43
本帖最后由 panwanpeng 于 2019-6-22 11:47 编辑

QQ图片20190611144023.png

QQ图片20190611143824.jpg

链接:https://pan.baidu.com/s/1Hv_MXJt-sDB0k0wJ0x0zdQ
提取码:mjgj
复制这段内容后打开百度网盘手机App,操作更方便哦

[Python] 纯文本查看 复制代码
from aip import AipOcr
APP_ID = '16462688'
API_KEY = 'uiSymXDuajlHu1zzDhzOxnrb'
SECRET_KEY = '0SnZbzYzeKT7fwNBSIbdl0BGrDLzNLGW'
client = AipOcr(APP_ID, API_KEY, SECRET_KEY)

class get_text():
    """ 读取图片 """
    @staticmethod
    def get_file_content(filePath):
        with open(filePath, 'rb') as fp:
            return fp.read()



    """ 调用通用文字识别(高精度版) """

    # client.basicAccurate(image)
    @staticmethod
    def gettext(filePath):
        #print(filePath)
        image = get_text.get_file_content(filePath)
        """ 如果有可选参数 """
        options = {}
        options["detect_direction"] = "true"
        options["probability"] = "true"

        """ 带参数调用通用文字识别(高精度版) """
        response = client.basicAccurate(image, options)
        #print(response)
        #data = response['words_result'][0]['words']
        content = []
        for info in response['words_result']:
            #print(info['words'])
            content.append(info['words'])
        return content

if __name__ == '__main__':
    get_text.gettext('D:/PycharmProjects/baiduaipOcr/example.jpg')


[Python] 纯文本查看 复制代码
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'jiemian.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(969, 597)
        self.pushButton = QtWidgets.QPushButton(Form)
        self.pushButton.setGeometry(QtCore.QRect(440, 500, 75, 23))
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(Form)
        self.pushButton_2.setGeometry(QtCore.QRect(440, 540, 75, 23))
        self.pushButton_2.setObjectName("pushButton_2")
        self.lineEdit = QtWidgets.QLineEdit(Form)
        self.lineEdit.setEnabled(False)
        self.lineEdit.setGeometry(QtCore.QRect(110, 440, 741, 41))
        self.lineEdit.setObjectName("lineEdit")
        self.textEdit = QtWidgets.QTextEdit(Form)
        self.textEdit.setGeometry(QtCore.QRect(10, 0, 951, 421))
        font = QtGui.QFont()
        font.setFamily("Agency FB")
        self.textEdit.setFont(font)
        self.textEdit.setObjectName("textEdit")
        self.label = QtWidgets.QLabel(Form)
        self.label.setEnabled(False)
        self.label.setGeometry(QtCore.QRect(250, 500, 181, 61))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setStyleStrategy(QtGui.QFont.PreferDefault)
        self.label.setFont(font)
        self.label.setWordWrap(True)
        self.label.setObjectName("label")

        self.retranslateUi(Form)
        self.pushButton.clicked.connect(Form.open_img)
        self.pushButton_2.clicked.connect(Form.shibie)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "盘州市第一中学文字识别软件(beta1.0)"))
        self.pushButton.setText(_translate("Form", "打开图片"))
        self.pushButton_2.setText(_translate("Form", "开始识别"))
        self.label.setText(_translate("Form", "软件利用百度AI高级识别助手,全世界上每天只能识别50次,非重要内容请别乱识别,谢谢!"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    Form = QtWidgets.QWidget()
    ui = Ui_Form()
    ui.setupUi(Form)
    Form.show()
    sys.exit(app.exec_())





[Python] 纯文本查看 复制代码
from PyQt5.Qt import QWidget,QApplication
from PyQt5.QtWidgets import QFileDialog
from jiemian import Ui_Form
from baiduaip import get_text
import sys

class MF(QWidget,Ui_Form):
    def __init__(self,parent = None,*args,**kwargs):
        super().__init__(parent,*args,**kwargs)
        self.setupUi(self)
    def open_img(self):
        print('打开图片')
        openfile_name = QFileDialog.getOpenFileName(self, '选择文件', '', 'Image files(*.jpg , *.png, *.bmp)')
        print(openfile_name[0])
        self.lineEdit.setText('您打开的图片是:'+openfile_name[0])
        self.imgagesurl = openfile_name[0]
    def shibie(self):
        print('识别')
        content = get_text.gettext(self.imgagesurl)
        data = '\n'.join(content)
        self.textEdit.setText(data)
        clipboard = QApplication.clipboard()
        clipboard.setText(data)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = MF()
    win.show()
    sys.exit(app.exec_())

baiduaipOcr.zip

9.09 KB, 阅读权限: 10, 下载次数: 830, 下载积分: 吾爱币 -2 CB

源码

免费评分

参与人数 135吾爱币 +125 热心值 +114 收起 理由
智识就是力量 + 1 + 1 请问是这么多人公用50次还是一个人50次呢
神的眼睛 + 1 谢谢@Thanks!
黄金体验 + 1 + 1 谢谢@Thanks!
haliman + 1 + 1 我很赞同!
fiveykof + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
jcfrff + 1 + 1 我很赞同!
lizmh + 1 + 1 我很赞同!
那年华 + 1 用心讨论,共获提升!
Jack + 1 用心讨论,共获提升!
haidibingjing + 1 + 1 <font style="vertical-align: inherit;"><font style=
dashan8614 + 1 + 1 我很赞同!
QQ364107535 + 1 我很赞同!
jing19900410 + 1 + 1 <font style="vertical-align: inherit;"><font style=
xgjing + 1 + 1 热心回复!
fuliqq + 1 + 1 鼓励转贴优秀软件安全工具和文档!
cao334 + 1 我很赞同!
swbhxf + 1 + 1 我很赞同!
lurong + 1 + 1 谢谢@Thanks!
xxsflsxx + 1 我很赞同!
yinghua520 + 1 <font style="vertical-align: inherit;"><font style=
穷屌丝 + 1 + 1 热心回复!
zipstar + 1 + 1 谢谢@Thanks!
Mr.zw + 1 + 1 鼓励转贴优秀软件安全工具和文档!
121802 + 1 + 1 我很赞同!
kmhtjf + 1 + 1 用心讨论,共获提升!
zdy666666 + 1 + 1 谢谢@Thanks!
tao无风不起浪 + 1 + 1 用心讨论,共获提升!
哲轩 + 1 + 1 谢谢@Thanks!
ok63136 + 1 我很赞同!
fzd129 + 1 + 1 谢谢@Thanks!
我诞生在中国 + 1 + 1 谢谢@Thanks!
simonfire + 1 + 1 我也在学Python
cnngtc + 1 + 1 对手机的资料没得办法,试试你这个,谢谢
bzhjl + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
ac13456 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
yuan来如此 + 1 + 1 谢谢@Thanks!
Lisaya + 1 + 1 谢谢@Thanks!
wta0 + 1 + 1 我很赞同!
guoxiaolu110 + 1 谢谢@Thanks!
九院男神 + 1 谢谢@Thanks!
awen131972 + 1 + 1 谢谢@Thanks!
jinjunv + 1 + 1 谢谢@Thanks!
爱情永不停机 + 1 + 1 感谢分享源码
novel奶优 + 1 + 1 谢谢@Thanks!
艾孜热提艾力 + 1 + 1 谢谢@Thanks!
llx0124 + 1 + 1 热心回复!
learnnovo + 1 + 1 谢谢@Thanks!
23070205 + 1 + 1 不支持后缀名为png,只能再添加jpg后再运行
abk + 1 + 1 谢谢@Thanks!
shannonding + 1 + 1 为什么我打开会显示404
wwqtzd1h + 1 + 1 谢谢@Thanks!
zhouyunfei1979 + 1 + 1 谢谢@Thanks!
overload-sama + 1 + 1 热心回复!
mxage + 1 + 1 我很赞同!
云海泪 + 1 + 1 谢谢@Thanks!
asuka_wx + 1 谢谢@Thanks!
凯尔特 + 1 + 1 请勿灌水,提高回帖质量是每位会员应尽的义务!
smb + 1 热心回复!
yangmason + 1 + 1 热心回复!
SpaceX + 1 谢谢@Thanks!
y20130401y + 1 + 1 谢谢@Thanks!
恋念天下 + 1 + 1 应该弄个可以设置自己API的软件
陪我去洱海 + 1 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
zmyzzx + 1 + 1 谢谢@Thanks!
自治州制作 + 1 + 1 热心回复!
吾爱怕了使 + 1 + 1 谢谢@Thanks!
王星星 + 1 + 1 用心讨论,共获提升!
pzrmw + 1 我很赞同!
554110454 + 1 + 1 谢谢@Thanks!
xlrllp + 1 + 1 热心回复!
陈贪玩 + 1 + 1 谢谢@Thanks!
chao8709 + 1 + 1 热心回复!
chengdezong + 1 + 1 谢谢@Thanks!
a429796883 + 1 + 1 谢谢@Thanks!
wj1994 + 1 我很赞同!
16000 + 1 + 1 谢谢@Thanks!
wesjie + 1 + 1 谢谢@Thanks!
bookshop2018 + 1 + 1 谢谢@Thanks!
wanlishuang + 1 + 1 谢谢@Thanks!
60000ak + 1 + 1 热心回复!
wwwfjzx + 1 + 1 谢谢@Thanks!
lv3371 + 1 + 1 热心回复!
秋苗以苏 + 1 用心讨论,共获提升!
lchmails + 1 谢谢@Thanks!
zhaoxj0929 + 1 谢谢@Thanks!
dazhi1882 + 1 + 1 试了,可用,感谢
zhy0943 + 1 + 1 谢谢@Thanks!
785479792 + 1 + 1 热心回复!
onlychina + 1 感谢您的宝贵建议,我们会努力争取做得更好!
12315gf + 1 + 1 我很赞同!
jenas + 1 + 1 我也写了一个类似的,用的腾讯接口,手写识别不限次数
yanguichao + 1 + 1 收藏了。
lph619 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
l仰望0星空l + 1 + 1 热心回复!
wqsyx + 1 + 1 热心回复!
Pear + 1 + 1 谢谢@Thanks!
雨夜听心 + 1 谢谢@Thanks!
八巷旧友 + 1 热心回复!
Mr_He + 1 用心讨论,共获提升!
xu_1998619 + 1 热心回复!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

头像被屏蔽
liucq 发表于 2019-6-12 18:58
提示: 作者被禁止或删除 内容自动屏蔽
yn1019 发表于 2019-6-11 16:13
aoyabing 发表于 2019-7-8 20:57
mypwjcy 发表于 2019-6-12 00:15
识别手写的不错,谢谢楼主分享。
zhouqie123 发表于 2019-6-11 14:51
哦豁。这个看起来不错,谢谢分享
追逐太阳 发表于 2019-6-11 14:52
这个是基于什么api??
 楼主| pwp 发表于 2019-6-11 14:53
追逐太阳 发表于 2019-6-11 14:52
这个是基于什么api??

百度文字识别
Light紫星 发表于 2019-6-11 14:59
看起来不错,感谢分享
wqw5257 发表于 2019-6-11 15:03
下载了,有空试试。感谢分享。
-永俊 发表于 2019-6-11 15:05
哎哟,不错哦。~!接口写的不错
头像被屏蔽
养乐多 发表于 2019-6-11 15:05
提示: 作者被禁止或删除 内容自动屏蔽
小屁孩没有梦想 发表于 2019-6-11 15:15
识别率怎么样?
zzz111 发表于 2019-6-11 15:16
这个可以用  
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 提醒:禁止复制他人回复等『恶意灌水』行为,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-20 08:36

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表