资源简介
基于端到端的深度学习的车牌、验证码、文档等字符识别,可以基于此进行样本生成和模型训练。
代码片段和文件信息
#coding=utf-8
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
import cv2;
import numpy as np;
import os;
from math import *
# font = ImageFont.truetype(“Arial-Bold.ttf“14)
index = {“京“: 0 “沪“: 1 “津“: 2 “渝“: 3 “冀“: 4 “晋“: 5 “蒙“: 6 “辽“: 7 “吉“: 8 “黑“: 9 “苏“: 10 “浙“: 11 “皖“: 12
“闽“: 13 “赣“: 14 “鲁“: 15 “豫“: 16 “鄂“: 17 “湘“: 18 “粤“: 19 “桂“: 20 “琼“: 21 “川“: 22 “贵“: 23 “云“: 24
“藏“: 25 “陕“: 26 “甘“: 27 “青“: 28 “宁“: 29 “新“: 30 “0“: 31 “1“: 32 “2“: 33 “3“: 34 “4“: 35 “5“: 36
“6“: 37 “7“: 38 “8“: 39 “9“: 40 “A“: 41 “B“: 42 “C“: 43 “D“: 44 “E“: 45 “F“: 46 “G“: 47 “H“: 48
“J“: 49 “K“: 50 “L“: 51 “M“: 52 “N“: 53 “P“: 54 “Q“: 55 “R“: 56 “S“: 57 “T“: 58 “U“: 59 “V“: 60
“W“: 61 “X“: 62 “Y“: 63 “Z“: 64};
chars = [“京“ “沪“ “津“ “渝“ “冀“ “晋“ “蒙“ “辽“ “吉“ “黑“ “苏“ “浙“ “皖“ “闽“ “赣“ “鲁“ “豫“ “鄂“ “湘“ “粤“ “桂“
“琼“ “川“ “贵“ “云“ “藏“ “陕“ “甘“ “青“ “宁“ “新“ “0“ “1“ “2“ “3“ “4“ “5“ “6“ “7“ “8“ “9“ “A“
“B“ “C“ “D“ “E“ “F“ “G“ “H“ “J“ “K“ “L“ “M“ “N“ “P“ “Q“ “R“ “S“ “T“ “U“ “V“ “W“ “X“
“Y“ “Z“
];
def AddSmudginess(img Smu):
rows = r(Smu.shape[0] - 50)
cols = r(Smu.shape[1] - 50)
adder = Smu[rows:rows + 50 cols:cols + 50];
adder = cv2.resize(adder (50 50));
# adder = cv2.bitwise_not(adder)
img = cv2.resize(img(5050))
img = cv2.bitwise_not(img)
img = cv2.bitwise_and(adder img)
img = cv2.bitwise_not(img)
return img
def rot(imgangelshapemax_angel):
“““ 使图像轻微的畸变
img 输入图像
factor 畸变的参数
size 为图片的目标尺寸
“““
size_o = [shape[1]shape[0]]
size = (shape[1]+ int(shape[0]*cos((float(max_angel )/180) * 3.14))shape[0])
interval = abs( int( sin((float(angel) /180) * 3.14)* shape[0]));
pts1 = np.float32([[00] [0size_o[1]][size_o[0]0][size_o[0]size_o[1]]])
if(angel>0):
pts2 = np.float32([[interval0][0size[1] ][size[0]0 ][size[0]-intervalsize_o[1]]])
else:
pts2 = np.float32([[00][intervalsize[1] ][size[0]-interval0 ][size[0]size_o[1]]])
M = cv2.getPerspectiveTransform(pts1pts2);
dst = cv2.warpPerspective(imgMsize);
return dst;
def rotRandrom(img factor size):
shape = size;
pts1 = np.float32([[0 0] [0 shape[0]] [shape[1] 0] [shape[1] shape[0]]])
pts2 = np.float32([[r(factor) r(factor)] [ r(factor) shape[0] - r(factor)] [shape[1] - r(factor) r(factor)]
[shape[1] - r(factor) shape[0] - r(factor)]])
M = cv2.getPerspectiveTransform(pts1 pts2);
dst = cv2.warpPerspective(img M size);
return dst;
def tfactor(img):
hsv = cv2.cvtColor(imgcv2.COLOR_BGR2HSV);
hsv[::0] = hsv[::0]*(0.8+ np.random.random()*0.2);
hsv[::1] = hsv[::1]*(0.3+ np.random.random()*0.7);
hsv[::2] = hsv[::2]*(0.2
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\
目录 0 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\
目录 0 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\dictionaries\
文件 86 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\dictionaries\yujinke.xm
文件 159 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\encodings.xm
文件 459 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\end-to-end-for-chinese-plate-recognition.iml
文件 1520 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\misc.xm
文件 332 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\modules.xm
文件 180 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\vcs.xm
文件 18212 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\.idea\workspace.xm
目录 0 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\
文件 3896 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A01_N84E28_1.jpg
文件 3598 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A01_N84E28_2.jpg
文件 2579 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A01_NMV802_1.jpg
文件 3377 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A01_NMV802_2.jpg
文件 2873 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A02_NBD719_1.jpg
文件 3067 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A02_NBD719_2.jpg
文件 2486 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A05F26_1.jpg
文件 3576 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A137U8_1.jpg
文件 3607 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A137U8_2.jpg
文件 3676 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A137U8_3.jpg
文件 2783 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_0.jpg
文件 2740 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_1.jpg
文件 3383 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_2.jpg
文件 3209 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_3.jpg
文件 2900 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_4.jpg
文件 3085 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_5.jpg
文件 2558 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_7.jpg
文件 2844 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A19Z80_8.jpg
文件 2508 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A1L828_0.jpg
文件 2811 2017-02-17 20:18 end-to-end-for-chinese-plate-recognition-master\NoPlates\A03_A1L828_1.jpg
............此处省略175个文件信息
相关资源
- Principles of computerized tomographic imaging全
- 电机学 王秀和 主编 第二版 扫描版
- tesseract-ocr-w64-setup-v5.0.0.20190623.zip
- 自然场景OCR(YOLOv3+CRNN)
- 基于stm32的字符识别卡在内存上了
- Tesseract-OCR 中文训练库
- VS2010调用Tesseract-OCR需要使用的全部工
- 基于模板匹配和谷歌开源TESSERACT库的
- MODI OCR安装包
- tesseract-ocr安装包和中文语言包.rar
- Visual Basic.NET程序设计教程第2版 龚沛
- tesseract中文识别库
- tesseract4.0+vs2015+win764位编译后的库
- tesseract-ocr-setup-3.05.00dev-20160831.exe
- tesseract_ocr在vs2010下调用的全部资料
- tesseract识别中文的com.sun.media.imageio.
- 可以直接使用的百度文字识别源代码
- adaptive filter theory 4th en
- tesseract-ocr-3.02.eng英文包
- tesseract3.02简体中文语言包
- tesseract-ocr-setup-3.02.02.exe 官方绿色版
- chi_sim.traineddata加OCR安装包
- 中文识别语言库tesseract.ocr
- 天若OCR文字识别 4.48 最新版
- 最新的Tesseract中文语言包 chi_sim.trai
- 基于OpenCV&Tesseract;-OCR实现银行卡号识
- 微软office OCR组件 即装即用
- 银行卡号识别Demowindows程序
- 数字信号处理M.H海因斯著-张建华等译
- 2020线性代数 李永乐OCR 高清 无水印
评论
共有 条评论