设置首页收藏本站
开启左侧

使用Padddle v2.3识别下车牌

[复制链接]
Criss 发表于 2021-9-19 19:50:10 | 显示全部楼层 |阅读模式
车牌图像在这里:
https://www.51halcon.com/forum.php?mod=viewthread&tid=716&fromuid=3

  1. from paddleocr import PaddleOCR, draw_ocr

  2. # Paddleocr目前支持的多语言语种可以通过修改lang参数进行切换
  3. # 例如`ch`, `en`, `fr`, `german`, `korean`, `japan`
  4. ocr = PaddleOCR(use_angle_cls=True, lang="ch")  # need to run only once to download and load model into memory
  5. img_path = 'C:/Users/Criss/Desktop/22.jpg'
  6. result = ocr.ocr(img_path, cls=True)
  7. for line in result:
  8.     print(line)

  9. # 显示结果
  10. from PIL import Image

  11. image = Image.open(img_path).convert('RGB')
  12. boxes = [line[0] for line in result]
  13. txts = [line[1][0] for line in result]
  14. scores = [line[1][1] for line in result]
  15. im_show = draw_ocr(image, boxes, txts, scores, font_path='./fonts/simfang.ttf')
  16. im_show = Image.fromarray(im_show)
  17. im_show.save('result.jpg')
复制代码


导入代码到pycharm中,然后运行即可。

识别效果:
  1. [2021/09/19 19:47:30] root DEBUG: dt_boxes num : 4, elapse : 0.16655516624450684
  2. [2021/09/19 19:47:30] root DEBUG: cls num  : 4, elapse : 0.04388308525085449
  3. [2021/09/19 19:47:31] root DEBUG: rec_res num  : 4, elapse : 0.28022098541259766
  4. [[[34.0, 137.0], [457.0, 134.0], [458.0, 229.0], [35.0, 233.0]], ('赣B·1D569', 0.9075086)]
  5. [[[396.0, 345.0], [495.0, 345.0], [495.0, 365.0], [396.0, 365.0]], ('51halcon.com', 0.97081804)]
复制代码


微信截图_20210919194937.png

不得不说,真6啊!

paddleocr中文使用说明:
https://github.com/PaddlePaddle/ ... oc_ch/quickstart.md
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
xuyongze 发表于 2021-9-20 18:22:05 | 显示全部楼层
paddleocr收费 吗、
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
 楼主| Criss 发表于 2021-9-21 07:54:58 | 显示全部楼层
xuyongze 发表于 2021-9-20 18:22
paddleocr收费 吗、

百度开源的OCR深度识别框架
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表