找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1621|回复: 1
打印 上一主题 下一主题
收起左侧

多功能智能语音家居衣柜

[复制链接]
跳转到指定楼层
楼主
之前参加ican比赛,做了一个智能语音衣柜的项目,获得了国家二等奖,电控部分完全是一个人完成的,外型是用3D打印的,用到了飞思卡尔的plc芯片,还有openmv,还有语音模块,视频里人丑忽略,大家多多执教,谢谢,最后附上程序。B站有视频:https://www.bilibili.com/video/BV1qQ4y1M739



Python源程序如下:
  1. from pid import PID
  2. from pyb import Servo
  3. import sensor, image, time,pyb
  4. from pyb import UART
  5. pan_pid = PID(p=0.075, i=0, imax=90)
  6. tilt_pid = PID(p=0.05, i=0, imax=90)
  7. s1 = Servo(1)
  8. tilt_servo=Servo(2)
  9. s3 = Servo(3)
  10. sensor.reset()
  11. led1 = pyb.LED(1)
  12. led2 = pyb.LED(2)
  13. led3 = pyb.LED(3)
  14. sensor.set_contrast(3)
  15. sensor.set_gainceiling(16)
  16. sensor.set_framesize(sensor.QVGA)
  17. sensor.set_windowing((320, 240))
  18. sensor.set_pixformat(sensor.GRAYSCALE)
  19. sensor.skip_frames(time = 2000)
  20. sensor.set_auto_gain(False, value=100)
  21. led1.on()
  22. led2.on()
  23. led3.on()
  24. def draw_keypoints(img, kpts):
  25.         if kpts:
  26.                 print(kpts)
  27.                 img.draw_keypoints(kpts)
  28.                 img = sensor.snapshot()
  29.                 time.sleep(1000)
  30. kpts1 = None
  31. K=5000
  32. clock = time.clock()
  33. i = 0
  34. while (True):
  35.         s3.angle(-60)
  36.         b = 1500 + i
  37.         s1.pulse_width(b)
  38.         i = i+40       
  39.         if(i>1000):
  40.                 i = 0
  41.         clock.tick()
  42.         img = sensor.snapshot()
  43.         if (kpts1 == None):
  44.                 kpts1 = img.find_keypoints(max_keypoints=150, threshold=7, scale_factor=1.2)
  45.                 draw_keypoints(img, kpts1)
  46.         else:
  47.                 kpts2 = img.find_keypoints(max_keypoints=150, threshold=7, normalized=True)
  48.                 if (kpts2):
  49.                         img = sensor.snapshot()
  50.                         match = image.match_descriptor(kpts1, kpts2, threshold=85)
  51.                         if (match.count()>10):
  52.                          while(1):
  53.                                 kpts2 = img.find_keypoints(max_keypoints=150, threshold=7, normalized=True)
  54.                                 img = sensor.snapshot()
  55.                                 img.draw_rectangle(match.rect())
  56.                                 img.draw_cross(match.cx(), match.cy(), size=10)
  57.                                 s1.pulse_width(b)
  58.                                 time.sleep(2000)
  59.                                 s3.angle(-20)
  60.                                 time.sleep(2000)
  61.                                 s1.angle(-180)
  62.                                 time.sleep(2000)
  63.                                 s3.angle(-60)
  64.                                 time.sleep(200000)
复制代码

以上资料51hei提供下载(注意资料不全  仅供参考):
比赛程序.zip (292.2 KB, 下载次数: 9)


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:1 发表于 2020-4-1 21:36 | 只看该作者
本帖需要重新编辑补全电路原理图,源码,详细说明与图片即可获得100+黑币(帖子下方有编辑按钮)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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