if 90<statistics.l_mode()<110 and -35<statistics.a_mode()<16 and -28<statistics.b_mode()<20:#if the circle is white
img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))#识别到的白色圆形用红色的圆形框出来
print(circle.x(),circle.y())
else:
img.draw_rectangle(area, color = (255, 255, 255))#将非黑、白色的圆用白色的矩形框出来
wai = img.find_rects(threshold = 10000)
x_error = wai[0]+wai[2]/2-img.width()/2 #左右偏移量
y_error = wai[1]+wai[3]/2-img.height()/2 #上下偏移量
print(x_error,y_error)c.x(), c.y()
好的,谢谢啦。在提出这个问题的时候我又仔细思考了下,是自己想复杂啦