Skip to content

Instantly share code, notes, and snippets.

@saurabhpal97
Created March 23, 2019 09:34
Show Gist options
  • Save saurabhpal97/4c3574d47cb653e1b049e72c5240b230 to your computer and use it in GitHub Desktop.
Save saurabhpal97/4c3574d47cb653e1b049e72c5240b230 to your computer and use it in GitHub Desktop.
#importing the required libraries
import numpy as np
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
#reading the image
image = cv2.imread('index.png')
#shifting the image 100 pixels in both dimensions
M = np.float32([[1,0,-100],[0,1,-100]])
dst = cv2.warpAffine(image,M,(cols,rows))
plt.imshow(dst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment