Update wxpy_uploader.py
This commit is contained in:
+2
-19
@@ -9,37 +9,20 @@ from hyperlpr import pipline
|
|||||||
|
|
||||||
def recognize(filename):
|
def recognize(filename):
|
||||||
image = cv2.imread(filename)
|
image = cv2.imread(filename)
|
||||||
#通过文件名读入一张图片 放到 image中
|
|
||||||
return pipline.RecognizePlateJson(image)
|
return pipline.RecognizePlateJson(image)
|
||||||
#识别一张图片并返回json结果
|
|
||||||
|
|
||||||
# 人脸检测的功能,这里用到了OpenCV里面的人脸检测代码
|
|
||||||
# 由于接收和处理图片都需要一点点时间 这里偷懒直接用sleep
|
|
||||||
# 建议更改成多进程模式,否则容易造成进程混乱
|
|
||||||
|
|
||||||
bot = Bot(console_qr=True, cache_path=True)
|
bot = Bot(console_qr=True, cache_path=True)
|
||||||
|
|
||||||
# friend = bot.friends().search(u'庾金科')[0]
|
|
||||||
# friend.send(u'你好,车牌识别功能已开启测试')
|
|
||||||
|
|
||||||
@bot.register(Friend,PICTURE)
|
@bot.register(Friend,PICTURE)
|
||||||
def face_msg(msg):
|
def pr_msg(msg):
|
||||||
image_name = msg.file_name
|
image_name = msg.file_name
|
||||||
friend = msg.chat
|
friend = msg.chat
|
||||||
print msg.chat
|
print msg.chat
|
||||||
print '接收图片'
|
print '接收图片'
|
||||||
# face(image_name)
|
# face(image_name)
|
||||||
msg.get_file('' + msg.file_name)
|
msg.get_file('' + msg.file_name)
|
||||||
# time.sleep(1)
|
|
||||||
json_text = recognize(image_name)
|
json_text = recognize(image_name)
|
||||||
# face(image_name)
|
|
||||||
# time.sleep(0.5)
|
|
||||||
msg.reply(json_text)
|
msg.reply(json_text)
|
||||||
msg.reply_image("0.jpg")
|
msg.reply_image("0.jpg")
|
||||||
|
|
||||||
|
|
||||||
# msg.reply(json_text)
|
|
||||||
|
|
||||||
|
|
||||||
os.remove(image_name)
|
os.remove(image_name)
|
||||||
embed()
|
embed()
|
||||||
|
|||||||
Reference in New Issue
Block a user