条件:实现绿色矩形框从界面最左端移动到最右端,循环不间断移动,基础代码不能大改
import cv2
import numpy as np
img=np.zeros([580,500,3],np.uint8)
cv2.rectangle(img,(200,200),(350,300),(255,0,0),2)
cv2.rectangle(img,(150,150),(200,200),(0,255,0),2)
cv2.imshow('img',img)
cv2.waitKey(0)
cv2.destroyAllWindows()