问一下 color_l=statistics.l_mode(),这个color_l变量为什么不可以用串口输出
-
import sensor, image, time,json
from pyb import UARTsensor.reset() # 初始化摄像头
sensor.set_pixformat(sensor.RGB565) # 格式为 RGB565.
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(10) # 跳过10帧,使新设置生效
sensor.set_auto_whitebal(False) # Create a clock object to track the FPS.ROI=(80,0,160,230)
uart = UART(3, 115200)
while(True):
img = sensor.snapshot() # Take a picture and return the image.
statistics=img.get_statistics(roi=ROI)
color_l=statistics.l_mode()
color_a=statistics.a_mode()
color_b=statistics.b_mode()
print(color_l,color_a,color_b)
img.draw_rectangle(ROI)
uart.write(color_l)
time.sleep(100)
-
程序如上,color_l变量可以通过 print打印显示出来,但是串口就不行,一运行就报错
-
来自星瞳实验室APP: Apriltag中如何用串口输出tag.id()
https://forum.singtown.com/topic/327
-
受益匪浅,非常感谢