Image processing - face swap using python(cv2)
Code:-
import cv2
photo = cv2.imread('modi_trump.jpg')
cv2.imshow('before_modi_trump', photo)
cv2.waitKey()
cv2.destroyAllWindows()
crop = photo[13:73, 56:106].copy()
photo[13:73, 56:106] = photo[50:110, 210:260]
photo[50:110, 210:260] = crop
cv2.imshow('After_modi_trump', photo)
cv2.waitKey()
cv2.destroyAllWindows()
Code:-
import cv2
photo = cv2.imread('modi_trump.jpg')
cv2.imshow('before_modi_trump', photo)
cv2.waitKey()
cv2.destroyAllWindows()
crop = photo[13:73, 56:106].copy()
photo[13:73, 56:106] = photo[50:110, 210:260]
photo[50:110, 210:260] = crop
cv2.imshow('After_modi_trump', photo)
cv2.waitKey()
cv2.destroyAllWindows()
Comments
Post a Comment
Please share your experience.....