这个帧率那就是极限了么?按理来说禁用摄像头应该是有所提升的,是不是我哪里的配置不对啊.
禹有饭
@3lmp
0
声望
2
楼层
444
资料浏览
0
粉丝
0
关注
3lmp 发布的帖子
-
禁用摄像头后,帧率不变。
禁用和开启摄像头,系统的输出的帧率没有改变,讲道理禁用摄像头后,帧率应该有提升才对啊。
禁用和不禁用都是24帧未禁用时
禁用时
请在这里粘贴代码 ```import sensor, image, time, math,lcd,struct from pyb import UART from pyb import LED import json def send_data_packet(x, y): temp = struct.pack(">bBBb", #格式为俩个字符俩个整型 0xAA, #帧头1 int(x), # up sample by 4 #数据1 int(y), # up sample by 4 #数据2 0xAE) #帧头2 uart.write(temp) # Color Tracking Thresholds (Grayscale Min, Grayscale Max) # The below grayscale threshold is set to only find extremely bright white areas. xiaoqiu = (130, 255) zuobiao = (140, 180) left_roi =(65,52,459,432) a = 0 led1 = LED(1) #red led2 = LED(2) #green sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) 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 sensor.set_auto_exposure(False,4000) clock = time.clock() uart = UART(3,115200) #串口3,波特率115200 uart.init(115200,bits=8,parity=None,stop=1) # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are # returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the # camera resolution. "merge=True" merges all overlapping blobs in the image. while(True): clock.tick() led1.toggle() img = sensor.snapshot() if a==0: if img.find_blobs([xiaoqiu],roi=left_roi,pixels_threshold=60, area_threshold=60, merge=True)==[]: led1.on()#亮 led2.off()#灭 #send_data_packet(180,180) send_data_packet(clock.fps(),clock.fps()) print(clock.fps()) else: for blob in img.find_blobs([xiaoqiu],roi=left_roi,pixels_threshold=60, area_threshold=60, merge=True): # These values depend on the blob not being circular - otherwise they will be shaky. # These values are stable all the time. img.draw_rectangle(blob.rect(), color=200) img.draw_cross(blob.cx(), blob.cy(), color=0) send_data_packet(blob.cx(),blob.cy()) print(blob.cx(),blob.cy()) led2.on() led1.off() #output_str="[%d,%d]" % (blob.cx(),blob.cy()) #uart.write(output_str+'\r\n') print(clock.fps())