学习OpenMV4.0

该博客讲述了作者在OpenMV4.0上进行的改进,从原本的摄像头识别色块并控制LED灯,升级为使用舵机,通过识别不同色块驱动不同舵机执行特定动作。此外,详细介绍了如何利用book.openmv.cc上的资源实现人脸识别功能。
摘要由CSDN通过智能技术生成

对上次通过学习让摄像头寻找色块,并亮对应的LED灯,这次进行了改进,采取舵机,通过不同色块让不同的舵机进行工作,从而进行一些动作

# Single Color RGB565 Blob Tracking Example
#
# This example shows off single color RGB565 tracking using the OpenMV Cam.

import sensor, image, time, math
from pyb import LED

red=LED(1)
green=LED(2)
#blue=LED(3)

s1=Servo(1)#p7
s2=Servo(2)#p8
threshold_index = 0 # 0 for red, 1 for green, 2 for blue

# Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
# The below thresholds track in general red/green/blue things. You may wish to tune them...
thresholds = [(30, 100, 15, 127, 15, 127), # generic_red_thresholds
              (30, 100, -64, -8, -32, 32), # generic_green_thresholds
              (0, 30, 0, 64, -128, 0)] # generic_blue_thresholds

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值