You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

wxpy_uploader.py 589 B

7 years ago
7 years ago
12345678910111213141516171819202122232425262728
  1. #coding=utf-8
  2. from wxpy import *
  3. import numpy
  4. import cv2
  5. import time
  6. import os
  7. from hyperlpr import pipline
  8. def recognize(filename):
  9. image = cv2.imread(filename)
  10. return pipline.RecognizePlateJson(image)
  11. bot = Bot(console_qr=True, cache_path=True)
  12. @bot.register(Friend,PICTURE)
  13. def pr_msg(msg):
  14. image_name = msg.file_name
  15. friend = msg.chat
  16. print msg.chat
  17. print '接收图片'
  18. # face(image_name)
  19. msg.get_file('' + msg.file_name)
  20. json_text = recognize(image_name)
  21. msg.reply(json_text)
  22. msg.reply_image("0.jpg")
  23. os.remove(image_name)
  24. embed()