import cv2 import numpy as np from matplotlib import pyplot as plt # # Load an color image in grayscale # img = cv2.imread('lena.jpg',0) # cv2.imshow('image', img) # cv2.waitKey(0) # cv2.destroyAllWindows() # cv2.imwrite('lena.png', img) # # plt.imshow(img, cmap = 'gray', interpolation='bicubic') # plt.xticks([]), plt.yticks([]) # plt.show() # # Drawing Line #Create a black image img = np.zeros(( 512 , 512 , 3 ), np.uint8) #Draw a diagonal blue line with thickness of 5px img = cv2.line( img , ( 0 , 0 ), ( 511 , 511 ),( 255 , 0 , 0 ), 5 ) img = cv2.circle( img , ( 447 , 63 ), 63 , ( 0 , 0 , 255 ), - 1 ) img = cv2.ellipse( img , ( 256 , 256 ),( 100 , 50 ), 0 , 0 , 180 , 255 ,- 1 ) font = cv2.FONT_HERSHEY_SIMPLEX cv2.putText( img , 'opencv' , ( 10 , 500 ), font, 4 , ( 255 , 255 , 255 ), 2 ,cv2.LINE_AA) cv2.imshow( 'image' , img ) cv2.waitKey( 0 ) cv2.destroyAllWindows() ===================================================...