Create Image using Python and crop the image and Swap and Merge two images to make one single Image

KARTHICK P
Aug 11, 2021
import cv2
import
numpy
photo=numpy.zeros((500,500))
cv2.imshow('task1',photo)
cv2.waitKey()
cv2.destroyAllWindows()
cv2.imwrite('task1.jpg',photo)
photo=cv2.imread('task1.jpg')
photo.shape
photo=cv2.rectangle(photo,(120,160),(240,400),[120,56,135],10)
cv2.imshow('photo',photo)
cv2.waitKey()
cv2.destroyAllWindows()
lphoto = cv2.line(photo,(120,160),(180,80),[120,56,135],10)
inserting the shape of line into the image with function line(imagename,(x1-cordinate,y1-cordinate),[B,G,R],thickness)cv2.imshow('photo',lphoto)
cv2.waitKey()
cv2.destroyAllWindows()
lphoto1 = cv2.line(photo,(240,160),(180,80),[120,56,135],10)
cv2.imshow('photo',lphoto1)
cv2.waitKey()
cv2.destroyAllWindows()
rect=cv2.rectangle(lphoto1,(160,240),(200,400),[0,75,125],10)
cv2.imshow('photo',rect)
cv2.waitKey()
cv2.destroyAllWindows()
circle=cv2.circle(rect,(380,100),15,[253,250,211],100)
cv2.imshow('photo',circle)
cv2.waitKey()

--

--