<jupyter_start><jupyter_text>Draw Geometric Shape with Mouse Click  Import Libraries<jupyter_code>import cv2
import numpy as np<jupyter_output><empty_output><jupyter_text>Drawing Blue Circles on Black Screen by Left Button click on Mouse<jupyter_code># Create s circle shape finction to draw a circle on left button click event
def circle_shape(event, x, y, flagval, par):
    if event == cv2.EVENT_LBUTTONDOWN:
        cv2.circle(image_window, (x,y), 50, (255,0,0), -1)
        

# Naming the window so we can reference it
cv2.namedWindow(winname = 'Image_Window')

# Connecting the mouse button to the callback function
cv2.setMouseCallback('Image_window', circle_shape)

# Creating a black image
image_window = np.zeros((1024,1024,3), np.uint8)

while True: # Keep the block image window open untill we break with Esc key on keyboard
    
    #show the image window
    cv2.imshow('Image_window', image_window)
    
    if cv2.waitKey(20) & 0xFF == 27:
        break
cv2.destroyAllWindows()<jupyter_output><empty_output><jupyter_text>Drawing Blue Circles on Black Screen by Left Button click & Red color circle by Right button click on Mouse<jupyter_code># Create s circle shape finction to draw a circle on left button click event
def circle_shape(event, x, y, flagval, par):
    if event == cv2.EVENT_LBUTTONDOWN:
        cv2.circle(image_window, (x,y), 50, (255,0,0), -1)
    elif event == cv2.EVENT_RBUTTONDOWN:
        cv2.circle(image_window, (x,y), 50, (0,0,255), -1)
        
        
# Naming the window so we can reference it
cv2.namedWindow(winname = 'Image_Window')

# Connecting the mouse button to the callback function
cv2.setMouseCallback('Image_window', circle_shape)

# Creating a black image
image_window = np.zeros((1024,1024,3), np.uint8)

while True: # Keep the block image window open untill we break with Esc key on keyboard
    
    #show the image window
    cv2.imshow('Image_window', image_window)
    
    if cv2.waitKey(20) & 0xFF == 27:
        break
cv2.destroyAllWindows()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09224730127576054, 'fraction_numerical': 0.03483807654563297, 'mean_word_length': 4.228205128205128, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '268446', 'license': 'MIT', 'n_tokens_mistral': 693, 'n_tokens_neox': 660, 'n_words': 216, 'path': 'Ex-04-Draw Geometric Shape with Mouse Click.ipynb', 'repo_name': 'imsanjoykb/Computer-Vision-Bootcamp', 'size': '2038'}