.........................
G
gtq4
@gtq4
1
声望
22
楼层
1032
资料浏览
0
粉丝
0
关注
gtq4 发布的帖子
-
向串口发送列表
import sensor, image, time
from pyb import UART
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock()
uart=UART(3,9600)# Create a clock object to track the FPS.
uart.init(9600,bits=8,parity=None,stop=1)
list=[1,1,2]
while(True):clock.tick() uart.write(list)
我现在这样写他会出现 需要具有缓冲协议的对象,该怎么改。
-
openmv颜色例程问题
# 多颜色组合识别 。 import sensor, image, time sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() while(True): clock.tick() img = sensor.snapshot() for blob in img.find_blobs(thresholds, pixels_threshold=100, area_threshold=100, merge=True): if blob.code() == 3: # r/g code img.draw_rectangle(blob.rect()) img.draw_cross(blob.cx(), blob.cy()) img.draw_string(blob.x() + 2, blob.y() + 2, "r/g") if blob.code() == 5: # r/b code img.draw_rectangle(blob.rect()) img.draw_cross(blob.cx(), blob.cy()) img.draw_string(blob.x() + 2, blob.y() + 2, "r/b") if blob.code() == 6: # g/b code img.draw_rectangle(blob.rect()) img.draw_cross(blob.cx(), blob.cy()) img.draw_string(blob.x() + 2, blob.y() + 2, "g/b") if blob.code() == 7: # r/g/b code img.draw_rectangle(blob.rect()) img.draw_cross(blob.cx(), blob.cy()) img.draw_string(blob.x() + 2, blob.y() + 2, "r/g/b") print(clock.fps())
blob.code=? 这个数字是因为红色色块是1,绿色是2,蓝色是4吗,怎么得来的。如果我只想判断是否是红色色块是不是就是 blob.code=1,绿色就是 blob.code=2
-
三个代号1,2,3的色块,并排放在一起,摄像头从左到右一次检测,代码逻辑怎么写知道三个色块放置的顺序。
求程序的逻辑和思路,如色块顺序是321,识别后将321打包发送给串口
-
RE: openmv颜色识别能识别离摄像头最近的色块吗,如果能用到那些代码。
那我通过摄像头识别三个大小一样的色块,知道他们的位置后,将他们所处的位置发给单片机也不能实现吗