Skip to content

Commit 1cafef2

Browse files
authored
Smoothly render blue square moving
1 parent 67bdf58 commit 1cafef2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def main_projector(x, y):
2+
import cv2
3+
import numpy as np
4+
#creating a black square
5+
image=np.zeros((500,1000,4),np.uint8)
6+
cv2.rectangle(image,(x,y),(x + 20, y + 20),(255,127,0),-1)
7+
#cv2.rectangle(image,(250,150),(500,300),(255,127,0),-1)
8+
cv2.imshow("rectangle",image)
9+
cv2.waitKey(1000)
10+
cv2.destroyWindow("rectangle")
11+
12+
for i in range(10):
13+
main_projector(i, 0)

0 commit comments

Comments
 (0)