An eazy code from eazy ciphers

易密码的易密码

Hii!! welcome you all to our first medium story…. Well when I work on image datasets, I always think why these characters displayed in the image can be retrieved in a simple text format.

嗨! 欢迎大家来到我们的第一个中等故事…。 好吧,当我处理图像数据集时,我总是想为什么可以以简单的文本格式检索图像中显示的这些字符。

So, with that inspiration in mind to retrieve the data present in images. I surfed on the internet, I found a lot of ways to find and extract or recognize the characters present in an image.

因此,考虑到这一灵感,可以检索图像中存在的数据。 我在互联网上冲浪时,发现了很多查找和提取或识别图像中字符的方法。

In that surfing for character recognition, I found some online tools which will take input from the user and give the output.

在那次用于字符识别的冲浪中,我找到了一些在线工具,这些工具将吸收用户的输入并提供输出。

The same way, we thought to simply in much better eazy way that any beginner can understand it.

同样,我们认为以一种更加轻松自如的方式,任何初学者都可以理解它。

字符识别: (Character Recognition:)

Character Recognition process helps in the recognition of each text element with the accuracy of the characters.

字符识别过程有助于以字符的准确性识别每个文本元素。

The accuracy of classification and identification of characters or text elements in an image is measured by applying deep learning algorithms. These characters make a lot of difference in literature.

通过应用深度学习算法,可以测量图像中字符或文本元素的分类和识别准确性。 这些字符在文学上有很大的不同。

When we apply normal random techniques for recognition of characters may give some errors at a particular point. If we use deep learning OpenCV algorithm will give an effective output.

当我们应用正常的随机技术来识别字符时,可能会在特定点出现一些错误。 如果我们使用深度学习,OpenCV算法将给出有效的输出。

For the first way of approach to run our model, one has to install tesseract which is developed by Google as an optical character recognition engine.

对于运行模型的第一种方法,必须安装由Google作为光学字符识别引擎开发的tesseract。

pip install pytesseract

OpenCV: (OpenCV:)

Open CV is a deep learning technique where we mainly used to execute the data by calculating many eliminations of noises.

开放式简历是一种深度学习技术,我们主要通过计算许多消除的噪声来执行数据。

Open CV is the most popularly used algorithm in the branch of deep learning techniques.

Open CV是深度学习技术领域中使用最广泛的算法。

It makes the colossally reliant on the data appeared from the trained characters and helps in recognizing the text present in the image. Open CV makes the missing accuracy of an algorithm into a picture. Gray scaling gives a valid classification in the field of character recognition. So hereby we import all the necessary packages for making our model into a good track.

它极大地依赖于受过训练的角色显示的数据,并有助于识别图像中存在的文本。 开放式简历使算法丢失的准确性变成一幅图画。 灰度等级在字符识别领域提供了有效的分类。 因此,我们在此导入所有必要的软件包,以使我们的模型步入正轨。

In order to install OpenCV in your local computer use this command...

为了在您的本地计算机上安装OpenCV,请使用以下命令...

pip install opencv-python

图像可以直接读取到代码中吗? (Can an image be directly read to the code?)

Let's discuss what is affecting to recognize the characters:

让我们讨论影响识别字符的因素:

  • Noising in an image causes many factors of false recognition of characters. for ensuring noise-free in our recognition eliminate in code.图像中的噪声会导致许多错误识别字符的因素。 为确保无噪音,我们在代码中消除了识别。
  • When the image is not high resolution then identification fails. So, it is better to take a high-resolution image for accuracy in the result.当图像不是高分辨率时,识别将失败。 因此,为获得准确的结果,最好拍摄高分辨率的图像。
  • Some times the angle of the image also defects.有时图像的角度也会出现缺陷。
  • Reflection of an image makes incorrect in the assumption of text. It makes to identify the letter “F” as “P” like that so many.图像的反射使假定的文本不正确。 如此多的字母“ F”被识别为“ P”。
  • Fonts also vary the results if the code isn’t able to train it.如果代码无法训练字体,字体也会改变结果。
  • Various images have various styles of representation of the art, so, when there is more color complexion or multiple colors make incorrect assumptions of recognition text in an image.各种图像具有本领域的各种样式,因此,当出现更多肤色或多种颜色时,就会对图像中的识别文本做出不正确的假设。

Considering all the above factors in mind one have to build the code accordingly where all the test cases passes.

考虑到以上所有因素,必须在所有测试用例通过的地方相应地构建代码。

使用OpenCV识别字符的Python代码: (Python code for recognizing characters using OpenCV:)

This code can be downloaded for your easy understanding of approach to the recognition.

可以下载此代码,以方便您理解识别方法。

Importing all the packages:

导入所有软件包:

#import all the packagesimport cv2import numpy as npimport pytesseractfrom PIL import Image

once you install with the packages import those into code.

使用软件包安装后,将其导入代码。

Declare or initialize the path:

声明或初始化路径:

