diff --git a/line2.py b/line2.py new file mode 100644 index 0000000..e8af6ee --- /dev/null +++ b/line2.py @@ -0,0 +1,23 @@ + import numpy as np +import cv2 + +# Create a black image +img = np.zeros((512,512,3), np.uint8) + +# Draw a diagonal blue line with thickness of 5 px +img = cv2.line(img,(0,0),(511,511),(255,0,0),5) #initial,final, intensity, thickness +cv2.imshow('ankit',img) +cv2.waitKey(0) +cv2.destroyAllWindows() +img = cv2.rectangle(img,(384,0),(510,128),(0,255,0),3) +cv2.imshow('ankit',img) +cv2.waitKey(0) +cv2.destroyAllWindows() +img = cv2.circle(img,(447,63), 63, (0,0,255), -1) +cv2.imshow('ankit',img) +cv2.waitKey(0) +cv2.destroyAllWindows() +img = cv2.ellipse(img,(256,256),(100,50),0,0,180,255,-1) +cv2.imshow('ankit',img) +cv2.waitKey(0) +cv2.destroyAllWindows()