天天看點

Robo_Eyes_license_recognize SystemRobo_Eyes_license_recognize System

Robo_Eyes_license_recognize System

一個基于ROS平台的車庫管理系統

項目實作基于flask輕量級Python的Web架構,利用OpenCV進行攝像頭圖檔截取以及儲存。

通過HyperLPR實作車牌識别、數字文字分割以及識别

功能實作

  • 1 flask輕量級架構+OpenCV實作螢幕錄制截圖(像素存在一點小問題~)
    Robo_Eyes_license_recognize SystemRobo_Eyes_license_recognize System
  • 2 HyperLPR 通過訓練好的級聯分類器進行車牌是識别以及數字識别
import HyperLPR_.HyperLPRLite as pr
import cv2
import numpy as np
import csv
print ('read')
grr = cv2.imread("img/org_img.jpg")
print ('succeed read')
model = pr.LPR("HyperLPR/model/cascade.xml","HyperLPR/model/model12.h5","HyperLPR/model/ocr_plate_all_gru.h5")
for pstr,confidence,rect in model.SimpleRecognizePlateByE2E(grr):
    print confidence
    if confidence>:
        image = drawRectBox(grr, rect, pstr+" "+str(round(confidence,)))
        cv2.imwrite("./img/upload_org_img.jpg", image)
        print "plate_str:"
        print pstr
        print "plate_confidence"
        print confidence
           
Robo_Eyes_license_recognize SystemRobo_Eyes_license_recognize System
  • 3 利用 pymql 連接配接資料庫
def get_db_conn():
    global g_db_connection
    if g_db_connection is None or not checkConn(g_db_connection):
        g_db_connection = pymysql.connect(host=config.DATABASE['host'], port=config.DATABASE['port'], user=config.DATABASE['user'], password=config.DATABASE['password'], db=config.DATABASE['db'], cursorclass=pymysql.cursors.DictCursor, charset='utf8')
    return g_db_connection

get_db_conn()
           

其中config.py為資料庫資訊,下載下傳後可以根據本地mysql進行修改

DATABASE = {
    'host': '127.0.0.1',
    'port': ,
    'user': 'root',
    'password': '',
    'db': '',
}
           

模拟進入

Robo_Eyes_license_recognize SystemRobo_Eyes_license_recognize System

模拟離開

Robo_Eyes_license_recognize SystemRobo_Eyes_license_recognize System

GitHub 連結