import numpy as np
import cv2

#define a canvas of size 300x300 px, with 3 channels (R,G,B) and data type as 8 bit unsigned integer
canvas = np.zeros((300,300,3), dtype ="uint8")

#define color
#draw a circle
#arguments are canvas/image, midpoint, radius, color, thickness(optional)
#display in cv2 window
green = (0,255,0)
cv2.circle(canvas,(100,100), 10, green)
cv2.imshow("Single circle", canvas)
cv2.waitKey(0)

# draw concentric white circles
# calculate the center point of canvas
# generate circles using for loop
# clearning the canvas
canvas = np.zeros((300,300,3), dtype ="uint8")
white = (255,255,255)
(centerX, centerY) = (canvas.shape[1]//2, canvas.shape[0]//2)

for r in range(0,175,25):
    cv2.circle(canvas, (centerX,centerY), r, white)

cv2.imshow("concentric circles", canvas)
cv2.waitKey(0)


# generate random radius, center point, color
# draw circles in for loop
canvas = np.zeros((300,300,3), dtype ="uint8")
for i in range(0, 25):
    radius = np.random.randint(5, high = 200)
    color = np.random.randint(0, high = 256, size = (3,)).tolist()
    pt = np.random.randint(0, high = 300, size = (2,))
    cv2.circle(canvas, tuple(pt), radius, color, -1)
cv2.imshow("Canvas", canvas)
cv2.waitKey(0)
[((5, 9, 5, 46), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((12, 0, 12, 39), 'cv2.circle', 'cv2.circle', ({(12, 11, 12, 17): 'canvas', (12, 18, 12, 27): '(100, 100)', (12, 29, 12, 31): '(10)', (12, 33, 12, 38): 'green'}, {}), '(canvas, (100, 100), 10, green)', False, 'import cv2\n'), ((13, 0, 13, 35), 'cv2.imshow', 'cv2.imshow', ({(13, 11, 13, 26): '"""Single circle"""', (13, 28, 13, 34): 'canvas'}, {}), "('Single circle', canvas)", False, 'import cv2\n'), ((14, 0, 14, 14), 'cv2.waitKey', 'cv2.waitKey', ({(14, 12, 14, 13): '(0)'}, {}), '(0)', False, 'import cv2\n'), ((20, 9, 20, 46), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((27, 0, 27, 40), 'cv2.imshow', 'cv2.imshow', ({(27, 11, 27, 31): '"""concentric circles"""', (27, 33, 27, 39): 'canvas'}, {}), "('concentric circles', canvas)", False, 'import cv2\n'), ((28, 0, 28, 14), 'cv2.waitKey', 'cv2.waitKey', ({(28, 12, 28, 13): '(0)'}, {}), '(0)', False, 'import cv2\n'), ((33, 9, 33, 46), 'numpy.zeros', 'np.zeros', (), '', True, 'import numpy as np\n'), ((39, 0, 39, 28), 'cv2.imshow', 'cv2.imshow', ({(39, 11, 39, 19): '"""Canvas"""', (39, 21, 39, 27): 'canvas'}, {}), "('Canvas', canvas)", False, 'import cv2\n'), ((40, 0, 40, 14), 'cv2.waitKey', 'cv2.waitKey', ({(40, 12, 40, 13): '(0)'}, {}), '(0)', False, 'import cv2\n'), ((25, 4, 25, 51), 'cv2.circle', 'cv2.circle', ({(25, 15, 25, 21): 'canvas', (25, 23, 25, 40): '(centerX, centerY)', (25, 42, 25, 43): 'r', (25, 45, 25, 50): 'white'}, {}), '(canvas, (centerX, centerY), r, white)', False, 'import cv2\n'), ((35, 13, 35, 45), 'numpy.random.randint', 'np.random.randint', (), '', True, 'import numpy as np\n'), ((37, 9, 37, 54), 'numpy.random.randint', 'np.random.randint', (), '', True, 'import numpy as np\n'), ((36, 12, 36, 57), 'numpy.random.randint', 'np.random.randint', (), '', True, 'import numpy as np\n')]