A tesseract is an open-source tool it can be downloaded from online. After downloading mention its path like below.

tesseract是一种开源工具,可以从网上下载。 下载后,请提及其路径,如下所示。

# path of pytesseract execution folder pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'# Path of imagemain_path = r'qu12.png'

Main Method:

主要方法:

In this part of code, we are implementing

在这部分代码中,我们正在实现

  • Read the image读取图像
  • Greyscale the image灰度图像
  • Do dilation and erosion to eliminate unwanted noises in the picture.进行膨胀和腐蚀以消除图像中不需要的噪声。
  • Write the image after the removal of the noise.去除噪点后写图像。
  • Apply the threshold to get the only black and white pictures.应用阈值以获取唯一的黑白图片。
  • Write the same image for the further recognition process.写入相同的图像以进行进一步的识别过程。
  • Character recognition with Tesseract.使用Tesseract进行字符识别。
def get_string(pic_path):    # Reading picture with opencv    pic = cv2.imread(pic_path)# grey-scale the picture    pic = cv2.cvtColor(pic, cv2.COLOR_BGR2GRAY)# Do dilation and erosion to eliminate unwanted noises    kernel = np.ones((1, 1), np.uint8)    pic = cv2.dilate(pic, kernel, iterations=20)    pic = cv2.erode(pic, kernel, iterations=20)# Write image after removed noise    cv2.imwrite(main_path + "no_noise.png", pic)#  threshold applying to get only black and white picture     pic = cv2.adaptiveThreshold(pic, 300, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 31, 2)# Write the image for later recognition process     cv2.imwrite(main_path + "threshold.png", pic)# Character recognition with tesseract    final = pytesseract.image_to_string(Image.open(main_path + "threshold.png"))return final

Display the final output:

显示最终输出:

print(get_string(src_path))

Inputs and outputs:

输入和输出:

Here we give the inputs which we have given to our code and outputs which we got later execution of our code.

在这里,我们给出输入到代码中的输入和输出,以便稍后执行代码。

Input:

输入:

Taken from the internet for sample recognition
从互联网上获取样本识别

Output:

输出:

Screenshot after the execution of code
执行代码后的屏幕截图

Our GitHub account for your reference in the code handling: https://github.com/eazyciphers/deep-learning-tutors

我们的GitHub帐户供您在代码处理中参考: https : //github.com/eazyciphers/deep-learning-tutors

For more updates do follow Eazy Ciphers

有关更多更新,请遵循Eazy密码

If you feel interested to our story please do clap and share to the budding beginners….

如果您对我们的故事感兴趣,请鼓掌并分享给初学者。

翻译自: https://medium.com/eazy-ciphers/character-recognition-using-deep-learning-opencv-python-f32d1f8b93b8


http://www.taodudu.cc/news/show-4864763.html

相关文章:

  • oauth0 oauth2_OAuth需要死于大火
  • 机器学习ml_机器学习简介(ML)
  • mysql字符集查看与设置
  • mysql字符集在哪设置_MySQL字符集设置
  • MySql数据库系统字符集
  • 面向对象编程,你真正懂吗?
  • 易语言 超级列表框 表头禁止来回拖动
  • 易语言 超级列表框的索引 是从0开始还是1开始的
  • 【易语言组合框和列表框联动】
  • 易语言超级列表框表项关键字搜索代码示例_易语言
  • 易语言超级列表框怎么设置文本颜色_条码打印软件如何设置条码和数字之间的间距...
  • 超级列表框导入到mysql_易语言excel表格怎样导入到超级列表框
  • 易语言 超级列表框 设置选中状态-选择框的 方法
  • 易语言之超级列表框的使用及json解析
  • 易语言一键选中取消选择列表框源码
  • e语言mysql怎么放在超级列表框_易语言如何把从mssql数据库读出来的信息全部显示在超级列表框内...
  • 易语言之选取被选中超级列表框内容
  • 易语言 图片插入超级列表框_4个超实用网站分享!PDF转换、图片资源、思维导图、在线抠图...
  • 易语言mysql列表框_详谈易语言的列表框
  • 易语言超级列表框 网络图片_网络被中断,稳赢被翻盘?网友:试试OPPO Reno3 Pro网络无缝切换...
  • e语言mysql怎么放在超级列表框,『易语言怎么将超级列表框的内容保存到excel或者Access!』...
  • k易语言html导入超级列表框,易语言超级列表框导入TXT内容的方法分享!
  • 易语言 图片插入超级列表框_利用PPT制作一个图片抽奖
  • 易语言超级列表框 网络图片_易语言实用例程1:简单的数据库网络操作(C/S架构)---下篇...
  • 易语言保存txt记录至c盘,易语言超级列表框导入TXT文本后修改保存和新增记录...
  • 超级列表框排序mysql_易语言超级列表框点击表头进行排序的代码
  • k易语言html导入超级列表框,易语言超级列表框通用数据导入导出
  • 超级列表框排序mysql,易语言超级列表框排序源码
  • 易语言超级列表框使用
  • 易语言超级列表框的增删改查

