Python车牌检测识别代码感觉还可以


python车牌检测识别代码,个人感觉还是不错,识别率比较高!
资源截图
代码片段和文件信息
import numpy as np
import cv2
from hyperlpr_py3 import pipline

# 定义旋转rotate函数
def rotate(image angle center=None scale=1.0):
    # 获取图像尺寸
    (h w) = image.shape[:2]
 
    # 若未指定旋转中心,则将图像中心设为旋转中心
    if center is None:
        center = (w / 2 h / 2)
 
    # 执行旋转
    M = cv2.getRotationMatrix2D(center angle scale)
    image_rotated = cv2.warpAffine(image M (w h))
 
    # 返回旋转后的图像
    return image_rotated

capture = cv2.VideoCapture(0)

while(True):
    # 获取一帧
    ret frame = capture.read()
    frame_rotated = rotate(frame 180)
    # 调用车牌识别模块
    frame_ res  = pipline.SimpleRecognizePlate(frame_rotated)
    
    #htitch = np.hstack((frame_rotated frame_))
    #cv2.imshow(‘License Plate Detection Recognition‘ htitch)
    cv2.imshow(‘License Plate Detection Recognition‘ frame_)
    if cv2.waitKey(1) == ord(‘q‘):
        break

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)