@@ -16,27 +16,27 @@ HyperLPR是一个基于Python的使用深度学习针对对中文车牌识别的
|
|||||||
|
|
||||||
### 依赖
|
### 依赖
|
||||||
|
|
||||||
+ Keras + Theano backend (Tensorflow data order) 请使用theano作为backend , tensorflow backend虽然权重可以载入但是识别结果是乱的
|
+ Keras (>2.0.0)
|
||||||
+ Theano
|
+ Theano(>0.9) or Tensorflow(>1.1.x)
|
||||||
+ Numpy
|
+ Numpy (>1.10)
|
||||||
+ Scipy
|
+ Scipy (0.19.1)
|
||||||
+ OpenCV
|
+ OpenCV(>3.0)
|
||||||
+ scikit-image
|
+ scikit-image (0.13.0)
|
||||||
|
|
||||||
### 设计流程
|
### 设计流程
|
||||||
|
|
||||||
> step1. 使用opencv 的 HAAR Cascade 检测车牌大致位置
|
> step1. 使用opencv 的 HAAR Cascade 检测车牌大致位置
|
||||||
|
>
|
||||||
> step2. Extend 检测到的大致位置的矩形区域
|
> step2. Extend 检测到的大致位置的矩形区域
|
||||||
|
>
|
||||||
> step3. 使用类似于MSER的方式的 多级二值化 + RANSAC 拟合车牌的上下边界
|
> step3. 使用类似于MSER的方式的 多级二值化 + RANSAC 拟合车牌的上下边界
|
||||||
|
>
|
||||||
> step4. 使用CNN Regression回归车牌左右边界
|
> step4. 使用CNN Regression回归车牌左右边界
|
||||||
|
>
|
||||||
> step5. 使用基于纹理场的算法进行车牌校正倾斜
|
> step5. 使用基于纹理场的算法进行车牌校正倾斜
|
||||||
|
>
|
||||||
> step6. 使用CNN滑动窗切割字符
|
> step6. 使用CNN滑动窗切割字符
|
||||||
|
>
|
||||||
> step7. 使用CNN识别字符
|
> step7. 使用CNN识别字符
|
||||||
|
|
||||||
### 简单使用方式
|
### 简单使用方式
|
||||||
@@ -47,11 +47,28 @@ import cv2
|
|||||||
image = cv2.imread("filename")
|
image = cv2.imread("filename")
|
||||||
image,res = pp.SimpleRecognizePlate(image)
|
image,res = pp.SimpleRecognizePlate(image)
|
||||||
```
|
```
|
||||||
|
### 可识别和待支持的车牌的类型
|
||||||
|
|
||||||
|
- [x] 标准单行蓝牌
|
||||||
|
- [x] 标准单行黄牌
|
||||||
|
- [ ] 新能源车牌
|
||||||
|
- [ ] 双层黄牌
|
||||||
|
- [ ] 警用车牌
|
||||||
|
- [ ] 武警车牌
|
||||||
|
- [ ] 使馆车牌
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 测试样例
|
### 测试样例
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
### 数据分享
|
||||||
|
|
||||||
|
车牌识别框架开发时使用的数据并不是很多,有意着可以为我们提供相关车牌数据。联系邮箱 455501914@qq.com。
|
||||||
|
|
||||||
### 获取帮助
|
### 获取帮助
|
||||||
|
|
||||||
+ HyperLPR讨论QQ群:673071218, 加前请备注HyperLPR交流。
|
+ HyperLPR讨论QQ群:673071218, 加前请备注HyperLPR交流。
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ def comparestring(a,b):
|
|||||||
g+=1
|
g+=1
|
||||||
return g
|
return g
|
||||||
|
|
||||||
|
#
|
||||||
|
# A = "赣FJ0368".decode("utf-8")
|
||||||
|
# B = "琼WJ0368".decode("utf-8")
|
||||||
|
|
||||||
|
# print "对比",comparestring(A,B)
|
||||||
|
|
||||||
count = 0 ;
|
count = 0 ;
|
||||||
|
|
||||||
@@ -62,21 +67,23 @@ for filename in os.listdir(parent):
|
|||||||
for one in dataset:
|
for one in dataset:
|
||||||
|
|
||||||
# p = sm.StringMatcher(seq1=one.encode("utf-8"),seq2=name.encode("utf-8"))
|
# p = sm.StringMatcher(seq1=one.encode("utf-8"),seq2=name.encode("utf-8"))
|
||||||
A = one.encode("utf-8")
|
A = one.decode("utf-8")
|
||||||
B = name.encode("utf-8")
|
B = name.decode("utf-8")
|
||||||
print one.encode("utf-8"),"<->",name.encode("utf-8"),"编辑距离:",comparestring(A,B)
|
print one.decode("utf-8"),"<->",name.decode("utf-8"),"编辑距离:",comparestring(A,B)
|
||||||
if comparestring(A,B)<2:
|
if comparestring(A,B)<3:
|
||||||
count_lev+=1
|
count_lev+=1
|
||||||
if one.encode("utf-8") == name.encode("utf-8"):
|
else:
|
||||||
|
cv2.imwrite("./cache/bad2/"+B+"->"+A+".png",image)
|
||||||
|
|
||||||
|
if one.decode("utf-8") == name.decode("utf-8"):
|
||||||
count_p+=1
|
count_p+=1
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print "error",one.encode("utf-8"), name.encode("utf-8")
|
print "error",one.decode("utf-8"), name.decode("utf-8")
|
||||||
count_d+=1
|
count_d+=1
|
||||||
# cv2.imshow("image",image)
|
# cv2.imshow("image",image)
|
||||||
# cv2.waitKey(0)
|
# cv2.waitKey(0)
|
||||||
cv2.imwrite("./cache/bad2/"+name+".png",image)
|
# break
|
||||||
break
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,7 +94,7 @@ for filename in os.listdir(parent):
|
|||||||
|
|
||||||
if count_p+count_d+count_undetected!=count:
|
if count_p+count_d+count_undetected!=count:
|
||||||
print dataset,len(dataset)
|
print dataset,len(dataset)
|
||||||
exit(0)
|
# exit(0)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 365 KiB |
|
Before Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 355 KiB |
|
Before Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 244 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 309 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 279 KiB |
|
Before Width: | Height: | Size: 345 KiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 318 KiB |
|
Before Width: | Height: | Size: 333 KiB |
|
Before Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 365 KiB |
|
Before Width: | Height: | Size: 326 KiB |
|
Before Width: | Height: | Size: 358 KiB |
|
Before Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 343 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 288 KiB |
|
Before Width: | Height: | Size: 328 KiB |
|
Before Width: | Height: | Size: 315 KiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 356 KiB |
|
Before Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 293 KiB |
|
Before Width: | Height: | Size: 293 KiB |
|
Before Width: | Height: | Size: 391 KiB |
|
Before Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 344 KiB |
|
Before Width: | Height: | Size: 355 KiB |
|
Before Width: | Height: | Size: 365 KiB |
|
Before Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 346 KiB |
|
Before Width: | Height: | Size: 366 KiB |
|
Before Width: | Height: | Size: 308 KiB |
|
Before Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 272 KiB |
|
Before Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 333 KiB |
|
Before Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 350 KiB |
|
Before Width: | Height: | Size: 310 KiB |
|
Before Width: | Height: | Size: 359 KiB |
|
Before Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 301 KiB |
|
Before Width: | Height: | Size: 344 KiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 307 KiB |
|
Before Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 311 KiB |
|
Before Width: | Height: | Size: 327 KiB |
|
Before Width: | Height: | Size: 247 KiB |
|
Before Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 368 KiB |
|
Before Width: | Height: | Size: 314 KiB |
|
Before Width: | Height: | Size: 281 KiB |
|
Before Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 381 KiB |
|
Before Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 337 KiB |
|
Before Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 347 KiB |
|
Before Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 302 KiB |
|
Before Width: | Height: | Size: 348 KiB |
|
Before Width: | Height: | Size: 318 KiB |
|
Before Width: | Height: | Size: 413 KiB |
|
Before Width: | Height: | Size: 332 KiB |
|
Before Width: | Height: | Size: 351 KiB |
|
Before Width: | Height: | Size: 293 KiB |
|
Before Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 369 KiB |
|
Before Width: | Height: | Size: 313 KiB |
|
Before Width: | Height: | Size: 383 KiB |
|
Before Width: | Height: | Size: 269 KiB |
|
Before Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 297 KiB |
|
Before Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 317 KiB |
|
Before Width: | Height: | Size: 273 KiB |
|
Before Width: | Height: | Size: 287 KiB |
|
Before Width: | Height: | Size: 365 KiB |
|
Before Width: | Height: | Size: 238 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 336 KiB |
|
Before Width: | Height: | Size: 294 KiB |
|
Before Width: | Height: | Size: 286 KiB |