识别最大色块例程中max_blob.cx(),max_blob.cy(),这两个是什么。
-
img = sensor.snapshot() # Take a picture and return the image. blobs = img.find_blobs([yellow_threshold]) if blobs: max_blob=find_max(blobs) print('sum :', len(blobs)) img.draw_rectangle(max_blob.rect()) img.draw_cross(max_blob.cx(), max_blob.cy()) output_str="[%d,%d]" % (max_blob.cx(),max_blob.cy()) #方式1 #output_str=json.dumps([max_blob.cx(),max_blob.cy()]) #方式2 print('you send:',output_str) uart.write(output_str+'\r\n') else: print('not found!')
-
最大色块的中心坐标
-