Bootstrap

python车牌识别ui界面识别黄牌蓝牌绿牌

python车牌识别ui界面识别黄牌蓝牌绿牌

1、整体思路
首先附上本次识别的图片:(图片是我在百度上找的)

基于OpenCV车牌号识别总体分为四个步骤:
(1)提取车牌位置,将车牌从图中分割出来;
(2)车牌字符的分割;
(3)通过模版匹配识别字符;
(4)将结果绘制在图片上显示出来。
与深度学习相比,传统图像处理的识别有好处又有坏处:
好处:不需要大量的数据集训练模型,通过形态学、边缘检测等操作提取特征
坏处:基于传统图像处理的图像识别代码的泛化性较低,当图像的角度,光照不同时,识别效果有时会不尽人意。
 

# coding=gbk

import cv2
import numpy as np

img = cv2.imread('1.jpg')
cv2.imshow('card',img)
img = cv2.imread('1.jpg',0)
cv2.imshow('gary',img)
height,width = img.shape
thres,binary = cv2.threshold(img,0,255,cv2.THRESH_OTSU + cv2.THRESH_BINARY_INV)
cv2.imshow('threshold',binary)
# print(img.shape)
paint = np.zeros(img.shape,dtype=np.uint8)
# 每一列黑色像素个数
pointSum = np.zeros(width,dtype=np.uint8)
for x in range(width):
    for y in range(height):
        if binary[y][x]:
            pointSum[x] = pointSum[x] + 1


for x in range(width):
    for y in range(height)[::-1]:
        if (pointSum[x]):
            paint[y][x] = 255
            pointSum[x] = pointSum[x] - 1



cv2.imshow('paint',paint)
cv2.waitKey(0)

python车牌识别系统有界面可识别黄蓝牌

项目下载: 

https://download.csdn.net/download/xifenglie123321/85283755https://download.csdn.net/download/xifenglie123321/85283755

;