green_threshold = (76, 96, -110, -30, 8, 66)
size_threshold = 2000
x_pid = PID(p=0.5, i=1, imax=100)
h_pid = PID(p=0.05, i=0.1, imax=50)
这个追小球的小车的这个size_threshold = 2000值怎么确定,一点一点调吗,如果小车撞上小球呢?
4
4p3d 发布的帖子
-
怎么调节size_threshold = 2000值?
-
openmv怎么提高测距的距离和精度,怎么优化?
:weary_face: :weary_face: :weary_face: :weary_face: :weary_face: :weary_face: :weary_face: :weary_face: :weary_face: 请在这里粘贴代码
-
部分代码,为什么电脑接收不到圆的坐标?
uart = UART(3, 115200) for c in img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2): img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) print(c) print("FPS %f" % clock.fps()) uart.init(115200, bits=8, parity=None, stop=1) # init with given parameters def send_data_packet(x,y,z,w): #frame=[0x2C,18,cx%0xff,int(cx/0xff),cy%0xff,int(cy/0xff),0x5B]; #data = bytearray(frame) data = ustruct.pack("<bbhhhhb", #格式为俩个字符俩个短整型(2字节) 0x2C, #帧头1 0x12, #帧头2 int(cx), # up sample by 4 #数据1 int(cy), # up sample by 4 #数据2 int(cw), # up sample by 4 #数据1 int(ch), # up sample by 4 #数据2 0x5B) uart.write(data);data_out = json.dumps(set(data)) while(True): clock.tick() date=bytearray[(1,2,3,4,5)] uart.write(data) img = sensor.snapshot() c = img.find_circles() cx=0;cy=0; if c: c = find_circles(c) cx=c.x() cy=c.y() cw=c.r() ch=c.magnitude() img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) FH = bytearray([0x2C,0x12,cx,cy,cw,ch,0x5B]) #sending_data(cx,cy,cw,ch) uart.write(FH) print(cx,cy,cw,ch)
请在这里粘贴代码
-
RE: 串口发送坐标,要用到那些函数?
就想发送他的中心坐标怎么写
:face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: :face_with_stuck-out_tongue: 请在这里粘贴代码