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)
[((141, 179), 'numpy.zeros', 'np.zeros', (['(300, 300, 3)'], {'dtype': '"""uint8"""'}), "((300, 300, 3), dtype='uint8')\n", (149, 179), True, 'import numpy as np\n'), ((324, 365), 'cv2.circle', 'cv2.circle', (['canvas', '(100, 100)', '(10)', 'green'], {}), '(canvas, (100, 100), 10, green)\n', (334, 365), False, 'import cv2\n'), ((364, 399), 'cv2.imshow', 'cv2.imshow', (['"""Single circle"""', 'canvas'], {}), "('Single circle', canvas)\n", (374, 399), False, 'import cv2\n'), ((400, 414), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (411, 414), False, 'import cv2\n'), ((553, 591), 'numpy.zeros', 'np.zeros', (['(300, 300, 3)'], {'dtype': '"""uint8"""'}), "((300, 300, 3), dtype='uint8')\n", (561, 591), True, 'import numpy as np\n'), ((755, 795), 'cv2.imshow', 'cv2.imshow', (['"""concentric circles"""', 'canvas'], {}), "('concentric circles', canvas)\n", (765, 795), False, 'import cv2\n'), ((796, 810), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (807, 810), False, 'import cv2\n'), ((895, 933), 'numpy.zeros', 'np.zeros', (['(300, 300, 3)'], {'dtype': '"""uint8"""'}), "((300, 300, 3), dtype='uint8')\n", (903, 933), True, 'import numpy as np\n'), ((1177, 1205), 'cv2.imshow', 'cv2.imshow', (['"""Canvas"""', 'canvas'], {}), "('Canvas', canvas)\n", (1187, 1205), False, 'import cv2\n'), ((1206, 1220), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}), '(0)\n', (1217, 1220), False, 'import cv2\n'), ((706, 754), 'cv2.circle', 'cv2.circle', (['canvas', '(centerX, centerY)', 'r', 'white'], {}), '(canvas, (centerX, centerY), r, white)\n', (716, 754), False, 'import cv2\n'), ((969, 999), 'numpy.random.randint', 'np.random.randint', (['(5)'], {'high': '(200)'}), '(5, high=200)\n', (986, 999), True, 'import numpy as np\n'), ((1078, 1119), 'numpy.random.randint', 'np.random.randint', (['(0)'], {'high': '(300)', 'size': '(2,)'}), '(0, high=300, size=(2,))\n', (1095, 1119), True, 'import numpy as np\n'), ((1014, 1055), 'numpy.random.randint', 'np.random.randint', (['(0)'], {'high': '(256)', 'size': '(3,)'}), '(0, high=256, size=(3,))\n', (1031, 1055), True, 'import numpy as np\n')]