# Python program to explain cv2.rectangle() method# importing cv2importcv2# pathpath=r'C:\Users\Rajnish\Desktop\geeksforgeeks\geeks.png'# Reading an image in grayscale modeimage=cv2.imread(path,0)# Window name in which image is displayedwindow_name='Image'# Start coordinate, here (100, 50)# represents the top left corner of rectanglestart_point=(100,50)# Ending coordinate, here (125, 80)# represents the bottom right corner of rectangleend_point=(125,80)# Black color in BGRcolor=(0,0,0)# Line thickness of -1 px# Thickness of -1 will fill the entire shapethickness=-1# Using cv2.rectangle() method# Draw a rectangle of black color of thickness -1 pximage=cv2.rectangle(image,start_point,end_point,color,thickness)# Displaying the imagecv2.imshow(window_name,image)