python识别车牌
2022-01-17:
python:3.9\opencv:4.5.1\hyperlpr:1.21.3
安装环境:
pip3 install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple pip3 install hyperlpr -i https://pypi.tuna.tsinghua.edu.cn/simple
需要修改hyperlpr
cd /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/hyperlpr
vi hyperlpr.py
输入“/cv2.estimateRigidTransform(org_pts, target_pts, True)”,搜索次行代码,修改为
#mat_ = cv2.estimateRigidTransform(org_pts, target_pts, True)
mat_, _ = cv2.estimateAffinePartial2D(org_pts, target_pts, True)
注意缩进和源代码保持一致,看看是用的tab还是空格表示缩进
测试代码:
from hyperlpr import * import cv2
#自己修改自己的图片路径 image = cv2.imread("car.jpeg") print(HyperLPR_plate_recognition(image))
截图:


浙公网安备 33010602011771号