使用深度学习OpenCV python进行字符识别相关推荐

  1. 【毕业设计】基于生成对抗网络的照片上色动态算法设计与实现 - 深度学习 opencv python

    文章目录 1 前言 1 课题背景 2 GAN(生成对抗网络) 2.1 简介 2.2 基本原理 3 DeOldify 框架 4 First Order Motion Model 1 前言

  2. 【毕业设计】深度学习 opencv python 实现中国交通标志识别

    文章目录 0 前言 1 yolov5实现中国交通标志检测 2.算法原理 2.1 算法简介 2.2网络架构 2.3 关键代码 3 数据集处理 3.1 VOC格式介绍 3.2 将中国交通标志检测数据集CC ...

  3. opencv 计数后不动了 训练模型时_用OpenCV,深度学习和Python进行年龄识别

    (给Python编程开发加星标,提升编程技能.) 在本教程中,您将学习如何使用OpenCV,深度学习和Python执行年龄的自动识别/预测. 学完本教程后,您将能够以相当高的精确度去自动预测静态图像文 ...

  4. 深度学习 + OpenCV,Python实现实时视频目标检测

    选自PyimageSearch 机器之心编译 参与:路雪.李泽南 使用 OpenCV 和 Python 对实时视频流进行深度学习目标检测是非常简单的,我们只需要组合一些合适的代码,接入实时视频,随后加 ...

  5. 零基础实践深度学习之Python基础

    零基础实践深度学习之Python基础 Python数据结构 数字 字符串 列表 元组 字典 Python面向对象 Python JSON Python异常处理 Python文件操作 常见Linux命令 ...

  6. 图像处理神经网络python_深度学习使用Python进行卷积神经网络的图像分类教程

    深度学习使用Python进行卷积神经网络的图像分类教程 好的,这次我将使用python编写如何使用卷积神经网络(CNN)进行图像分类.我希望你事先已经阅读并理解了卷积神经网络(CNN)的基本概念,这里 ...

  7. 深度学习常用python库学习笔记

    深度学习常用python库学习笔记 常用的4个库 一.Numpy库 1.数组的创建 (1)np.array() (2)np.zeros() (3)np.ones() (4)np.empty() (5) ...

  8. 深度学习入门之Python小白逆袭大神系列(三)—深度学习常用Python库

    深度学习常用Python库介绍 目录 深度学习常用Python库介绍 简介 Numpy库 padas库 PIL库 Matplotlib库 简介 Python被大量应用在数据挖掘和深度学习领域,其中使用 ...

  9. 学习Opencv+Python之银行卡卡号识别

    学习Opencv+Python之银行卡卡号识别 思路: 获取模板轮廓 获取模板中每个数字的轮廓 获取银行卡卡号轮廓 分别提取卡号中的每个数字的轮廓 对比识别 代码: # 导入工具包 from imut ...

最新文章

  1. linux怎么和宿主机同步时间,Linux 中设置和同步时间
  2. 【框架篇】mvc、mvp、mvvm使用关系总结
  3. NuGet的使用、部署、搭建私有服务
  4. appium和airtest_关于Airtest自动化测试工具
  5. 遍历文件夹并移动其中所有的文件
  6. 疑似锤子新机谍照曝光,后置“拐角”四摄,前CEO犀利点评...
  7. zabbix通过自动发现功能实现自动识别网络设备接口
  8. 非递归归并排序详细分析
  9. python chardet库的函数用法
  10. 数据结构学习之矩阵乘法与矩阵的转置
  11. Electron代码内部签名流程
  12. Java开发设计——七大原则
  13. Cisco网站模块 14 - 15:网络应用通信考试试题及答案
  14. 管理科学与运筹学(MS/OR)国际期刊最新权威排名
  15. linux操作的进程调度没有采用,Linux进程调度分析
  16. IntelliJ IDEA设置自动导入包
  17. UNILUX频闪仪维修LITH-O-LIGHT-5频闪灯LOL-5/LOL-10
  18. understand学习
  19. 程序员生存定律-六个程序员的故事(2)
  20. 华为机试:连续出牌数量

热门文章

  1. 集成算法--AdaBoost算法【含python代码】
  2. 工具推荐|不用任何软件,如何成为P图大师?
  3. SSCOM串口调试助手自定义波特率
  4. tplink改无线打印服务器,tplinkwifiwdr7500怎么设置usb打印服务器 | tplogin.cn
  5. matlab求动物繁殖问题,动物繁殖问题数学建模实验matlab程序.doc
  6. java castor_Castor以及Java和XML数据绑定
  7. Conflux 研究院 | 《Conflux 协议规范》(黄皮书)导读
  8. 退化分布的特征函数及期望与方差 - 随机过程
  9. 耗时一个星期整理的APP自动化测试工具大全
  10. 全面解读Logit模型