Created
January 6, 2016 14:39
-
-
Save PeaceAndHiLight/1f66fca6bc5ec705bd9c to your computer and use it in GitHub Desktop.
Python Copy ROI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import cv2 | |
import numpy as np | |
# Read Image | |
img = cv2.imread('beatles_forsale.jpg') | |
# Copy John's Face | |
john = img[20:80, 40:100] | |
img[30:90, 90:150] = john | |
cv2.imwrite('copyJohn.jpg', img) | |
cv2.imshow('forsale_edit', img) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment