资源简介
根据源码改的openmv识别特定颜色跟踪并标记,颜色阈值可自行设置,默认打印识别到物体的中心点,可通过串口传输到单片机或其他设备
代码片段和文件信息
#@Luan/2019/7
#改编跟踪识别且发送
# Pin P4 to the serial input of a serial LCD screen to see data printed
# on the serial LCD display.
import sensor image time math
from pyb import UART
# Always pass UART 3 for the UART number for your OpenMV Cam.
# The second argument is the UART baud rate. For a more advanced UART control
# example see the BLE-Shield driver.
uart = UART(3 19200 timeout_char=1000) #串口3 波特率19200 超时时间1s
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
评论
共有 条评论